query stringlengths 7 3.85k | document stringlengths 11 430k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
startLiveReloadServer initializes a livereload to notify the browser of changes to code that does not need a recompile. | func startLiveReloadServer(tpls *template.Template, cfg *env.Config, staticAssets *static.Files) error {
if cfg.IsProduction {
return nil
}
log.Info("Initializing livereload")
paths := []string{
"assets",
"templates",
}
tmplFn := func(name string) (bool, error) {
templates, err := initTemplates(cfg, staticAssets)
if err != nil {
return false, err
}
*tpls = *templates
return true, nil
}
mappings := livereload.ReloadMapping{
".css": nil,
".js": nil,
".tmpl": tmplFn,
}
_, err := livereload.ListenAndServe(livereload.DefaultPort, paths, mappings)
return err
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func reload(l net.Listener, httpServer *http.Server) error {\n\tconst errLoc = \"main.reload()\"\n\n\t// Making duplicate for socket descriptor\n\t// to use them in child process.\n\tfile, err := (l.(*net.TCPListener)).File()\n\tif err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"%s: failed to get file of listener, r... | [
"0.5976077",
"0.59226185",
"0.5880268",
"0.5784931",
"0.57804745",
"0.57739013",
"0.5734538",
"0.5710085",
"0.56784874",
"0.5660749",
"0.562987",
"0.56220937",
"0.56210876",
"0.56204873",
"0.56059647",
"0.56023747",
"0.5602115",
"0.5571002",
"0.5558408",
"0.5542132",
"0.55389... | 0.85250896 | 0 |
CreateFooterView creates a footer area for the application | func CreateFooterView(g *gocui.Gui) error {
viewName := "footer"
if footer, err := g.SetView(viewName, maxX/6+1, maxY-maxY/4, maxX-1, maxY-1); err != nil {
if err != gocui.ErrUnknownView {
return err
}
footer.Wrap = true
footer.Title = "Top HeadLines"
footer.SelBgColor = gocui.ColorGreen
footer.SelFgColor = gocui.ColorRed
fmt.Fprintln(footer, Country, Source, Category)
}
views = append(views, viewName)
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (tui *TUI) drawFooter() {\n\tmin := int(tui.trackDuration.Minutes())\n\tsecs := int(tui.trackDuration.Seconds()) % 60\n\tvar title string\n\tif tui.currentTrack != nil {\n\t\ttitle = tui.currentTrack.Title\n\t}\n\ttui.footer.Clear()\n\tfmt.Fprintf(tui.footer, \"%02d:%02d / %s\", min, secs, title)\n\ttui.app.D... | [
"0.5952441",
"0.59190524",
"0.5908554",
"0.5871804",
"0.5760129",
"0.5682298",
"0.5645047",
"0.5610753",
"0.55848986",
"0.5469786",
"0.5427311",
"0.5382227",
"0.53675103",
"0.52462083",
"0.5153982",
"0.51538026",
"0.50929487",
"0.50820076",
"0.50206304",
"0.49679133",
"0.4943... | 0.81811273 | 0 |
Search scrapes azlyrics.com for song lyrics and does regex magic to clean them up. Beware, your IP can AND will get blocked while running this, but it is only called in `go generate` (see midi/generate.go) so a normal user will never run this. | func Search(query string) (string, error) {
v := url.Values{
"q": []string{query},
}
uri := fmt.Sprintf("%s?%s", queryURI, v.Encode())
// start the scrape
resp, err := http.Get(uri)
if err != nil {
logrus.Fatalf("requesting %s failed: %v", uri, err)
}
defer resp.Body.Close()
doc, err := goquery.NewDocumentFromReader(resp.Body)
if err != nil {
logrus.Fatalf("creating document failed: %v", err)
}
link, ok := doc.Find("td").First().Find("a").Attr("href")
if !ok {
return "", fmt.Errorf("could not find top link at %s", uri)
}
// get the lyrics link
resp, err = http.Get(link)
if err != nil {
return "", fmt.Errorf("request to %s failed: %v", link, err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", fmt.Errorf("reading body from %s failed: %v", link, err)
}
// get the lyrics from the HTML
html := re.FindStringSubmatch(string(body))
if len(html) <= 0 {
return "", fmt.Errorf("[%s] regex parsing failed for body: %s", query, body)
}
// strip html tags from decoded lyrics
lyrics := reHTML.ReplaceAllString(html[0], "")
return lyrics, nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (e ExtractorFunc) ExtractLyrics(req request.Requester) (*lyrics.Info, error) {\n\treturn e(req)\n}",
"func wikia(track track.Track) ([]string, error) {\n\turl := getLyricsURL(track)\n\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\te := fmt.Sprintf(\"Could not access the URL: %s\", err)\n\t\treturn []... | [
"0.52739537",
"0.51263285",
"0.5093622",
"0.5088494",
"0.50840664",
"0.5020079",
"0.50154114",
"0.49768645",
"0.49582195",
"0.48772937",
"0.47692233",
"0.4733775",
"0.47052535",
"0.4684843",
"0.46371776",
"0.463235",
"0.45981294",
"0.45856765",
"0.4562131",
"0.44904724",
"0.4... | 0.58847344 | 0 |
WithProxyConfig returns a proxy config functional option | func WithProxyConfig(cfg config.Proxy) GRPCOption {
return func(h *GRPCHandler) {
h.proxyCfg = cfg
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func WithProxyUrl(proxyURL string) configurer {\n\treturn func(conf *config) {\n\t\tconf.proxyURL = proxyURL\n\t}\n}",
"func (o MustGatherSpecOutput) ProxyConfig() MustGatherSpecProxyConfigPtrOutput {\n\treturn o.ApplyT(func(v MustGatherSpec) *MustGatherSpecProxyConfig { return v.ProxyConfig }).(MustGatherSpecPr... | [
"0.7345297",
"0.7208164",
"0.71902514",
"0.71116483",
"0.7076825",
"0.69628906",
"0.6940307",
"0.69159514",
"0.6877981",
"0.67587405",
"0.65878874",
"0.6566005",
"0.64126563",
"0.6381108",
"0.6376971",
"0.63682663",
"0.63555306",
"0.6329982",
"0.62516534",
"0.6219726",
"0.621... | 0.7866575 | 0 |
WithRoleTokenConfig returns a role token config functional option | func WithRoleTokenConfig(cfg config.RoleToken) GRPCOption {
return func(h *GRPCHandler) {
h.roleCfg = cfg
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (h *handler) RoleToken(w http.ResponseWriter, r *http.Request) error {\n\tdefer flushAndClose(r.Body)\n\n\tvar data model.RoleRequest\n\terr := json.NewDecoder(r.Body).Decode(&data)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttok, err := h.role(r.Context(), data.Domain, data.Role, data.ProxyForPrincipal, data.... | [
"0.65500444",
"0.6109445",
"0.6060574",
"0.5755772",
"0.55504984",
"0.5467545",
"0.53978205",
"0.53978205",
"0.53978205",
"0.5376566",
"0.5308736",
"0.5294586",
"0.5285593",
"0.52821636",
"0.5274694",
"0.52643675",
"0.52467155",
"0.51788664",
"0.51758593",
"0.5169364",
"0.516... | 0.7468508 | 0 |
WithAuthorizationd returns a authorizationd functional option | func WithAuthorizationd(a service.Authorizationd) GRPCOption {
return func(h *GRPCHandler) {
h.authorizationd = a
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (c Client) WithAuthorization() PrepareDecorator {\n\treturn c.authorizer().WithAuthorization()\n}",
"func WithAuthorization(hhandler http.Handler, auth authorizer.Authorizer, s runtime.NegotiatedSerializer) http.Handler {\n\treturn withAuthorization(hhandler, auth, s, recordAuthorizationMetrics)\n}",
"fun... | [
"0.64171565",
"0.61032623",
"0.606701",
"0.5921552",
"0.5781001",
"0.57581466",
"0.563823",
"0.560635",
"0.54691887",
"0.5381755",
"0.5379844",
"0.5237179",
"0.52248925",
"0.51815754",
"0.51697916",
"0.5129923",
"0.5112342",
"0.50532514",
"0.50527006",
"0.5043038",
"0.5032289... | 0.69239974 | 0 |
start gin server and load application Swagger Documentation annotations: | func main() {
// load config
config.Init()
// services
services.Init()
// start gin server
router.RunGin()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func main() {\n\n\t// This will pack config-files folder inside binary\n\t// you need rice utility for it\n\tbox := rice.MustFindBox(\"config-files\")\n\n\tinitErr := initializer.InitAll(box)\n\tif initErr != nil {\n\t\tlog.Fatalln(initErr)\n\t}\n\tr := gin.Default()\n\tpprof.Register(r)\n\tr.GET(\"/doc/*any\", gi... | [
"0.65022033",
"0.64835835",
"0.6172741",
"0.61727226",
"0.6147869",
"0.61119086",
"0.6090787",
"0.6024575",
"0.6022573",
"0.6004785",
"0.5878896",
"0.58692914",
"0.58187157",
"0.57975346",
"0.57680064",
"0.57562286",
"0.5727846",
"0.5694507",
"0.5693325",
"0.56817377",
"0.565... | 0.5927891 | 10 |
ExpectEqual is the helper function for test each case | func ExpectEqual(alert func(format string, args ...interface{}),
expected interface{}, actual interface{}) bool {
expectedValue, actualValue := reflect.ValueOf(expected), reflect.ValueOf(actual)
equal := false
switch {
case expected == nil && actual == nil:
return true
case expected != nil && actual == nil:
equal = expectedValue.IsNil()
case expected == nil && actual != nil:
equal = actualValue.IsNil()
default:
if actualType := reflect.TypeOf(actual); actualType != nil {
if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) {
equal = reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual)
}
}
}
if !equal {
_, file, line, _ := runtime.Caller(1)
alert("%s:%d: missmatch, expect %v but %v", file, line, expected, actual)
return false
}
return true
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func expectEqual(actual interface{}, extra interface{}, explain ...interface{}) {\n\tgomega.ExpectWithOffset(1, actual).To(gomega.Equal(extra), explain...)\n}",
"func expectEqual(value, expected interface{}) {\n\tif value != expected {\n\t\tfmt.Printf(\"Fehler: %v bekommen, erwartet war aber %v.\\n\", value, exp... | [
"0.73963916",
"0.7357671",
"0.72004604",
"0.72004604",
"0.68299437",
"0.6658801",
"0.6617247",
"0.6568662",
"0.65523875",
"0.64350367",
"0.63778836",
"0.63778836",
"0.6365881",
"0.63602674",
"0.632675",
"0.63203734",
"0.6273329",
"0.6267964",
"0.6252295",
"0.6248969",
"0.6248... | 0.7185996 | 6 |
HELPERS Gets the attacker chance after accounting for modifiers | func (c *Conflict) GetModAttackerChance() int32 {
// TODO: Return modified attacker chance
return c.BaseChance()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func doesHit(attacker *pet, defender pet) (bool){\n\tchanceToHit := float64(attacker.EffectiveACC) - defender.EffectiveEVA\n\t\n\tif float64(rand.Intn(100)) < chanceToHit {\n\t\treturn true\n\t}\n\t\n\t//fmt.Println(attacker.PetUser.Username, \" miss!\")\n\tattacker.MissCount++\n\treturn false\n}",
"func (p *Pla... | [
"0.63353246",
"0.60036635",
"0.5936208",
"0.5760439",
"0.572633",
"0.5621206",
"0.56166786",
"0.5572953",
"0.5570117",
"0.54906464",
"0.542936",
"0.5409767",
"0.5389871",
"0.538468",
"0.5332171",
"0.53146607",
"0.5296809",
"0.5295871",
"0.5279863",
"0.5268397",
"0.5248359",
... | 0.58057666 | 3 |
Gets the defender chance after accounting for modifiers | func (c *Conflict) GetModDefenderChance() int32 {
// TODO: Return modifier defender chance
return c.BaseChance()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func getDamage(attacker *pet, defender pet) (float64) {\n\tif doesCrit(attacker) {\n\t\treturn 2*(attacker.EffectiveATK * (100.00/(defender.EffectiveDEF + 100.00)))\n\t}\n\t\n\treturn attacker.EffectiveATK * (100.00/(defender.EffectiveDEF + 100.00))\n}",
"func (c *Conflict) GetModAttackerChance() int32 {\n\t// T... | [
"0.6194889",
"0.61754656",
"0.61005557",
"0.5939384",
"0.5802302",
"0.5753514",
"0.5746806",
"0.54749453",
"0.54497707",
"0.54424155",
"0.5411699",
"0.5332017",
"0.53062475",
"0.5304713",
"0.5244101",
"0.52316695",
"0.5213608",
"0.5160024",
"0.51429135",
"0.51058805",
"0.5092... | 0.7181684 | 0 |
QUERIES Checks if province is the location of a conflict | func (s *State) IsSiteOfConflict(id pb.ProvinceId) bool {
for _, c := range s.Conflicts {
for _, l := range c.Locations() {
if l == id {
return true
}
}
}
return false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func checkProvinceValid(citizenNo []byte) bool {\n\tprovinceCode := make([]byte, 0)\n\tprovinceCode = append(provinceCode, citizenNo[:2]...)\n\tprovinceStr := string(provinceCode)\n\n\t// 判断省份/地区是否合规\n\tif _, ok := validProvince[provinceStr]; ok {\n\t\treturn true\n\t}\n\treturn false\n}",
"func (w *Worker) In(r... | [
"0.5658489",
"0.53894514",
"0.5341391",
"0.5287556",
"0.5286399",
"0.52390695",
"0.5008304",
"0.49755126",
"0.49598086",
"0.49070632",
"0.4902826",
"0.48903996",
"0.48770154",
"0.48651946",
"0.48634878",
"0.48171234",
"0.48066315",
"0.47969204",
"0.47834495",
"0.4744221",
"0.... | 0.61279434 | 0 |
Checks if province is at war (not necessarily location of conflict) | func (s *State) IsAtWar(id pb.ProvinceId) bool {
for _, c := range s.Conflicts {
for _, a := range c.Attackers() {
if a == id {
return true
}
}
for _, d := range c.Defenders() {
if d == id {
return true
}
}
}
return false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (s *State) IsSiteOfConflict(id pb.ProvinceId) bool {\n\tfor _, c := range s.Conflicts {\n\t\tfor _, l := range c.Locations() {\n\t\t\tif l == id {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}",
"func checkProvinceValid(citizenNo []byte) bool {\n\tprovinceCode := make([]byte, 0)\n\tprovinceCo... | [
"0.57962584",
"0.55487424",
"0.5342499",
"0.53356093",
"0.5323124",
"0.52885604",
"0.52777106",
"0.51641357",
"0.5091826",
"0.50897366",
"0.5077543",
"0.5004437",
"0.4968343",
"0.49320322",
"0.4922909",
"0.49174032",
"0.48947048",
"0.4862266",
"0.48564965",
"0.48328453",
"0.4... | 0.6892222 | 0 |
Gets a conflict by location | func (s *State) GetConflict(location pb.ProvinceId) *Conflict {
return s.Conflicts[location]
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (b *BranchDAG) Conflict(conflictID ConflictID) *CachedConflict {\n\treturn &CachedConflict{CachedObject: b.conflictStorage.Load(conflictID.Bytes())}\n}",
"func NewConflictResolver(\n\tconfig Config, fbo *folderBranchOps) *ConflictResolver {\n\t// make a logger with an appropriate module name\n\tbranchSuffix... | [
"0.576138",
"0.5587241",
"0.5540109",
"0.54999095",
"0.5465813",
"0.5445901",
"0.5393411",
"0.52668756",
"0.524657",
"0.52306247",
"0.5203719",
"0.5173703",
"0.51696897",
"0.5167564",
"0.5155827",
"0.5137515",
"0.51233417",
"0.5119585",
"0.51193464",
"0.50692385",
"0.50082576... | 0.6948077 | 0 |
ACTIONS Creates a new conventional war | func (s *State) NewConventionalWar(defenders []pb.ProvinceId, attackers []pb.ProvinceId, locations []pb.ProvinceId) bool { // TODO: Error return
for _, d := range defenders {
if s.IsAtWar(d) || s.IsSiteOfConflict(d) {
return false
}
}
for _, a := range attackers {
if s.IsAtWar(a) || s.IsSiteOfConflict(a) {
return false
}
}
for _, l := range locations {
if s.IsAtWar(l) || s.IsSiteOfConflict(l) {
return false
}
}
// TODO: Logic for joining wars?
c := &Conflict{
name: "War!", // TODO
length: 0,
attackers: Faction{
members: attackers,
progress: 0,
},
defenders: Faction{
members: defenders,
progress: 0,
},
goal: s.Settings().GetConflictGoal(pb.ConflictType_CONVENTIONAL_WAR),
base_chance: s.Settings().GetConflictBaseChance(pb.ConflictType_CONVENTIONAL_WAR),
locations: locations,
conflict_type: pb.ConflictType_CONVENTIONAL_WAR,
}
// For now it maps only to the first location
s.Conflicts[locations[0]] = c
return true
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (act *CreateAction) Do() error {\n\tif err := act.genAppID(); err != nil {\n\t\treturn act.Err(pbcommon.ErrCode_E_BS_SYSTEM_UNKONW, err.Error())\n\t}\n\n\t// create app.\n\tif errCode, errMsg := act.create(); errCode != pbcommon.ErrCode_E_OK {\n\t\treturn act.Err(errCode, errMsg)\n\t}\n\n\t// create default c... | [
"0.5422324",
"0.53584725",
"0.53448",
"0.5287516",
"0.52773815",
"0.5246244",
"0.52251047",
"0.51807857",
"0.51713514",
"0.511613",
"0.51064235",
"0.5069214",
"0.5046266",
"0.5044224",
"0.5038556",
"0.50373405",
"0.5035873",
"0.49775773",
"0.49586117",
"0.49527675",
"0.494153... | 0.57780945 | 0 |
Creates a new civil war | func (s *State) NewCivilWar(target pb.ProvinceId) bool { // TODO: Error return
if s.IsAtWar(target) || s.IsSiteOfConflict(target) {
return false
}
c := &Conflict{
name: "Civil War", // TODO
length: 0,
attackers: Faction{
rebels: *(s.Get(target).Dissidents()),
progress: 0,
},
defenders: Faction{
members: []pb.ProvinceId{target},
progress: 0,
},
goal: s.Settings().GetConflictGoal(pb.ConflictType_CIVIL_WAR),
base_chance: s.Settings().GetConflictBaseChance(pb.ConflictType_CIVIL_WAR),
locations: []pb.ProvinceId{target},
conflict_type: pb.ConflictType_CIVIL_WAR,
}
s.Conflicts[target] = c
return true
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (s *State) NewColonialWar(target pb.ProvinceId) bool { // TODO: Error return\n\tif s.IsAtWar(target) || s.IsSiteOfConflict(target) || s.Get(target).Occupier() != pb.ProvinceId_NONE {\n\t\treturn false\n\t}\n\tc := &Conflict{\n\t\tname: \"Colonial War\", // TODO\n\t\tlength: 0,\n\t\tattackers: Faction{\n\t\t... | [
"0.63012815",
"0.6095818",
"0.6035038",
"0.57367706",
"0.5401127",
"0.5373335",
"0.53593504",
"0.5359165",
"0.53430766",
"0.5266468",
"0.5165891",
"0.5091316",
"0.5086812",
"0.5075339",
"0.5065485",
"0.5056614",
"0.50516707",
"0.50405157",
"0.50387293",
"0.5027701",
"0.502645... | 0.70646715 | 0 |
Creates a new colonial war | func (s *State) NewColonialWar(target pb.ProvinceId) bool { // TODO: Error return
if s.IsAtWar(target) || s.IsSiteOfConflict(target) || s.Get(target).Occupier() != pb.ProvinceId_NONE {
return false
}
c := &Conflict{
name: "Colonial War", // TODO
length: 0,
attackers: Faction{
// Dissidents
progress: 0,
},
defenders: Faction{
members: []pb.ProvinceId{s.Get(target).Occupier()},
progress: 0,
},
goal: s.Settings().GetConflictGoal(pb.ConflictType_COLONIAL_WAR),
base_chance: s.Settings().GetConflictBaseChance(pb.ConflictType_COLONIAL_WAR),
locations: []pb.ProvinceId{target},
conflict_type: pb.ConflictType_COLONIAL_WAR,
}
s.Conflicts[target] = c
return true
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func New() *WarmerImpl {\n\treturn &WarmerImpl{}\n}",
"func (s *State) NewCivilWar(target pb.ProvinceId) bool { // TODO: Error return\n\tif s.IsAtWar(target) || s.IsSiteOfConflict(target) {\n\t\treturn false\n\t}\n\tc := &Conflict{\n\t\tname: \"Civil War\", // TODO\n\t\tlength: 0,\n\t\tattackers: Faction{\n\t\... | [
"0.56587833",
"0.55127555",
"0.5402266",
"0.5390911",
"0.5193612",
"0.5152806",
"0.5053274",
"0.5042677",
"0.5010594",
"0.49777117",
"0.4954968",
"0.49475503",
"0.49337056",
"0.49120912",
"0.49102825",
"0.490297",
"0.4892262",
"0.48919317",
"0.48588496",
"0.48468164",
"0.4788... | 0.6932265 | 0 |
Creates a new military intervention TODO Processes a conflict (rolls to determine progress, handles outcome) Returns false if conflict resolves | func (c *Conflict) Process(p *pseudo.State) WarResult {
c.length = c.length + 1
def_prog := p.Happens(c.GetModDefenderChance())
att_prog := p.Happens(c.GetModAttackerChance())
if att_prog {
// Attackers progress
c.attackers.progress++
}
if def_prog {
// Defenders progress
c.defenders.progress++
}
if att_prog && def_prog {
c.goal++
}
if c.attackers.progress >= c.goal {
return ATTACKER
} else if c.defenders.progress >= c.goal {
return DEFENDER
}
return ONGOING
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func NewConflict(parameters ...wparams.ParamStorer) Error {\n\treturn newGenericError(nil, DefaultConflict, wparams.NewParamStorer(parameters...))\n}",
"func NewConflict(field string) *AppError {\n\treturn NewError(AlreadyExists, field, \"already exists\")\n}",
"func Conflict(id Identifier) Constraint {\n\tret... | [
"0.529359",
"0.5229895",
"0.52119213",
"0.5167439",
"0.51114",
"0.5056564",
"0.49670407",
"0.4965979",
"0.4913384",
"0.48987553",
"0.48867497",
"0.48669258",
"0.4865068",
"0.48591155",
"0.48306325",
"0.48230824",
"0.48123473",
"0.48010728",
"0.4800759",
"0.47991014",
"0.47915... | 0.52392757 | 1 |
I also wanted to implement map, foreach, ... methods, but it's just not possible | func (l List) IsEmpty() bool {
if len(l.elements) == 0 {
return true
} else {
return false
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func Map(array []interface{}, iterator ResultIterator) []interface{} {\r\n\tvar result = make([]interface{}, len(array))\r\n\tfor index, data := range array {\r\n\t\tresult[index] = iterator(data, index)\r\n\t}\r\n\treturn result\r\n}",
"func Map[T any, U any](items []T, f func(T) U) []U {\n\toutputItems := make... | [
"0.6765267",
"0.6430332",
"0.6413866",
"0.6319985",
"0.6291821",
"0.6289037",
"0.6270705",
"0.62303656",
"0.6190384",
"0.60611576",
"0.6056677",
"0.60296446",
"0.5927682",
"0.5918407",
"0.59146017",
"0.588991",
"0.5885376",
"0.5875884",
"0.5833732",
"0.5825184",
"0.5819225",
... | 0.0 | -1 |
NewDialog is a helper to spawn a new bit of game dialog | func NewDialog(text string, fontSize float32) {
rl.DrawRectangleRec(
rl.NewRectangle(0, 0, float32(rl.GetScreenWidth()), float32(rl.GetScreenHeight()/5)),
rl.Black,
)
rl.DrawRectangleLinesEx(
rl.NewRectangle(0, 0, float32(rl.GetScreenWidth()), float32(rl.GetScreenHeight()/5)),
4,
rl.White,
)
rl.DrawTextRecEx(
rl.GetFontDefault(),
text,
rl.NewRectangle(20, 20, float32(rl.GetScreenWidth()), float32(rl.GetScreenHeight()/5)),
fontSize,
1,
true,
rl.RayWhite,
0,
int32(rl.GetScreenWidth()),
rl.White,
rl.Black,
)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func NewDialog(text string) *Dialog {\n\treturn &Dialog{\n\t\tStyleName: \"Default\",\n\t\tStart: \"0:00:00.00\", End: \"0:00:05.00\",\n\t\tText: text}\n}",
"func NewDialog(input TL) (d *Dialog) {\n\td = new(Dialog)\n\tif dialog, ok := input.(TL_dialog); ok {\n\t\tswitch pt := dialog.Peer.(type) {\n\t\tcase ... | [
"0.6481888",
"0.63578427",
"0.62546325",
"0.6170362",
"0.61563224",
"0.60556924",
"0.5908183",
"0.58998257",
"0.56593597",
"0.5580943",
"0.547547",
"0.5463997",
"0.54177654",
"0.53838277",
"0.53588384",
"0.53536123",
"0.5321696",
"0.52956635",
"0.5292912",
"0.5272295",
"0.526... | 0.7018586 | 0 |
NewLocalHashMapDBMgr instantiates a new local LRU memmgr. | func NewLocalHashMapDBMgr(pfx string) *LocalHashMapDBMgr {
return &LocalHashMapDBMgr{memMap: make(map[common.Key]interface{}),
policy: common.DBMgrPolicyLocalMap, prefix: pfx, base: Base{common.Key{BPTkey: ""}, 0}}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func NewLocalManager(ctx context.Context, root string) *LocalManager {\n\treturn &LocalManager{path: root}\n}",
"func (m *LocalManager) New(ctx context.Context, id string) (linker.Storage, error) {\n\tdb, err := NewLocalStorage(ctx, fmt.Sprintf(\"%s/db-%s\", m.path, id))\n\tif err != nil {\n\t\treturn nil, err\n... | [
"0.61819696",
"0.60259074",
"0.5961291",
"0.5807322",
"0.5721401",
"0.5707583",
"0.5698278",
"0.5694999",
"0.5629836",
"0.56234133",
"0.5574107",
"0.5541237",
"0.55317944",
"0.55115384",
"0.5459979",
"0.54501456",
"0.54334444",
"0.5427154",
"0.5390991",
"0.5389694",
"0.538360... | 0.79498154 | 0 |
GetRoot Get root base for the tree. | func (mgr *LocalHashMapDBMgr) GetRoot() (*Base, error) {
if mgr.base.RootKey.IsNil() || mgr.base.Degree == 0 {
return nil, nil
}
return &mgr.base, nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (mt *MerkleTree) GetRoot() {\n\tvar concat string\n\t// if no current transactions, set root to ''\n\tif len(mt.TransactionIDs) == 0 {\n\t\troot := \"\"\n\t\tmt.Root = &root\n\t\treturn\n\t}\n\n\tif len(mt.TransactionIDs) == 1 {\n\t\troot := mt.TransactionIDs[0]\n\t\tmt.Root = &root\n\t} else {\n\t\tconcat = ... | [
"0.72971463",
"0.6967713",
"0.6905524",
"0.68161714",
"0.6813087",
"0.6761039",
"0.6685708",
"0.6630886",
"0.66104454",
"0.6586958",
"0.6486263",
"0.6472821",
"0.64700806",
"0.6454522",
"0.64251405",
"0.6360517",
"0.6333982",
"0.6299451",
"0.6248249",
"0.62472093",
"0.6242822... | 0.7211411 | 1 |
SetRoot Set root base for the tree. | func (mgr *LocalHashMapDBMgr) SetRoot(base *Base) error {
mgr.base.Degree = base.Degree
mgr.base.RootKey = base.RootKey
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func SetRoot(path string) {\n\trootPath = path\n}",
"func (db *Database) SetRoot(newRoot *doltdb.RootValue) {\n\t// TODO: races\n\tdb.root = newRoot\n}",
"func (m *SiteCollection) SetRoot(value Rootable)() {\n m.root = value\n}",
"func (f *FileList) SetRoot(path string) {\n\tf.root = path\n}",
"func (ap... | [
"0.76017094",
"0.7533801",
"0.73356307",
"0.71561253",
"0.7128585",
"0.7020409",
"0.7009551",
"0.6978859",
"0.6884092",
"0.6771216",
"0.66614586",
"0.6644592",
"0.65779394",
"0.6544975",
"0.6466843",
"0.6459183",
"0.6454095",
"0.6399124",
"0.6379322",
"0.62789136",
"0.6234404... | 0.7836139 | 0 |
Store store a key in the DB | func (mgr *LocalHashMapDBMgr) Store(k common.Key, e interface{}) error {
tn := e.(*treeNode)
mgr.memMap[k] = tn.deepCopy()
glog.V(1).Infof("storing %v in db (val: %v)", k, mgr.memMap[k])
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (ks *VRF) Store(key *vrfkey.PrivateKey, phrase string, scryptParams utils.ScryptParams) error {\n\tks.lock.Lock()\n\tdefer ks.lock.Unlock()\n\tencrypted, err := key.Encrypt(phrase, scryptParams)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to encrypt key\")\n\t}\n\tif err := ks.orm.FirstOrCreateEn... | [
"0.67714393",
"0.6709693",
"0.6652686",
"0.66463214",
"0.64961",
"0.64282036",
"0.64141",
"0.64117914",
"0.63930196",
"0.636005",
"0.6357298",
"0.6352423",
"0.6337577",
"0.63271534",
"0.63177425",
"0.63129336",
"0.6247293",
"0.6224383",
"0.62135607",
"0.6200179",
"0.619796",
... | 0.5798247 | 85 |
Delete deletes a key from the db | func (mgr *LocalHashMapDBMgr) Delete(k common.Key) error {
glog.V(1).Infof("deleting %v from db", k)
delete(mgr.memMap, k)
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (db *FlatDatabase) Delete(key []byte) error { panic(\"not supported\") }",
"func (db *DB) Delete(key []byte) (err error) {\n\treturn db.LevigoDB.Delete(db.wo, key)\n}",
"func Del(key string) error {\n\treturn db.Update(func(txn *badger.Txn) error {\n\t\ttxn.Delete([]byte(key))\n\t\treturn nil\n\t})\n}",
... | [
"0.8436193",
"0.78931457",
"0.78192097",
"0.7810238",
"0.7771407",
"0.771081",
"0.76976925",
"0.7601846",
"0.7575751",
"0.75548416",
"0.74997205",
"0.74844617",
"0.7399691",
"0.73848826",
"0.7374052",
"0.7370087",
"0.7347871",
"0.7308298",
"0.7308298",
"0.7302377",
"0.7301854... | 0.0 | -1 |
AtomicUpdate Updates the DB atomically with the provided ops. | func (mgr *LocalHashMapDBMgr) AtomicUpdate(ops []common.DBOp) error {
for i := 0; i < len(ops); i++ {
switch {
case ops[i].Op == common.DBOpStore:
mgr.Store(ops[i].K, ops[i].E)
case ops[i].Op == common.DBOpDelete:
mgr.Delete(ops[i].K)
case ops[i].Op == common.DBOpSetRoot:
mgr.SetRoot(ops[i].E.(*Base))
}
}
return nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func update(ctx context.Context, db transactor, fn func(*bolt.Tx) error) error {\n\ttx, ok := ctx.Value(transactionKey{}).(*bolt.Tx)\n\tif !ok {\n\t\treturn db.Update(fn)\n\t} else if !tx.Writable() {\n\t\treturn errors.Wrap(bolt.ErrTxNotWritable, \"unable to use transaction from context\")\n\t}\n\treturn fn(tx)\n... | [
"0.53321916",
"0.5310427",
"0.5304057",
"0.5290424",
"0.52536964",
"0.5223758",
"0.5218239",
"0.5211529",
"0.5206224",
"0.5174038",
"0.51708364",
"0.5149535",
"0.51188",
"0.5112181",
"0.5062066",
"0.49757835",
"0.4972469",
"0.49406815",
"0.49391848",
"0.493276",
"0.49311072",... | 0.74732876 | 0 |
Load Load a key from the DB | func (mgr *LocalHashMapDBMgr) Load(k common.Key) (interface{}, error) {
node, ok := mgr.memMap[k]
glog.V(2).Infof("loading %v from db", k)
if !ok {
return nil, common.ErrNotFound
}
glog.V(2).Infof("successfully loaded %v (%v) from db", k, node)
return node.(*treeNode).deepCopy(), nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (a apiKey) Load(id interface{}, col string) (key apiKey) {\n\t// Open database connection\n\tdb, err := dbConnect()\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn\n\t}\n\n\t// Load apiKey\n\tif key, err = db.LoadAPIKey(id, col); err != nil {\n\t\tlog.Println(err.Error())\n\t}\n\n\treturn\n}",
... | [
"0.78715444",
"0.74463856",
"0.7208976",
"0.7104961",
"0.6805485",
"0.673032",
"0.6668427",
"0.6607099",
"0.65913016",
"0.65868545",
"0.65848124",
"0.6546285",
"0.65399575",
"0.6534491",
"0.6447067",
"0.6364313",
"0.6310213",
"0.62940556",
"0.6269194",
"0.6264871",
"0.6264147... | 0.6601643 | 8 |
LogAllKeys Prints the content of memory manager | func (mgr *LocalHashMapDBMgr) LogAllKeys() {
for k, e := range mgr.memMap {
glog.Infof("%v: %v", k, e)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (c *LRUCache) PrintAll() {\n\tc.mutex.RLock()\n\tdefer c.mutex.RUnlock()\n\tfor e := c.cacheList.Front(); e != nil; e = e.Next() {\n\t\tfmt.Printf(\"[%v, %v] \", e.Value.(*entry).key, e.Value.(*entry).value)\n\t}\n\tfmt.Println()\n\treturn\n}",
"func PrintAll(c config.Config) error {\n\tlog.Info(\"Opening ... | [
"0.6180221",
"0.60460794",
"0.59220344",
"0.5912047",
"0.57457006",
"0.574495",
"0.5689104",
"0.5659756",
"0.5619629",
"0.5607107",
"0.5596631",
"0.55544996",
"0.55493444",
"0.55463827",
"0.55437076",
"0.5507923",
"0.54788",
"0.5450998",
"0.5426974",
"0.54160655",
"0.54081875... | 0.78134096 | 0 |
Policy Get the policy name for this manager. | func (mgr *LocalHashMapDBMgr) Policy() string {
return mgr.policy
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (nri *NodeReportItem) GetPolicy() string {\n\n\tif nri.Policy == \"\" {\n\t\treturn \"no policy\"\n\t}\n\n\treturn nri.Policy\n}",
"func (o ResiliencyPolicyOutput) PolicyName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ResiliencyPolicy) pulumi.StringOutput { return v.PolicyName }).(pulumi.StringOutpu... | [
"0.71685594",
"0.71337616",
"0.7127744",
"0.7121374",
"0.71197397",
"0.70768213",
"0.7059616",
"0.702617",
"0.70009947",
"0.7000554",
"0.6979791",
"0.69775784",
"0.6968762",
"0.6955846",
"0.69364214",
"0.692103",
"0.69128716",
"0.69038796",
"0.68980217",
"0.682995",
"0.680249... | 0.7230925 | 0 |
EchoLogger logrus logger in echo log interface | func EchoLogger(logger *logrus.Logger) *EchoLogrus {
return &EchoLogrus{
Logger: logger,
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func Logrus() echo.MiddlewareFunc {\n\treturn LogrusDefaultConfig(DefaultLoggerConfig)\n}",
"func Logger(c context.Context) loggers.Advanced",
"func (logger *Logger) echo(w io.Writer, l level.Level, f string, a ...any) {\n\t// Lock the log object for change.\n\tlogger.mu.RLock()\n\tdefer logger.mu.RUnlock()\n\... | [
"0.66066176",
"0.61660343",
"0.60266924",
"0.5913209",
"0.5817586",
"0.5776641",
"0.5773255",
"0.5722527",
"0.562674",
"0.55921596",
"0.5576498",
"0.55759066",
"0.5570972",
"0.5550121",
"0.5525077",
"0.5479035",
"0.5456552",
"0.54277515",
"0.54236746",
"0.5412267",
"0.5407686... | 0.6948606 | 0 |
SetHeader to set header (NOT SUPPORTED) | func (l *EchoLogrus) SetHeader(string) {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (s *Socket) SetHeader(key, value string) {\n\ts.Lock()\n\ts.Conn.httpHeader().Set(key, value)\n\ts.Unlock()\n}",
"func (rm *REKTManager) SetHeader(key, value string) {\n\trm.headers.Set(key, value)\n}",
"func (req *Request) SetHeader(name, val string) {\n\treq.w.Header().Set(name, val)\n}",
"func SetHea... | [
"0.8070126",
"0.7863313",
"0.78547883",
"0.7850843",
"0.7806121",
"0.7799137",
"0.7771557",
"0.77660334",
"0.7763081",
"0.77529764",
"0.7746852",
"0.7710076",
"0.76950485",
"0.7674024",
"0.7665853",
"0.7630679",
"0.76287884",
"0.75963986",
"0.75706214",
"0.7531666",
"0.752930... | 0.7985397 | 1 |
SetPrefix to set prefix | func (l *EchoLogrus) SetPrefix(prefix string) {
l.prefix = prefix
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func SetPrefix(p string) {\n\tprefix = p\n}",
"func SetPrefix(pre string) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tprefix = pre\n}",
"func SetPrefix(s string) {\n\tprefix = s\n}",
"func SetPrefix(s string) {\n\tprefix = s\n}",
"func SetPrefix(p string) {\n\tprefix = strings.ToUpper(p)\n}",
"func SetPrefix(... | [
"0.87040925",
"0.86976516",
"0.8549345",
"0.8549345",
"0.8411652",
"0.8407237",
"0.8238906",
"0.8226233",
"0.8070257",
"0.8029888",
"0.8029888",
"0.7990705",
"0.78467417",
"0.7828523",
"0.7764234",
"0.7757115",
"0.7752778",
"0.77484006",
"0.77484006",
"0.7694885",
"0.7677132"... | 0.7284788 | 40 |
Prefix of echo logrus | func (l *EchoLogrus) Prefix() string {
return l.prefix
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (logger *Logger) echo(w io.Writer, l level.Level, f string, a ...any) {\n\t// Lock the log object for change.\n\tlogger.mu.RLock()\n\tdefer logger.mu.RUnlock()\n\n\t// Get the stack frame.\n\tsf := getStackFrame(logger.skipStackFrames)\n\n\t// If an additional value is set for the output (writer),\n\t// use i... | [
"0.65048844",
"0.6139849",
"0.59801805",
"0.596994",
"0.568581",
"0.5660072",
"0.5650996",
"0.5524819",
"0.5521323",
"0.5493837",
"0.5487513",
"0.54677296",
"0.54677296",
"0.545661",
"0.54110783",
"0.5346564",
"0.5343675",
"0.5329851",
"0.5328043",
"0.5319607",
"0.5315472",
... | 0.6448333 | 1 |
SetLevel set level to logger from given log.Lvl | func (l *EchoLogrus) SetLevel(lvl log.Lvl) {
switch lvl {
case log.DEBUG:
l.Logger.SetLevel(logrus.DebugLevel)
case log.WARN:
l.Logger.SetLevel(logrus.WarnLevel)
case log.ERROR:
l.Logger.SetLevel(logrus.ErrorLevel)
case log.INFO:
l.Logger.SetLevel(logrus.InfoLevel)
default:
logrus.Warnf("Unknown level: %v", lvl)
l.Logger.SetLevel(logrus.WarnLevel)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func SetLevel(l string) {\n\tswitch l {\n\tcase \"verbose\":\n\t\tlvl = ver\n\tcase \"debug\":\n\t\tlvl = deb\n\tcase \"info\":\n\t\tlvl = inf\n\tcase \"warning\":\n\t\tlvl = war\n\tcase \"error\":\n\t\tlvl = err\n\tcase \"fatal\":\n\t\tlvl = fat\n\tcase \"off\":\n\t\tlvl = off\n\tdefault:\n\t\tFatalf(\"Invalid lo... | [
"0.77812415",
"0.77143854",
"0.7690312",
"0.7635716",
"0.74855775",
"0.7402874",
"0.7372661",
"0.73702145",
"0.7263379",
"0.7263271",
"0.7238328",
"0.7234703",
"0.72197574",
"0.72197574",
"0.72189397",
"0.72102547",
"0.72085947",
"0.7204849",
"0.7196298",
"0.7192631",
"0.7182... | 0.72558755 | 10 |
Level returns logger level | func (l *EchoLogrus) Level() log.Lvl {
switch l.Logger.Level {
case logrus.DebugLevel:
return log.DEBUG
case logrus.WarnLevel:
return log.WARN
case logrus.ErrorLevel:
return log.ERROR
case logrus.InfoLevel:
return log.INFO
}
return log.WARN
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func Level() int {\n\treturn level\n}",
"func LogLevel() int {\n return level\n}",
"func (l *Logrus) Level() interface{} {\n\treturn l.Logger.Level\n}",
"func (f *LogFile) Level() int { return 0 }",
"func Level(level string) int {\n\tl, ok := levels[level]\n\tif !ok {\n\t\tpanic(\"Invalid log level \" +... | [
"0.754305",
"0.75143677",
"0.75124973",
"0.738756",
"0.73849875",
"0.7359766",
"0.7305995",
"0.7292284",
"0.72628397",
"0.72301555",
"0.7184917",
"0.7155091",
"0.7095232",
"0.7077203",
"0.70604163",
"0.7057018",
"0.70108193",
"0.7008901",
"0.69797534",
"0.6977283",
"0.6923556... | 0.71246123 | 12 |
Output logger output func | func (l *EchoLogrus) Output() io.Writer {
return l.Out
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func StdoutLogger(format string, args ...interface{}) {\n\tfmt.Print(fmt.Sprintf(format, args...) + \"\\n\")\n}",
"func (l *logHandler) Output(calldepth int, s string) error {\n\treturn l.w.Output(calldepth+1, s)\n}",
"func (l *StdLogger) output(level LogLevel, stackAdjust int, format string, args ...interface... | [
"0.66758984",
"0.6622248",
"0.65872693",
"0.65407556",
"0.64986706",
"0.6486056",
"0.6422647",
"0.64099437",
"0.6400195",
"0.63558316",
"0.628476",
"0.62818784",
"0.626416",
"0.6256454",
"0.6244308",
"0.6233273",
"0.6202806",
"0.6198649",
"0.6172572",
"0.61362547",
"0.6107438... | 0.5589328 | 72 |
Printj print json log | func (l *EchoLogrus) Printj(j log.JSON) {
l.Logger.WithFields(logrus.Fields(j)).Print()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func PPrintJSON(xx interface{}) {\n\tyy, _ := json.MarshalIndent(xx, \"\", \" \")\n\tlog.Println(string(yy))\n}",
"func JsonPrint(data interface{}) {\n\tvar p []byte\n\tp, err := json.Marshal(data)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tfmt.Printf(\"%s \\n\", p)\n}",
"func jsonPrint(post... | [
"0.7584081",
"0.7325744",
"0.72773486",
"0.72528744",
"0.7165884",
"0.7115936",
"0.70951813",
"0.7084531",
"0.70682424",
"0.7060325",
"0.70069987",
"0.6986642",
"0.69384706",
"0.69226503",
"0.6861717",
"0.6788508",
"0.67024064",
"0.6682685",
"0.6663007",
"0.6567341",
"0.65495... | 0.6997781 | 11 |
Debugj debug json log | func (l *EchoLogrus) Debugj(j log.JSON) {
l.Logger.WithFields(logrus.Fields(j)).Debug()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (l *JSONLogger) Debug(format string, args ...interface{}) {\n\tl.Log(\"debug\", format, args...)\n}",
"func (l *jsonLogger) Debug(message interface{}, params ...interface{}) {\n\tl.jsonLogParser.parse(context.Background(), l.jsonLogParser.log.Debug(), \"\", params...).Msgf(\"%s\", message)\n}",
"func Debu... | [
"0.692201",
"0.6908374",
"0.67573774",
"0.6677289",
"0.64629704",
"0.6456457",
"0.6283996",
"0.6276111",
"0.61813056",
"0.6149834",
"0.61419827",
"0.60906905",
"0.6035263",
"0.6023588",
"0.60095674",
"0.6004559",
"0.5970736",
"0.59674805",
"0.59623086",
"0.59593713",
"0.59452... | 0.6852664 | 2 |
Infoj info json log | func (l *EchoLogrus) Infoj(j log.JSON) {
l.Logger.WithFields(logrus.Fields(j)).Info()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (l *JSONLogger) Info(format string, args ...interface{}) {\n\tl.Log(\"info\", format, args...)\n}",
"func (l *jsonLogger) Info(message interface{}, params ...interface{}) {\n\tl.jsonLogParser.parse(context.Background(), l.jsonLogParser.log.Info(), \"\", params...).Msgf(\"%s\", message)\n}",
"func Info(v .... | [
"0.7321206",
"0.7151799",
"0.7080367",
"0.6893367",
"0.68167025",
"0.6690214",
"0.6590823",
"0.6548917",
"0.6489237",
"0.64583206",
"0.64574397",
"0.6440896",
"0.6437558",
"0.6433981",
"0.6421429",
"0.64140487",
"0.6408576",
"0.6364043",
"0.63606143",
"0.63484424",
"0.6333254... | 0.71056604 | 2 |
Warnj warning json log | func (l *EchoLogrus) Warnj(j log.JSON) {
l.Logger.WithFields(logrus.Fields(j)).Warn()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (l *JSONLogger) Warning(format string, args ...interface{}) {\n\tl.Log(\"warning\", format, args...)\n}",
"func (l *jsonLogger) Warn(message interface{}, params ...interface{}) {\n\tl.jsonLogParser.parse(context.Background(), l.jsonLogParser.log.Warn(), \"\", params...).Msgf(\"%s\", message)\n}",
"func (d... | [
"0.75583",
"0.69907176",
"0.68272567",
"0.6758172",
"0.6574501",
"0.65728384",
"0.6472663",
"0.6430965",
"0.6343016",
"0.6327992",
"0.6319481",
"0.6286859",
"0.62543046",
"0.6215221",
"0.6163449",
"0.6122632",
"0.61130935",
"0.6112975",
"0.6100657",
"0.61001635",
"0.6091717",... | 0.69637924 | 2 |
Fatalj fatal json log | func (l *EchoLogrus) Fatalj(j log.JSON) {
l.Logger.WithFields(logrus.Fields(j)).Fatal()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (l *jsonLogger) Fatal(message interface{}, params ...interface{}) {\n\tl.jsonLogParser.parse(context.Background(), l.jsonLogParser.log.Fatal(), \"\", params...).Msgf(\"%s\", message)\n}",
"func Fatal(v ...interface{}) {\n\tjasonLog.output(2, levelFatal, \"\", v...)\n}",
"func TestFatalJSONMsg(t *testing.T... | [
"0.7188736",
"0.6748402",
"0.6675887",
"0.6648496",
"0.6544118",
"0.6526498",
"0.63779336",
"0.6328552",
"0.6310755",
"0.6282695",
"0.59981763",
"0.59522444",
"0.5941097",
"0.5932604",
"0.59110826",
"0.5877525",
"0.5863888",
"0.5845753",
"0.5837118",
"0.5808149",
"0.5792411",... | 0.66852415 | 2 |
Panicj panic json log | func (l *EchoLogrus) Panicj(j log.JSON) {
l.Logger.WithFields(logrus.Fields(j)).Panic()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (l *AppLogger) Panic(tag string, message ...interface{}) {\n\tl.logging.SetFormatter(&logrus.JSONFormatter{})\n\tk := getAppFields(l.reqId, tag, l.userId)\n\tl.logging.WithFields(k).Panic(message...)\n}",
"func JSONLogger(r *http.Request, status int, len int64, d time.Duration) {\n\tos.Stderr.WriteString(JS... | [
"0.6103428",
"0.5893398",
"0.57904696",
"0.57574403",
"0.5723549",
"0.55608106",
"0.55556524",
"0.5539607",
"0.5539534",
"0.55262053",
"0.5516622",
"0.5509169",
"0.5448856",
"0.54444563",
"0.54426837",
"0.54083824",
"0.5396337",
"0.53323275",
"0.53176063",
"0.5271319",
"0.525... | 0.6141126 | 0 |
GenerateKey generates a fresh keypair for this VRF | func GenerateKey() (vrfp.PrivateKey, vrfp.PublicKey) {
key, err := ecdsa.GenerateKey(curve, rand.Reader)
if err != nil {
return nil, nil
}
return &PrivateKey{PrivateKey: key}, &PublicKey{PublicKey: &key.PublicKey}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func GenerateKey() (PrivateKey, error) {\n\treturn newSecp256k1PrvKey()\n}",
"func genKey() *Key {\n\tprivKey := crypto.GenPrivKeyEd25519()\n\treturn &Key{\n\t\tAddress: privKey.PubKey().Address(),\n\t\tPubKey: privKey.PubKey(),\n\t\tPrivKey: privKey,\n\t}\n}",
"func generateKey() {\n\tpassphrase := os.Getenv... | [
"0.7184372",
"0.7109336",
"0.6994132",
"0.69569266",
"0.69184214",
"0.69149053",
"0.6908917",
"0.6815626",
"0.68146986",
"0.67768675",
"0.6756004",
"0.6755898",
"0.6723591",
"0.6719455",
"0.6715709",
"0.6704407",
"0.66962206",
"0.66807115",
"0.66571164",
"0.6654451",
"0.66401... | 0.65792024 | 26 |
H1 hashes m to a curve point | func H1(m []byte) (x, y *big.Int) {
h := sha512.New()
var i uint32
byteLen := (curve.BitSize + 7) >> 3
for x == nil && i < 100 {
// TODO: Use a NIST specified DRBG.
h.Reset()
if err := binary.Write(h, binary.BigEndian, i); err != nil {
panic(err)
}
if _, err := h.Write(m); err != nil {
panic(err)
}
r := []byte{2} // Set point encoding to "compressed", y=0.
r = h.Sum(r)
x, y = Unmarshal(curve, r[:byteLen+1])
i++
}
return
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func hash1Prf(suite pairing.Suite, m string, k kyber.Scalar) kyber.Point {\n\thm := hash1(suite, m)\n\thmk := hm.Mul(k, hm)\n\treturn hmk\n}",
"func HashG1(msg, dst []byte) *G1 {\n\treturn mapToCurve(hashToBase(msg, dst))\n}",
"func (path *PATH) H(x float64) *PATH {\n\treturn path.AddPart(\"H\", x)\n}",
"fun... | [
"0.670059",
"0.6191052",
"0.60214895",
"0.59542876",
"0.58978754",
"0.585371",
"0.5751907",
"0.5730881",
"0.57265484",
"0.56613463",
"0.5578008",
"0.5534485",
"0.54807895",
"0.54439586",
"0.5409997",
"0.5383044",
"0.5313983",
"0.53073287",
"0.5304563",
"0.5226101",
"0.5205866... | 0.7891151 | 0 |
H2 hashes to an integer [1,N1] | func H2(m []byte) *big.Int {
// NIST SP 800-90A § A.5.1: Simple discard method.
byteLen := (curve.BitSize + 7) >> 3
h := sha512.New()
for i := uint32(0); ; i++ {
// TODO: Use a NIST specified DRBG.
h.Reset()
if err := binary.Write(h, binary.BigEndian, i); err != nil {
panic(err)
}
if _, err := h.Write(m); err != nil {
panic(err)
}
b := h.Sum(nil)
k := new(big.Int).SetBytes(b[:byteLen])
if k.Cmp(new(big.Int).Sub(curve.N, one)) == -1 {
return k.Add(k, one)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func hashToInt(hash []byte) *big.Int {\n\torderBits := S256().Params().N.BitLen()\n\torderBytes := (orderBits + 7) / 8\n\tif len(hash) > orderBytes {\n\t\thash = hash[:orderBytes]\n\t}\n\n\tret := new(big.Int).SetBytes(hash)\n\texcess := len(hash)*8 - orderBits\n\tif excess > 0 {\n\t\tret.Rsh(ret, uint(excess))\n\... | [
"0.6886269",
"0.6631975",
"0.63154674",
"0.6127057",
"0.6072592",
"0.6045243",
"0.6018208",
"0.60083294",
"0.5991375",
"0.59856206",
"0.59772563",
"0.5945282",
"0.5902907",
"0.5884424",
"0.58625615",
"0.585118",
"0.58473116",
"0.58305854",
"0.5804139",
"0.58038306",
"0.579299... | 0.6020945 | 6 |
Evaluate returns the verifiable unpredictable function evaluated at m | func (k PrivateKey) Evaluate(m []byte) (index [32]byte, proof []byte) {
nilIndex := [32]byte{}
// Prover chooses r <-- [1,N-1]
r, _, _, err := elliptic.GenerateKey(curve, rand.Reader)
if err != nil {
return nilIndex, nil
}
ri := new(big.Int).SetBytes(r)
// H = H1(m)
Hx, Hy := H1(m)
// VRF_k(m) = [k]H
sHx, sHy := curve.ScalarMult(Hx, Hy, k.D.Bytes())
vrf := elliptic.Marshal(curve, sHx, sHy) // 65 bytes.
// G is the base point
// s = H2(G, H, [k]G, VRF, [r]G, [r]H)
rGx, rGy := curve.ScalarBaseMult(r)
rHx, rHy := curve.ScalarMult(Hx, Hy, r)
var b bytes.Buffer
if _, err := b.Write(elliptic.Marshal(curve, curve.Gx, curve.Gy)); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, Hx, Hy)); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, k.PublicKey.X, k.PublicKey.Y)); err != nil {
panic(err)
}
if _, err := b.Write(vrf); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, rGx, rGy)); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, rHx, rHy)); err != nil {
panic(err)
}
s := H2(b.Bytes())
// t = r−s*k mod N
t := new(big.Int).Sub(ri, new(big.Int).Mul(s, k.D))
t.Mod(t, curve.N)
// Index = H(vrf)
index = sha256.Sum256(vrf)
// Write s, t, and vrf to a proof blob. Also write leading zeros before s and t
// if needed.
var buf bytes.Buffer
if _, err := buf.Write(make([]byte, 32-len(s.Bytes()))); err != nil {
panic(err)
}
if _, err := buf.Write(s.Bytes()); err != nil {
panic(err)
}
if _, err := buf.Write(make([]byte, 32-len(t.Bytes()))); err != nil {
panic(err)
}
if _, err := buf.Write(t.Bytes()); err != nil {
panic(err)
}
if _, err := buf.Write(vrf); err != nil {
panic(err)
}
return index, buf.Bytes()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (s *System) Evaluate(state []float32) []float32 {\n\tif len(state) > 0 {\n\t\treturn s.function(state, s.parametersVector)\n\t} else {\n\t\treturn s.function(s.stateVector, s.parametersVector)\n\t}\n}",
"func (m *Multiplication) Evaluate(left, right EvalResult) (EvalResult, error) {\n\treturn multiplyNumeri... | [
"0.651853",
"0.6338464",
"0.6131312",
"0.61241156",
"0.60935414",
"0.60788083",
"0.6030784",
"0.60034543",
"0.6002316",
"0.5988152",
"0.597255",
"0.59357506",
"0.5845846",
"0.583995",
"0.58133984",
"0.5776667",
"0.5771244",
"0.5756347",
"0.57353276",
"0.5718127",
"0.5705097",... | 0.56331724 | 23 |
ProofToHash asserts that proof is correct for m and outputs index. | func (pk *PublicKey) ProofToHash(m, proof []byte) (index [32]byte, err error) {
nilIndex := [32]byte{}
// verifier checks that s == H2(m, [t]G + [s]([k]G), [t]H1(m) + [s]VRF_k(m))
if got, want := len(proof), 64+65; got != want {
return nilIndex, ErrInvalidVRF
}
// Parse proof into s, t, and vrf.
s := proof[0:32]
t := proof[32:64]
vrf := proof[64 : 64+65]
uHx, uHy := elliptic.Unmarshal(curve, vrf)
if uHx == nil {
return nilIndex, ErrInvalidVRF
}
// [t]G + [s]([k]G) = [t+ks]G
tGx, tGy := curve.ScalarBaseMult(t)
ksGx, ksGy := curve.ScalarMult(pk.X, pk.Y, s)
tksGx, tksGy := curve.Add(tGx, tGy, ksGx, ksGy)
// H = H1(m)
// [t]H + [s]VRF = [t+ks]H
Hx, Hy := H1(m)
tHx, tHy := curve.ScalarMult(Hx, Hy, t)
sHx, sHy := curve.ScalarMult(uHx, uHy, s)
tksHx, tksHy := curve.Add(tHx, tHy, sHx, sHy)
// H2(G, H, [k]G, VRF, [t]G + [s]([k]G), [t]H + [s]VRF)
// = H2(G, H, [k]G, VRF, [t+ks]G, [t+ks]H)
// = H2(G, H, [k]G, VRF, [r]G, [r]H)
var b bytes.Buffer
if _, err := b.Write(elliptic.Marshal(curve, curve.Gx, curve.Gy)); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, Hx, Hy)); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, pk.X, pk.Y)); err != nil {
panic(err)
}
if _, err := b.Write(vrf); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, tksGx, tksGy)); err != nil {
panic(err)
}
if _, err := b.Write(elliptic.Marshal(curve, tksHx, tksHy)); err != nil {
panic(err)
}
h2 := H2(b.Bytes())
// Left pad h2 with zeros if needed. This will ensure that h2 is padded
// the same way s is.
var buf bytes.Buffer
if _, err := buf.Write(make([]byte, 32-len(h2.Bytes()))); err != nil {
panic(err)
}
if _, err := buf.Write(h2.Bytes()); err != nil {
panic(err)
}
if !hmac.Equal(s, buf.Bytes()) {
return nilIndex, ErrInvalidVRF
}
return sha256.Sum256(vrf), nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (pk *VrfablePublicKey) ProofToHash(m, proof []byte) (index [32]byte, err error) {\n\tnilIndex := [32]byte{}\n\t// verifier checks that s == H2(m, [t]G + [s]([k]G), [t]H1(m) + [s]VRF_k(m))\n\tif got, want := len(proof), 64+65; got != want {\n\t\treturn nilIndex, ErrInvalidVRF\n\t}\n\n\t// Parse proof into s, t... | [
"0.6469084",
"0.58733064",
"0.5705257",
"0.5511857",
"0.5511857",
"0.5510959",
"0.54576856",
"0.5450013",
"0.5369648",
"0.5359943",
"0.5351932",
"0.5337506",
"0.53114235",
"0.53063196",
"0.52800083",
"0.5264212",
"0.52385473",
"0.5237696",
"0.5209671",
"0.51887167",
"0.517714... | 0.69053805 | 0 |
Public returns the corresponding public key as bytes. | func (k PrivateKey) Public() crypto.PublicKey {
return &k.PublicKey
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (priv *PrivateKey) Public() crypto.PublicKey",
"func (priv *PrivateKey) Public() crypto.PublicKey",
"func (j *JWK) PublicKeyBytes() ([]byte, error) {\n\tif isSecp256k1(j.Kty, j.Crv) {\n\t\tvar ecPubKey *ecdsa.PublicKey\n\n\t\tecPubKey, ok := j.Key.(*ecdsa.PublicKey)\n\t\tif !ok {\n\t\t\tecPubKey = &j.Key.... | [
"0.73033845",
"0.73033845",
"0.7199707",
"0.7082733",
"0.7060463",
"0.70405895",
"0.70381963",
"0.70164436",
"0.7010828",
"0.69798744",
"0.6968808",
"0.6966117",
"0.6949062",
"0.69171274",
"0.69095975",
"0.68865144",
"0.6865919",
"0.6858021",
"0.6843556",
"0.6826548",
"0.6819... | 0.71303064 | 3 |
Wait waits for the process to exit. Wait releases any resources associated with the Process | func (p Process) Wait() (*os.ProcessState, error) {
if p.ops == nil {
return nil, errInvalidProcess
}
return p.ops.wait()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (proc *Process) Wait() {\n\terr := proc.Cmd.Wait()\n\tif err != nil {\n\t\t// fmt.Printf(\"Process exit: %v\\n\", err)\n\t\tif exitError, ok := err.(*exec.ExitError); ok {\n\t\t\tproc.ExitState = exitError.ProcessState\n\t\t}\n\t}\n\tproc.ExitState = proc.Cmd.ProcessState\n\tproc.EndTime = time.Now() // TODO ... | [
"0.81128645",
"0.7869257",
"0.7748207",
"0.76745343",
"0.75808007",
"0.75490844",
"0.7530024",
"0.746755",
"0.6854481",
"0.6778684",
"0.6717715",
"0.6611814",
"0.661017",
"0.66004753",
"0.6592647",
"0.65859425",
"0.65060246",
"0.64455724",
"0.6444631",
"0.64402",
"0.64355767"... | 0.7441739 | 8 |
Pid returns the process ID | func (p Process) Pid() (int, error) {
// math.MinInt32 is returned here, because it's invalid value
// for the kill() system call.
if p.ops == nil {
return math.MinInt32, errInvalidProcess
}
return p.ops.pid(), nil
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func Getpid() int",
"func Pid() int {\n\treturn processPid\n}",
"func (p *process) Pid() int {\n\treturn p.cmd.Process.Pid\n}",
"func (p *procBase) Pid() int {\n\tif !p.Running() {\n\t\treturn 0\n\t}\n\treturn p.cmd.Process.Pid\n}",
"func (c *D) Pid() (int, error) {\n\tif !c.IsRunning() {\n\t\treturn 0, Er... | [
"0.838524",
"0.8062947",
"0.8008295",
"0.7893553",
"0.7868351",
"0.7649986",
"0.7641024",
"0.75601506",
"0.7502672",
"0.74702924",
"0.7432728",
"0.73989254",
"0.73691005",
"0.7308452",
"0.73001015",
"0.7295917",
"0.72577465",
"0.71821296",
"0.7167185",
"0.7123233",
"0.7091908... | 0.77644545 | 5 |
Signal sends a signal to the Process. | func (p Process) Signal(sig os.Signal) error {
if p.ops == nil {
return errInvalidProcess
}
return p.ops.signal(sig)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (p *Process) Signal(sig os.Signal) error {\n return p.Process.Signal(sig)\n}",
"func ProcessSignal(p *os.Process, sig os.Signal,) error",
"func (p *process) Signal(s os.Signal) error {\n\treturn syscall.Kill(p.pid, s.(syscall.Signal))\n}",
"func (p *Process) SendSignal(sig Signal) error {\n\treturn p... | [
"0.83232",
"0.8034805",
"0.7861894",
"0.74374187",
"0.7412237",
"0.7406529",
"0.7346595",
"0.7263789",
"0.7231644",
"0.7139125",
"0.7114482",
"0.70723146",
"0.69304484",
"0.6903541",
"0.6882808",
"0.6860277",
"0.672449",
"0.6675943",
"0.66536725",
"0.66462773",
"0.65615785",
... | 0.7709792 | 3 |
operate on the accumulation buffer | func Accum(op uint32, value float32) {
C.glowAccum(gpAccum, (C.GLenum)(op), (C.GLfloat)(value))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (d *pmac) processBuffer() {\n\txor(d.offset[:], d.l[bits.TrailingZeros(d.ctr+1)][:])\n\txor(d.buf[:], d.offset[:])\n\td.ctr++\n\n\td.buf.Encrypt(d.c)\n\txor(d.digest[:], d.buf[:])\n\td.pos = 0\n}",
"func Accumulate(data []float64, initValue float64, f Operation) float64 {\r\n\tres := initValue\r\n\tfor _, v... | [
"0.62614363",
"0.6201176",
"0.61862767",
"0.6068468",
"0.57331413",
"0.56892174",
"0.56844246",
"0.56659853",
"0.5638753",
"0.55710655",
"0.55572665",
"0.554525",
"0.55062646",
"0.54850453",
"0.5482546",
"0.5482173",
"0.5472898",
"0.5457682",
"0.5447925",
"0.5440757",
"0.5434... | 0.6006751 | 4 |
set the active program object for a program pipeline object | func ActiveShaderProgram(pipeline uint32, program uint32) {
C.glowActiveShaderProgram(gpActiveShaderProgram, (C.GLuint)(pipeline), (C.GLuint)(program))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (m *ProgramControl) SetProgram(value Programable)() {\n err := m.GetBackingStore().Set(\"program\", value)\n if err != nil {\n panic(err)\n }\n}",
"func ActiveShaderProgram(pipeline uint32, program uint32) {\n\tsyscall.Syscall(gpActiveShaderProgram, 2, uintptr(pipeline), uintptr(program), 0)... | [
"0.68859893",
"0.62889445",
"0.596266",
"0.59011215",
"0.58729166",
"0.5695654",
"0.5693641",
"0.5625199",
"0.5574988",
"0.5567587",
"0.5567587",
"0.55162305",
"0.5494934",
"0.54705536",
"0.5433244",
"0.53992385",
"0.53609896",
"0.5354863",
"0.5314572",
"0.52216446",
"0.52117... | 0.57121 | 6 |
select active texture unit | func ActiveTexture(texture uint32) {
C.glowActiveTexture(gpActiveTexture, (C.GLenum)(texture))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func ActiveTexture(texture uint32) {\n C.glowActiveTexture(gpActiveTexture, (C.GLenum)(texture))\n}",
"func ActiveTexture(texture Enum) {\n\tgl.ActiveTexture(uint32(texture))\n}",
"func ActiveTexture(texture uint32) {\n\tsyscall.Syscall(gpActiveTexture, 1, uintptr(texture), 0, 0)\n}",
"func (gl *WebGL) Acti... | [
"0.6987255",
"0.6659273",
"0.6604428",
"0.6587843",
"0.63703996",
"0.6236901",
"0.6154774",
"0.60388523",
"0.5987232",
"0.5789151",
"0.57844275",
"0.5777845",
"0.57609534",
"0.57609534",
"0.5628775",
"0.55807346",
"0.55703926",
"0.55703926",
"0.5533289",
"0.5532886",
"0.55285... | 0.6225811 | 7 |
specify the alpha test function | func AlphaFunc(xfunc uint32, ref float32) {
C.glowAlphaFunc(gpAlphaFunc, (C.GLenum)(xfunc), (C.GLfloat)(ref))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (t *T) Alpha(name string, f interface{}) bool {\n\tt.Helper()\n\treturn t.invokeFeature(feature.Alpha, name, f)\n}",
"func AlphaFunc(xfunc uint32, ref float32) {\n\tsyscall.Syscall(gpAlphaFunc, 2, uintptr(xfunc), uintptr(math.Float32bits(ref)), 0)\n}",
"func SampleAlpha(alpha string) {\n\n}",
"func (n *... | [
"0.7365797",
"0.6467262",
"0.5990663",
"0.5964319",
"0.5907028",
"0.58390313",
"0.5737841",
"0.5732525",
"0.5585304",
"0.55348474",
"0.545238",
"0.54403746",
"0.5396641",
"0.5375207",
"0.53567845",
"0.5353082",
"0.5320442",
"0.5320442",
"0.5308834",
"0.5270199",
"0.5252198",
... | 0.60668135 | 2 |
determine if textures are loaded in texture memory | func AreTexturesResident(n int32, textures *uint32, residences *bool) bool {
ret := C.glowAreTexturesResident(gpAreTexturesResident, (C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(textures)), (*C.GLboolean)(unsafe.Pointer(residences)))
return ret == TRUE
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func AreTexturesResident(n int32, textures *uint32, residences *bool) bool {\n\tret, _, _ := syscall.Syscall(gpAreTexturesResident, 3, uintptr(n), uintptr(unsafe.Pointer(textures)), uintptr(unsafe.Pointer(residences)))\n\treturn ret != 0\n}",
"func IsTexture(texture uint32) bool {\n ret := C.glowIsTexture(gpIsT... | [
"0.68152726",
"0.6739268",
"0.66833866",
"0.66781384",
"0.6520428",
"0.65059024",
"0.6449533",
"0.6223648",
"0.6177797",
"0.6177797",
"0.60325664",
"0.5914812",
"0.5843292",
"0.5765134",
"0.57647234",
"0.57006824",
"0.56956804",
"0.5619371",
"0.5588844",
"0.55697125",
"0.5518... | 0.6508359 | 5 |
render a vertex using the specified vertex array element | func ArrayElement(i int32) {
C.glowArrayElement(gpArrayElement, (C.GLint)(i))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func VertexArrayElementBuffer(vaobj uint32, buffer uint32) {\n\tsyscall.Syscall(gpVertexArrayElementBuffer, 2, uintptr(vaobj), uintptr(buffer), 0)\n}",
"func VertexArrayElementBuffer(vaobj uint32, buffer uint32) {\n\tC.glowVertexArrayElementBuffer(gpVertexArrayElementBuffer, (C.GLuint)(vaobj), (C.GLuint)(buffer)... | [
"0.65441036",
"0.6367963",
"0.6367963",
"0.6162593",
"0.57998973",
"0.5791173",
"0.57730454",
"0.5724036",
"0.5672329",
"0.5670119",
"0.56397915",
"0.5591109",
"0.5591109",
"0.556642",
"0.556642",
"0.55547774",
"0.5543371",
"0.5539181",
"0.5487333",
"0.5487333",
"0.5472863",
... | 0.5283302 | 35 |
Attaches a shader object to a program object | func AttachShader(program uint32, shader uint32) {
C.glowAttachShader(gpAttachShader, (C.GLuint)(program), (C.GLuint)(shader))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func AttachShader(program uint32, shader uint32) {\n C.glowAttachShader(gpAttachShader, (C.GLuint)(program), (C.GLuint)(shader))\n}",
"func AttachShader(program uint32, shader uint32) {\n\tsyscall.Syscall(gpAttachShader, 2, uintptr(program), uintptr(shader), 0)\n}",
"func (program Program) AttachShader(shader... | [
"0.7530386",
"0.7152642",
"0.7089462",
"0.7000029",
"0.6843556",
"0.67589235",
"0.6711889",
"0.6614953",
"0.6595897",
"0.65101314",
"0.6135568",
"0.6095363",
"0.60770255",
"0.601223",
"0.60121894",
"0.60080314",
"0.5971357",
"0.5923006",
"0.5922547",
"0.5917164",
"0.5842594",... | 0.687415 | 5 |
delimit the vertices of a primitive or a group of like primitives | func Begin(mode uint32) {
C.glowBegin(gpBegin, (C.GLenum)(mode))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (p plane) splitPolygon(poly polygon, coplanarFront, coplanarBack, front, back *[]polygon) {\n\tconst (\n\t\tcoplanarType = 0\n\t\tfrontType = 1\n\t\tbackType = 2\n\t\tspanningType = 3\n\t)\n\tpolygonType := 0\n\tvar types []int\n\tfor _, v := range poly.vertices {\n\t\tt := p.normal.dot(v.pos) - p.w\n\... | [
"0.5119342",
"0.5051116",
"0.49833047",
"0.4895917",
"0.48857006",
"0.48405302",
"0.48386937",
"0.48378637",
"0.4825112",
"0.47670814",
"0.47629687",
"0.47581664",
"0.47426316",
"0.47190487",
"0.46949178",
"0.46714163",
"0.4608143",
"0.45868334",
"0.45825988",
"0.4580345",
"0... | 0.0 | -1 |
delimit the boundaries of a query object | func BeginQuery(target uint32, id uint32) {
C.glowBeginQuery(gpBeginQuery, (C.GLenum)(target), (C.GLuint)(id))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func RangeQuery(in Query, r types.Request) (out Query) {\n\tout = in.Skip(r.Start)\n\tout = out.Limit(r.Length)\n\treturn\n}",
"func (g *GraphiteProvider) trimQuery(query string) string {\n\tspace := regexp.MustCompile(`\\s+`)\n\treturn space.ReplaceAllString(query, \" \")\n}",
"func (query *Query) CleanOffset... | [
"0.5581075",
"0.5370196",
"0.51416427",
"0.4843106",
"0.48349684",
"0.48158392",
"0.48061302",
"0.47843358",
"0.47429067",
"0.4741085",
"0.4722207",
"0.4709483",
"0.470353",
"0.4635659",
"0.46195775",
"0.46092957",
"0.45898736",
"0.45854548",
"0.4559825",
"0.45567867",
"0.452... | 0.0 | -1 |
start transform feedback operation | func BeginTransformFeedback(primitiveMode uint32) {
C.glowBeginTransformFeedback(gpBeginTransformFeedback, (C.GLenum)(primitiveMode))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (p *literalProcessor) start() { go p.run() }",
"func (w *Walker) startProcessing() {\n\tdoStart := false\n\tw.pipe.RLock()\n\tif w.pipe.filters == nil { // no processing up to now => start with initial node\n\t\tw.pipe.pushSync(w.initial, 0) // input is buffered, will return immediately\n\t\tdoStart = true ... | [
"0.5562858",
"0.5539677",
"0.55123633",
"0.5366656",
"0.5331807",
"0.52465326",
"0.5208377",
"0.5200585",
"0.5200585",
"0.5196328",
"0.519006",
"0.5174271",
"0.51725996",
"0.5159708",
"0.5113168",
"0.508091",
"0.5076553",
"0.5070337",
"0.50625813",
"0.50278485",
"0.5009344",
... | 0.47064185 | 49 |
Associates a generic vertex attribute index with a named attribute variable | func BindAttribLocation(program uint32, index uint32, name *uint8) {
C.glowBindAttribLocation(gpBindAttribLocation, (C.GLuint)(program), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (e *rawData) AddAttribute(key string, val string) {}",
"func GetVertexAttribIuiv(index uint32, pname uint32, params *uint32) {\n C.glowGetVertexAttribIuiv(gpGetVertexAttribIuiv, (C.GLuint)(index), (C.GLenum)(pname), (*C.GLuint)(unsafe.Pointer(params)))\n}",
"func VertexAttribBinding(attribindex uint32, b... | [
"0.6013094",
"0.5846795",
"0.5826425",
"0.5823346",
"0.5788625",
"0.57018775",
"0.56844145",
"0.5656396",
"0.5579057",
"0.5578576",
"0.5543737",
"0.5539951",
"0.5539951",
"0.55333734",
"0.5447235",
"0.5420258",
"0.5420258",
"0.5413475",
"0.5413475",
"0.53973305",
"0.53862524"... | 0.5192346 | 40 |
bind a named buffer object | func BindBuffer(target uint32, buffer uint32) {
C.glowBindBuffer(gpBindBuffer, (C.GLenum)(target), (C.GLuint)(buffer))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (buffer Buffer) Bind(target gl.Enum) {\n\tgl.BindBuffer(gl.Enum(target), gl.Uint(buffer))\n}",
"func BindBuffer(target uint32, buffer uint32) {\n\tsyscall.Syscall(gpBindBuffer, 2, uintptr(target), uintptr(buffer), 0)\n}",
"func BindBufferBase(target uint32, index uint32, buffer uint32) {\n\tsyscall.Syscal... | [
"0.65895575",
"0.6543274",
"0.64173114",
"0.63751084",
"0.63027453",
"0.61116695",
"0.603623",
"0.60335517",
"0.60216767",
"0.60066944",
"0.60041535",
"0.59543073",
"0.5899972",
"0.58810574",
"0.58643997",
"0.585782",
"0.5836036",
"0.5794475",
"0.5794475",
"0.578019",
"0.5771... | 0.5710418 | 23 |
bind a buffer object to an indexed buffer target | func BindBufferBase(target uint32, index uint32, buffer uint32) {
C.glowBindBufferBase(gpBindBufferBase, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindBufferBase(target uint32, index uint32, buffer uint32) {\n C.glowBindBufferBase(gpBindBufferBase, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer))\n}",
"func BindBufferBase(target uint32, index uint32, buffer uint32) {\n\tsyscall.Syscall(gpBindBufferBase, 3, uintptr(target), uintptr(index), u... | [
"0.67690474",
"0.6754688",
"0.6504956",
"0.6449982",
"0.621203",
"0.62079",
"0.6192015",
"0.61312145",
"0.6001993",
"0.5949003",
"0.5904131",
"0.58839715",
"0.58665264",
"0.5838533",
"0.58151007",
"0.5801717",
"0.5793947",
"0.5793947",
"0.57462114",
"0.57462114",
"0.5730476",... | 0.6422142 | 5 |
bind a range within a buffer object to an indexed buffer target | func BindBufferRange(target uint32, index uint32, buffer uint32, offset int, size int) {
C.glowBindBufferRange(gpBindBufferRange, (C.GLenum)(target), (C.GLuint)(index), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizeiptr)(size))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindBufferRange(target uint32, index uint32, buffer uint32, offset int, size int) {\n\tsyscall.Syscall6(gpBindBufferRange, 5, uintptr(target), uintptr(index), uintptr(buffer), uintptr(offset), uintptr(size), 0)\n}",
"func BindBufferRange(target uint32, index uint32, buffer uint32, offset int, size int) {\n ... | [
"0.728777",
"0.7266032",
"0.7006068",
"0.6596149",
"0.6426957",
"0.62520826",
"0.6189875",
"0.6189875",
"0.61769366",
"0.5988925",
"0.59874284",
"0.5968938",
"0.59425527",
"0.5915116",
"0.58076537",
"0.57425576",
"0.57425576",
"0.5718545",
"0.56829077",
"0.56829077",
"0.56706... | 0.6876788 | 4 |
bind one or more buffer objects to a sequence of indexed buffer targets | func BindBuffersBase(target uint32, first uint32, count int32, buffers *uint32) {
C.glowBindBuffersBase(gpBindBuffersBase, (C.GLenum)(target), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindBuffersRange(target uint32, first uint32, count int32, buffers *uint32, offsets *int, sizes *int) {\n C.glowBindBuffersRange(gpBindBuffersRange, (C.GLenum)(target), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizeiptr)(unsafe.... | [
"0.64197224",
"0.6338076",
"0.623192",
"0.6152027",
"0.6152027",
"0.60921204",
"0.6068137",
"0.5997602",
"0.59825665",
"0.59725565",
"0.57663065",
"0.57108283",
"0.5709153",
"0.5709153",
"0.57091343",
"0.57068443",
"0.57066387",
"0.57066387",
"0.5680168",
"0.56305957",
"0.560... | 0.58832186 | 11 |
bind ranges of one or more buffer objects to a sequence of indexed buffer targets | func BindBuffersRange(target uint32, first uint32, count int32, buffers *uint32, offsets *int, sizes *int) {
C.glowBindBuffersRange(gpBindBuffersRange, (C.GLenum)(target), (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizeiptr)(unsafe.Pointer(sizes)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindBuffersRange(target uint32, first uint32, count int32, buffers *uint32, offsets *int, sizes *int) {\n\tsyscall.Syscall6(gpBindBuffersRange, 6, uintptr(target), uintptr(first), uintptr(count), uintptr(unsafe.Pointer(buffers)), uintptr(unsafe.Pointer(offsets)), uintptr(unsafe.Pointer(sizes)))\n}",
"func B... | [
"0.70568985",
"0.7008023",
"0.68640035",
"0.6768027",
"0.64906543",
"0.64906543",
"0.6451645",
"0.5825164",
"0.5819655",
"0.5744454",
"0.5607061",
"0.557628",
"0.54991025",
"0.54833347",
"0.54833347",
"0.5462898",
"0.5458053",
"0.5366444",
"0.5366444",
"0.5327488",
"0.5318707... | 0.6809925 | 4 |
bind a userdefined varying out variable to a fragment shader color number | func BindFragDataLocation(program uint32, color uint32, name *uint8) {
C.glowBindFragDataLocation(gpBindFragDataLocation, (C.GLuint)(program), (C.GLuint)(color), (*C.GLchar)(unsafe.Pointer(name)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindFragDataLocation(program uint32, color uint32, name *int8) {\n C.glowBindFragDataLocation(gpBindFragDataLocation, (C.GLuint)(program), (C.GLuint)(color), (*C.GLchar)(unsafe.Pointer(name)))\n}",
"func (s *Shader) setUniform(name string, value int32) {\n location:=gl.GetUniformLocation(s.idPrograma, g... | [
"0.5981919",
"0.5931926",
"0.5892054",
"0.5875066",
"0.5700229",
"0.55121195",
"0.54862076",
"0.54636985",
"0.5428842",
"0.5414932",
"0.53912",
"0.5385941",
"0.5385941",
"0.53845733",
"0.535564",
"0.53540623",
"0.5346713",
"0.5346713",
"0.5333384",
"0.5319861",
"0.5264814",
... | 0.5486758 | 7 |
bind a userdefined varying out variable to a fragment shader color number and index | func BindFragDataLocationIndexed(program uint32, colorNumber uint32, index uint32, name *uint8) {
C.glowBindFragDataLocationIndexed(gpBindFragDataLocationIndexed, (C.GLuint)(program), (C.GLuint)(colorNumber), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindFragDataLocationIndexed(program uint32, colorNumber uint32, index uint32, name *int8) {\n C.glowBindFragDataLocationIndexed(gpBindFragDataLocationIndexed, (C.GLuint)(program), (C.GLuint)(colorNumber), (C.GLuint)(index), (*C.GLchar)(unsafe.Pointer(name)))\n}",
"func BindFragDataLocation(program uint32, ... | [
"0.6564883",
"0.6111448",
"0.5995493",
"0.59532267",
"0.59309816",
"0.56320804",
"0.56115055",
"0.5607158",
"0.5607158",
"0.5533097",
"0.5522427",
"0.55083036",
"0.5505781",
"0.5493252",
"0.54778075",
"0.5424576",
"0.54136854",
"0.5412841",
"0.54081506",
"0.54081506",
"0.5405... | 0.60473156 | 3 |
bind a framebuffer to a framebuffer target | func BindFramebuffer(target uint32, framebuffer uint32) {
C.glowBindFramebuffer(gpBindFramebuffer, (C.GLenum)(target), (C.GLuint)(framebuffer))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindFramebuffer(target uint32, framebuffer uint32) {\n C.glowBindFramebuffer(gpBindFramebuffer, (C.GLenum)(target), (C.GLuint)(framebuffer))\n}",
"func BindFramebuffer(target uint32, framebuffer uint32) {\n\tsyscall.Syscall(gpBindFramebuffer, 2, uintptr(target), uintptr(framebuffer), 0)\n}",
"func (debug... | [
"0.83441293",
"0.80777943",
"0.78251433",
"0.7756177",
"0.7617672",
"0.7587925",
"0.67025834",
"0.66922104",
"0.6677471",
"0.6654382",
"0.6506856",
"0.64703983",
"0.6437566",
"0.64246845",
"0.6412704",
"0.6367643",
"0.635242",
"0.63509125",
"0.63509125",
"0.6326969",
"0.63087... | 0.7746551 | 5 |
bind a level of a texture to an image unit | func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {
C.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(format))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindImageTexture(unit uint32, texture uint32, level int32, layered bool, layer int32, access uint32, format uint32) {\n C.glowBindImageTexture(gpBindImageTexture, (C.GLuint)(unit), (C.GLuint)(texture), (C.GLint)(level), (C.GLboolean)(boolToInt(layered)), (C.GLint)(layer), (C.GLenum)(access), (C.GLenum)(forma... | [
"0.77538586",
"0.72047174",
"0.72047174",
"0.6774037",
"0.6741786",
"0.66661984",
"0.6403448",
"0.6268379",
"0.6223522",
"0.6147719",
"0.61377084",
"0.6133744",
"0.6116373",
"0.60852635",
"0.6049272",
"0.60422444",
"0.60406405",
"0.6007053",
"0.6000937",
"0.59634435",
"0.5963... | 0.6746263 | 5 |
bind one or more named texture images to a sequence of consecutive image units | func BindImageTextures(first uint32, count int32, textures *uint32) {
C.glowBindImageTextures(gpBindImageTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindImageTextures(first uint32, count int32, textures *uint32) {\n C.glowBindImageTextures(gpBindImageTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}",
"func BindTextures(first uint32, count int32, textures *uint32) {\n C.glowBindTextures(gpBindTextures, (C.GLuin... | [
"0.7422068",
"0.7230596",
"0.7105752",
"0.7088535",
"0.6817541",
"0.6817541",
"0.63797003",
"0.6125447",
"0.6102882",
"0.5765335",
"0.5724267",
"0.56164443",
"0.56164443",
"0.5536132",
"0.5475197",
"0.5475197",
"0.54274994",
"0.53896785",
"0.53550667",
"0.5339524",
"0.5264366... | 0.67685163 | 7 |
bind a program pipeline to the current context | func BindProgramPipeline(pipeline uint32) {
C.glowBindProgramPipeline(gpBindProgramPipeline, (C.GLuint)(pipeline))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindProgramPipeline(pipeline uint32) {\n\tsyscall.Syscall(gpBindProgramPipeline, 1, uintptr(pipeline), 0, 0)\n}",
"func BindProgramPipeline(pipeline uint32) {\n C.glowBindProgramPipeline(gpBindProgramPipeline, (C.GLuint)(pipeline))\n}",
"func (s *BaselimboListener) EnterProgram(ctx *ProgramContext) {}",
... | [
"0.73413885",
"0.7065253",
"0.60420555",
"0.5810229",
"0.5754384",
"0.57189494",
"0.5652629",
"0.56116164",
"0.5575586",
"0.5401441",
"0.5378565",
"0.53634435",
"0.5341183",
"0.53165364",
"0.5250999",
"0.5221876",
"0.5196014",
"0.5189741",
"0.5189741",
"0.5172633",
"0.5168675... | 0.67760444 | 3 |
bind a renderbuffer to a renderbuffer target | func BindRenderbuffer(target uint32, renderbuffer uint32) {
C.glowBindRenderbuffer(gpBindRenderbuffer, (C.GLenum)(target), (C.GLuint)(renderbuffer))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindRenderbuffer(target uint32, renderbuffer uint32) {\n C.glowBindRenderbuffer(gpBindRenderbuffer, (C.GLenum)(target), (C.GLuint)(renderbuffer))\n}",
"func BindBuffer(target uint32, buffer uint32) {\n C.glowBindBuffer(gpBindBuffer, (C.GLenum)(target), (C.GLuint)(buffer))\n}",
"func BindBufferBase(targe... | [
"0.7353657",
"0.7281036",
"0.7191413",
"0.7169069",
"0.71594304",
"0.7144179",
"0.7136114",
"0.7112289",
"0.7110479",
"0.7098034",
"0.6998474",
"0.6998474",
"0.6992969",
"0.6992969",
"0.69723177",
"0.69301564",
"0.6866204",
"0.6865999",
"0.6822502",
"0.6761374",
"0.6670392",
... | 0.6807672 | 20 |
bind a named sampler to a texturing target | func BindSampler(unit uint32, sampler uint32) {
C.glowBindSampler(gpBindSampler, (C.GLuint)(unit), (C.GLuint)(sampler))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindSampler(unit uint32, sampler uint32) {\n C.glowBindSampler(gpBindSampler, (C.GLuint)(unit), (C.GLuint)(sampler))\n}",
"func BindSampler(unit uint32, sampler uint32) {\n\tsyscall.Syscall(gpBindSampler, 2, uintptr(unit), uintptr(sampler), 0)\n}",
"func (debugging *debuggingOpenGL) BindSampler(unit uint... | [
"0.68192595",
"0.663926",
"0.63527334",
"0.634395",
"0.5842493",
"0.5665984",
"0.5508882",
"0.54997027",
"0.54741216",
"0.5448002",
"0.5448002",
"0.5300093",
"0.5271571",
"0.5180923",
"0.5178225",
"0.5158692",
"0.5154688",
"0.51445144",
"0.5083899",
"0.5067762",
"0.50090045",... | 0.6406075 | 3 |
bind one or more named sampler objects to a sequence of consecutive sampler units | func BindSamplers(first uint32, count int32, samplers *uint32) {
C.glowBindSamplers(gpBindSamplers, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindSamplers(first uint32, count int32, samplers *uint32) {\n C.glowBindSamplers(gpBindSamplers, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(samplers)))\n}",
"func BindSamplers(first uint32, count int32, samplers *uint32) {\n\tsyscall.Syscall(gpBindSamplers, 3, uintptr(first), uintptr... | [
"0.62764835",
"0.62232316",
"0.61485314",
"0.61434525",
"0.59006494",
"0.58029324",
"0.58029324",
"0.56394106",
"0.56152266",
"0.5580354",
"0.5500185",
"0.5363383",
"0.5363383",
"0.5175494",
"0.51684535",
"0.50905794",
"0.50654525",
"0.49745017",
"0.48865214",
"0.47808418",
"... | 0.6016027 | 5 |
bind a named texture to a texturing target | func BindTexture(target uint32, texture uint32) {
C.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindTexture(target uint32, texture uint32) {\n C.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))\n}",
"func BindTexture(target Enum, t Texture) {\n\tgl.BindTexture(uint32(target), t.Value)\n}",
"func BindTexture(target uint32, texture uint32) {\n\tsyscall.Syscall(gpBindTexture, 2,... | [
"0.75365347",
"0.73968655",
"0.72056687",
"0.70569825",
"0.69771206",
"0.6951689",
"0.69334",
"0.67844176",
"0.66177547",
"0.66002494",
"0.66002494",
"0.64977026",
"0.6485806",
"0.63824624",
"0.634882",
"0.6293033",
"0.6278351",
"0.61021316",
"0.61021316",
"0.60868174",
"0.60... | 0.6833865 | 8 |
bind an existing texture object to the specified texture unit | func BindTextureUnit(unit uint32, texture uint32) {
C.glowBindTextureUnit(gpBindTextureUnit, (C.GLuint)(unit), (C.GLuint)(texture))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindTextureUnit(unit uint32, texture uint32) {\n\tsyscall.Syscall(gpBindTextureUnit, 2, uintptr(unit), uintptr(texture), 0)\n}",
"func BindTexture(target uint32, texture uint32) {\n C.glowBindTexture(gpBindTexture, (C.GLenum)(target), (C.GLuint)(texture))\n}",
"func BindTexture(target Enum, t Texture) {\... | [
"0.7944882",
"0.7141327",
"0.7066944",
"0.70379597",
"0.69296485",
"0.6858803",
"0.6800018",
"0.6781621",
"0.6781285",
"0.6778453",
"0.6636072",
"0.6617039",
"0.6567981",
"0.65639764",
"0.64981437",
"0.64981437",
"0.6295844",
"0.62708545",
"0.6270802",
"0.6261718",
"0.6245072... | 0.798627 | 1 |
bind one or more named textures to a sequence of consecutive texture units | func BindTextures(first uint32, count int32, textures *uint32) {
C.glowBindTextures(gpBindTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindTextures(first uint32, count int32, textures *uint32) {\n C.glowBindTextures(gpBindTextures, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(textures)))\n}",
"func BindTextures(first uint32, count int32, textures *uint32) {\n\tsyscall.Syscall(gpBindTextures, 3, uintptr(first), uintptr... | [
"0.7449541",
"0.7357423",
"0.7207478",
"0.6816224",
"0.645483",
"0.645483",
"0.6311786",
"0.6053184",
"0.59547555",
"0.59547555",
"0.59375024",
"0.5876461",
"0.5855425",
"0.5723819",
"0.5638595",
"0.549762",
"0.5497387",
"0.5497387",
"0.54557395",
"0.54470265",
"0.5420729",
... | 0.7039537 | 4 |
bind a transform feedback object | func BindTransformFeedback(target uint32, id uint32) {
C.glowBindTransformFeedback(gpBindTransformFeedback, (C.GLenum)(target), (C.GLuint)(id))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (self *ComponentScaleMinMax) TransformCallbackContext() interface{}{\n return self.Object.Get(\"transformCallbackContext\")\n}",
"func TransformFeedbackBufferBase(xfb uint32, index uint32, buffer uint32) {\n\tsyscall.Syscall(gpTransformFeedbackBufferBase, 3, uintptr(xfb), uintptr(index), uintptr(buffer))... | [
"0.597873",
"0.5743686",
"0.5680307",
"0.5622199",
"0.5622199",
"0.55374396",
"0.5507087",
"0.52361166",
"0.5157785",
"0.5142916",
"0.50832486",
"0.50082266",
"0.49723983",
"0.49582797",
"0.49582797",
"0.49286062",
"0.48971266",
"0.48971266",
"0.4894097",
"0.4888792",
"0.4830... | 0.48191622 | 22 |
bind a vertex array object | func BindVertexArray(array uint32) {
C.glowBindVertexArray(gpBindVertexArray, (C.GLuint)(array))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindVertexArray(array uint32) {\n C.glowBindVertexArray(gpBindVertexArray, (C.GLuint)(array))\n}",
"func BindVertexArray(array uint32) {\n\tsyscall.Syscall(gpBindVertexArray, 1, uintptr(array), 0, 0)\n}",
"func BindVertexBuffer(bindingindex uint32, buffer uint32, offset int, stride int32) {\n C.glowBind... | [
"0.6930566",
"0.64372987",
"0.631026",
"0.61983395",
"0.6163665",
"0.615646",
"0.613428",
"0.608097",
"0.59298235",
"0.5916304",
"0.58182645",
"0.58022517",
"0.57355267",
"0.57355267",
"0.5697444",
"0.5697444",
"0.5675388",
"0.56535226",
"0.56240255",
"0.5568131",
"0.55644774... | 0.64410067 | 2 |
bind a buffer to a vertex buffer bind point | func BindVertexBuffer(bindingindex uint32, buffer uint32, offset int, stride int32) {
C.glowBindVertexBuffer(gpBindVertexBuffer, (C.GLuint)(bindingindex), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(stride))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BindVertexBuffer(bindingindex uint32, buffer uint32, offset int, stride int32) {\n C.glowBindVertexBuffer(gpBindVertexBuffer, (C.GLuint)(bindingindex), (C.GLuint)(buffer), (C.GLintptr)(offset), (C.GLsizei)(stride))\n}",
"func BindVertexBuffer(bindingindex uint32, buffer uint32, offset int, stride int32) {\... | [
"0.7717517",
"0.7427129",
"0.7165118",
"0.7128333",
"0.7120448",
"0.7113185",
"0.7086752",
"0.70815086",
"0.7040799",
"0.69675136",
"0.6961297",
"0.6934498",
"0.692607",
"0.6769211",
"0.6769211",
"0.6749382",
"0.6749382",
"0.67335546",
"0.67189157",
"0.67189157",
"0.65948665"... | 0.7296413 | 3 |
attach multiple buffer objects to a vertex array object | func BindVertexBuffers(first uint32, count int32, buffers *uint32, offsets *int, strides *int32) {
C.glowBindVertexBuffers(gpBindVertexBuffers, (C.GLuint)(first), (C.GLsizei)(count), (*C.GLuint)(unsafe.Pointer(buffers)), (*C.GLintptr)(unsafe.Pointer(offsets)), (*C.GLsizei)(unsafe.Pointer(strides)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (g *Gaffer) AddBuffer(u *Update) {\n\n\tfor _, v := range u.entities {\n\t\tg.AddEntity(v)\n\t}\n\n\tfor _, v := range u.edges {\n\t\tg.AddEdge(v)\n\t}\n\n}",
"func BindVertexBuffers(first uint32, count int32, buffers *uint32, offsets *int, strides *int32) {\n C.glowBindVertexBuffers(gpBindVertexBuffers, (... | [
"0.68458647",
"0.6728047",
"0.6564569",
"0.6445395",
"0.6325015",
"0.62588865",
"0.61179435",
"0.61179435",
"0.60733587",
"0.60733587",
"0.6057369",
"0.6017042",
"0.5837031",
"0.5797567",
"0.5795221",
"0.5682038",
"0.5667529",
"0.56582224",
"0.56328213",
"0.56065065",
"0.5594... | 0.6346768 | 5 |
set the blend color | func BlendColor(red float32, green float32, blue float32, alpha float32) {
C.glowBlendColor(gpBlendColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func SetBlendColor(red Float, green Float, blue Float, alpha Float) {\n\tcred, _ := (C.GLfloat)(red), cgoAllocsUnknown\n\tcgreen, _ := (C.GLfloat)(green), cgoAllocsUnknown\n\tcblue, _ := (C.GLfloat)(blue), cgoAllocsUnknown\n\tcalpha, _ := (C.GLfloat)(alpha), cgoAllocsUnknown\n\tC.glBlendColor(cred, cgreen, cblue, ... | [
"0.7911841",
"0.7553172",
"0.74883896",
"0.74558616",
"0.7367328",
"0.6864653",
"0.66877264",
"0.66633636",
"0.64759445",
"0.64553934",
"0.64171994",
"0.6339601",
"0.6277886",
"0.6235966",
"0.6174357",
"0.61663425",
"0.61551267",
"0.614444",
"0.6050763",
"0.6037141",
"0.60077... | 0.7500396 | 3 |
specify the equation used for both the RGB blend equation and the Alpha blend equation | func BlendEquation(mode uint32) {
C.glowBlendEquation(gpBlendEquation, (C.GLenum)(mode))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func BlendEquation(mode uint32) {\n C.glowBlendEquation(gpBlendEquation, (C.GLenum)(mode))\n}",
"func PBLENDVB(x, mx, x1 operand.Op) { ctx.PBLENDVB(x, mx, x1) }",
"func VPBLENDMB(ops ...operand.Op) { ctx.VPBLENDMB(ops...) }",
"func BlendEquation(mode uint32) {\n\tsyscall.Syscall(gpBlendEquation, 1, uintptr(... | [
"0.7000268",
"0.6903696",
"0.6746614",
"0.67423177",
"0.6713342",
"0.66675776",
"0.6641725",
"0.66270536",
"0.6616733",
"0.657142",
"0.6564094",
"0.64331836",
"0.641082",
"0.63951325",
"0.638613",
"0.6352551",
"0.6342246",
"0.63367605",
"0.6317944",
"0.631385",
"0.6294172",
... | 0.63829076 | 16 |
set the RGB blend equation and the alpha blend equation separately | func BlendEquationSeparate(modeRGB uint32, modeAlpha uint32) {
C.glowBlendEquationSeparate(gpBlendEquationSeparate, (C.GLenum)(modeRGB), (C.GLenum)(modeAlpha))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func PBLENDVB(x, mx, x1 operand.Op) { ctx.PBLENDVB(x, mx, x1) }",
"func BlendColor(red float32, green float32, blue float32, alpha float32) {\n C.glowBlendColor(gpBlendColor, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))\n}",
"func VPBLENDVB(xy, mxy, xy1, xy2 operand.Op) { ctx.V... | [
"0.7103261",
"0.70349926",
"0.6937673",
"0.6889735",
"0.68769246",
"0.6785686",
"0.6758208",
"0.66305745",
"0.663032",
"0.66083694",
"0.6592942",
"0.65762967",
"0.64984715",
"0.64953494",
"0.6489191",
"0.6444187",
"0.64387745",
"0.64294606",
"0.64294606",
"0.6423835",
"0.6395... | 0.5864464 | 52 |
specify pixel arithmetic for RGB and alpha components separately | func BlendFuncSeparate(sfactorRGB uint32, dfactorRGB uint32, sfactorAlpha uint32, dfactorAlpha uint32) {
C.glowBlendFuncSeparate(gpBlendFuncSeparate, (C.GLenum)(sfactorRGB), (C.GLenum)(dfactorRGB), (C.GLenum)(sfactorAlpha), (C.GLenum)(dfactorAlpha))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func blendPixelOverPixel(ic_old,ic_new uint8, al_new float64)(c_res uint8) {\n\n\tal_old := float64(1); _=al_old\n\tc_old := float64(ic_old)\n\tc_new := float64(ic_new)\n\n\talgo1 := c_old*(1-al_new) + c_new*al_new\n\tc_res = uint8( util.Min( util.Round(algo1),255) )\n\t//log.Printf(\"\\t\\t %3.1f + %3.1f ... | [
"0.6542087",
"0.6257929",
"0.61677504",
"0.6158084",
"0.60555196",
"0.6023693",
"0.6018105",
"0.5883505",
"0.5865986",
"0.58443886",
"0.58059335",
"0.575977",
"0.5702025",
"0.56576234",
"0.5562223",
"0.55082834",
"0.5490548",
"0.5484248",
"0.5483388",
"0.5443062",
"0.54419273... | 0.0 | -1 |
copy a block of pixels from one framebuffer object to another | func BlitFramebuffer(srcX0 int32, srcY0 int32, srcX1 int32, srcY1 int32, dstX0 int32, dstY0 int32, dstX1 int32, dstY1 int32, mask uint32, filter uint32) {
C.glowBlitFramebuffer(gpBlitFramebuffer, (C.GLint)(srcX0), (C.GLint)(srcY0), (C.GLint)(srcX1), (C.GLint)(srcY1), (C.GLint)(dstX0), (C.GLint)(dstY0), (C.GLint)(dstX1), (C.GLint)(dstY1), (C.GLbitfield)(mask), (C.GLenum)(filter))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func CopyBufferSubData(readTarget uint32, writeTarget uint32, readOffset int, writeOffset int, size int) {\n C.glowCopyBufferSubData(gpCopyBufferSubData, (C.GLenum)(readTarget), (C.GLenum)(writeTarget), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))\n}",
"func BlitFramebuffer(srcX0 i... | [
"0.616907",
"0.6164028",
"0.6043857",
"0.5881865",
"0.5830083",
"0.5776536",
"0.57541645",
"0.56396943",
"0.56240493",
"0.5591138",
"0.5591138",
"0.55904067",
"0.55865586",
"0.5573469",
"0.5500675",
"0.54852164",
"0.5402666",
"0.5361507",
"0.53565097",
"0.53402716",
"0.531354... | 0.5537316 | 15 |
copy a block of pixels from one framebuffer object to another | func BlitNamedFramebuffer(readFramebuffer uint32, drawFramebuffer uint32, srcX0 int32, srcY0 int32, srcX1 int32, srcY1 int32, dstX0 int32, dstY0 int32, dstX1 int32, dstY1 int32, mask uint32, filter uint32) {
C.glowBlitNamedFramebuffer(gpBlitNamedFramebuffer, (C.GLuint)(readFramebuffer), (C.GLuint)(drawFramebuffer), (C.GLint)(srcX0), (C.GLint)(srcY0), (C.GLint)(srcX1), (C.GLint)(srcY1), (C.GLint)(dstX0), (C.GLint)(dstY0), (C.GLint)(dstX1), (C.GLint)(dstY1), (C.GLbitfield)(mask), (C.GLenum)(filter))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func CopyBufferSubData(readTarget uint32, writeTarget uint32, readOffset int, writeOffset int, size int) {\n C.glowCopyBufferSubData(gpCopyBufferSubData, (C.GLenum)(readTarget), (C.GLenum)(writeTarget), (C.GLintptr)(readOffset), (C.GLintptr)(writeOffset), (C.GLsizeiptr)(size))\n}",
"func BlitFramebuffer(srcX0 i... | [
"0.6169083",
"0.616298",
"0.6043505",
"0.588186",
"0.5827948",
"0.5775845",
"0.57539123",
"0.56394136",
"0.5623513",
"0.5591331",
"0.5591331",
"0.55884236",
"0.5585984",
"0.55723196",
"0.55363816",
"0.55363816",
"0.5499584",
"0.5483157",
"0.5401393",
"0.53606397",
"0.5356079"... | 0.0 | -1 |
creates and initializes a buffer object's data store | func BufferData(target uint32, size int, data unsafe.Pointer, usage uint32) {
C.glowBufferData(gpBufferData, (C.GLenum)(target), (C.GLsizeiptr)(size), data, (C.GLenum)(usage))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func newBuffer() *buffer {\n\treturn &buffer{\n\t\tdata: make([]byte, 0),\n\t\tlen: 0,\n\t\tpkg: nil,\n\t\tconn: nil,\n\t\tpkgCh: make(chan *pkg),\n\t\tevCh: make(chan *pkg),\n\t\terrCh: make(chan error, 1),\n\t}\n}",
"func newBuffer(buf []byte) *Buffer {\n\treturn &Buffer{data: buf}\n}",
"func newDatab... | [
"0.6452763",
"0.62074417",
"0.6085602",
"0.6062877",
"0.60546154",
"0.6051158",
"0.6039646",
"0.6039385",
"0.60212064",
"0.593024",
"0.58833855",
"0.5863987",
"0.58623064",
"0.58622515",
"0.58257276",
"0.5825609",
"0.5809823",
"0.57785004",
"0.5771321",
"0.5759343",
"0.575547... | 0.0 | -1 |
creates and initializes a buffer object's immutable data store | func BufferStorage(target uint32, size int, data unsafe.Pointer, flags uint32) {
C.glowBufferStorage(gpBufferStorage, (C.GLenum)(target), (C.GLsizeiptr)(size), data, (C.GLbitfield)(flags))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func newBuffer() *buffer {\n\treturn &buffer{\n\t\tdata: make([]byte, 0),\n\t\tlen: 0,\n\t\tpkg: nil,\n\t\tconn: nil,\n\t\tpkgCh: make(chan *pkg),\n\t\tevCh: make(chan *pkg),\n\t\terrCh: make(chan error, 1),\n\t}\n}",
"func newBuffer(b []byte) *buffer {\n\treturn &buffer{proto.NewBuffer(b), 0}\n}",
"fun... | [
"0.6349263",
"0.6268834",
"0.6243279",
"0.6195426",
"0.61694556",
"0.601713",
"0.5932492",
"0.5875461",
"0.5873252",
"0.58522457",
"0.5843238",
"0.58288723",
"0.5812875",
"0.568097",
"0.5639489",
"0.56271803",
"0.5614063",
"0.5613734",
"0.5606573",
"0.55912125",
"0.5575135",
... | 0.0 | -1 |
Parameter clientBuffer has type C.GLeglClientBufferEXT. | func BufferStorageExternalEXT(target uint32, offset int, size int, clientBuffer unsafe.Pointer, flags uint32) {
C.glowBufferStorageExternalEXT(gpBufferStorageExternalEXT, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), (C.GLeglClientBufferEXT)(clientBuffer), (C.GLbitfield)(flags))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func TexBuffer(target uint32, internalformat uint32, buffer uint32) {\n C.glowTexBuffer(gpTexBuffer, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLuint)(buffer))\n}",
"func TextureBuffer(texture uint32, internalformat uint32, buffer uint32) {\n\tC.glowTextureBuffer(gpTextureBuffer, (C.GLuint)(texture), (... | [
"0.6129812",
"0.60769343",
"0.60769343",
"0.606016",
"0.606016",
"0.59901834",
"0.5953861",
"0.5930928",
"0.5930928",
"0.590757",
"0.58745706",
"0.58521396",
"0.5824595",
"0.5824595",
"0.5820871",
"0.5820871",
"0.57433826",
"0.57313323",
"0.57080144",
"0.57080144",
"0.5680093... | 0.55824924 | 24 |
updates a subset of a buffer object's data store | func BufferSubData(target uint32, offset int, size int, data unsafe.Pointer) {
C.glowBufferSubData(gpBufferSubData, (C.GLenum)(target), (C.GLintptr)(offset), (C.GLsizeiptr)(size), data)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (b *CompactableBuffer) Update(address *EntryAddress, data []byte) error {\n\taddress.LockForWrite()\n\tdefer address.UnlockWrite()\n\theader, err := b.ReadHeader(address)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbeforeUpdataDataSize := header.dataSize\n\tafterUpdateDataSize := len(data) + VarIntSize(len(dat... | [
"0.61380696",
"0.55751455",
"0.5563734",
"0.5530041",
"0.5502157",
"0.5497179",
"0.5490029",
"0.54680365",
"0.5456551",
"0.5442295",
"0.5409087",
"0.5386492",
"0.53746295",
"0.53503454",
"0.5280482",
"0.52780133",
"0.5277513",
"0.52261436",
"0.52215093",
"0.5215384",
"0.52020... | 0.5120068 | 31 |
execute a display list | func CallList(list uint32) {
C.glowCallList(gpCallList, (C.GLuint)(list))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (e *Election) executeDisplay(msg imessage.IMessage) {\n\tif e.Display != nil {\n\t\te.Display.Execute(msg)\n\t}\n}",
"func (l *FileList) Display(\n\taccessKey *ui.Entry,\n\tsecretKey *ui.Entry,\n\tbucket *ui.Entry) (err error) {\n\n\tlist, err := comm.Refresh(\n\t\taccessKey.Text(), secretKey.Text(), bucket... | [
"0.65087223",
"0.63860244",
"0.6184103",
"0.616007",
"0.6151892",
"0.6128357",
"0.6125275",
"0.61051875",
"0.6054109",
"0.60203445",
"0.5973835",
"0.5953178",
"0.59499496",
"0.5948756",
"0.5931617",
"0.59210974",
"0.5900011",
"0.58987164",
"0.588424",
"0.58840364",
"0.5871788... | 0.0 | -1 |
execute a list of display lists | func CallLists(n int32, xtype uint32, lists unsafe.Pointer) {
C.glowCallLists(gpCallLists, (C.GLsizei)(n), (C.GLenum)(xtype), lists)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (c *DashboardLsCmd) Exec(ctx context.Context, args []string) error {\n\tdashboards, err := c.Conf.Client().Search(ctx, grafsdk.DashTypeSearchOption())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttable := tablewriter.NewWriter(os.Stdout)\n\ttable.SetHeader([]string{\"UID\", \"Folder\", \"Title\", \"URL\"})\n\... | [
"0.59823793",
"0.59679854",
"0.58969665",
"0.5839446",
"0.5837045",
"0.5829667",
"0.58105326",
"0.5798192",
"0.5782938",
"0.5754856",
"0.5722812",
"0.5719009",
"0.57121134",
"0.5702872",
"0.5686456",
"0.56853086",
"0.5649026",
"0.5640594",
"0.557456",
"0.557434",
"0.5555338",... | 0.0 | -1 |
check the completeness status of a framebuffer | func CheckFramebufferStatus(target uint32) uint32 {
ret := C.glowCheckFramebufferStatus(gpCheckFramebufferStatus, (C.GLenum)(target))
return (uint32)(ret)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (debugging *debuggingOpenGL) CheckFramebufferStatus(target uint32) uint32 {\n\tdebugging.recordEntry(\"CheckFramebufferStatus\", target)\n\tresult := debugging.gl.CheckFramebufferStatus(target)\n\tdebugging.recordExit(\"CheckFramebufferStatus\")\n\treturn result\n}",
"func (native *OpenGL) CheckFramebufferS... | [
"0.73928267",
"0.70599395",
"0.7016133",
"0.7013041",
"0.69053",
"0.6679579",
"0.6654849",
"0.6514342",
"0.64238244",
"0.64238244",
"0.6319358",
"0.5978551",
"0.58935463",
"0.579545",
"0.579545",
"0.5652102",
"0.56273943",
"0.5616955",
"0.5486069",
"0.5477105",
"0.53774965",
... | 0.6496274 | 9 |
check the completeness status of a framebuffer | func CheckNamedFramebufferStatus(framebuffer uint32, target uint32) uint32 {
ret := C.glowCheckNamedFramebufferStatus(gpCheckNamedFramebufferStatus, (C.GLuint)(framebuffer), (C.GLenum)(target))
return (uint32)(ret)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (debugging *debuggingOpenGL) CheckFramebufferStatus(target uint32) uint32 {\n\tdebugging.recordEntry(\"CheckFramebufferStatus\", target)\n\tresult := debugging.gl.CheckFramebufferStatus(target)\n\tdebugging.recordExit(\"CheckFramebufferStatus\")\n\treturn result\n}",
"func (native *OpenGL) CheckFramebufferS... | [
"0.73902386",
"0.70568424",
"0.7014738",
"0.7010243",
"0.6902235",
"0.667687",
"0.66522145",
"0.6511212",
"0.64931464",
"0.64931464",
"0.63167614",
"0.5976161",
"0.5891553",
"0.5793179",
"0.5793179",
"0.5653093",
"0.5625014",
"0.5617161",
"0.54864055",
"0.5478664",
"0.5378006... | 0.6420987 | 11 |
specify whether data read via should be clamped | func ClampColor(target uint32, clamp uint32) {
C.glowClampColor(gpClampColor, (C.GLenum)(target), (C.GLenum)(clamp))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func clamp(val float64) float64 {\n\treturn math.Max(-1, math.Min(1, val))\n}",
"func clamp(n, min, max int16) int16 {\n\tif n < min {\n\t\treturn min\n\t} else if n > max {\n\t\treturn max\n\t}\n\n\treturn n\n}",
"func clamp(min, max, v int) int {\n\tif v < min {\n\t\tmin = v\n\t} else if v > max {\n\t\tmax =... | [
"0.5568912",
"0.544267",
"0.5435445",
"0.54336435",
"0.54229486",
"0.5378128",
"0.5269297",
"0.5250991",
"0.5245359",
"0.5202621",
"0.50596756",
"0.49487576",
"0.49410132",
"0.4889552",
"0.48799032",
"0.48721945",
"0.4850817",
"0.4798648",
"0.47760805",
"0.47460827",
"0.47380... | 0.0 | -1 |
clear buffers to preset values | func Clear(mask uint32) {
C.glowClear(gpClear, (C.GLbitfield)(mask))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (d *Display) resetBuffer() {\n\td.width = d.device.Width()\n\td.height = d.device.Height()\n\td.buffer = make([][]byte, d.height)\n\tfor y := range d.buffer {\n\t\td.buffer[y] = make([]byte, d.width)\n\t}\n}",
"func (d *Driver) Clear() {\n\tfor i := 0; i < len(d.buff); i++ {\n\t\td.buff[i] = 0\n\t}\n}",
"... | [
"0.73622304",
"0.7274667",
"0.72177845",
"0.7180202",
"0.7105434",
"0.70081955",
"0.7007828",
"0.6998411",
"0.6987734",
"0.69397366",
"0.6896155",
"0.6880796",
"0.68779135",
"0.67908055",
"0.6777215",
"0.6763572",
"0.67466843",
"0.67050415",
"0.67035717",
"0.66774946",
"0.665... | 0.0 | -1 |
specify clear values for the accumulation buffer | func ClearAccum(red float32, green float32, blue float32, alpha float32) {
C.glowClearAccum(gpClearAccum, (C.GLfloat)(red), (C.GLfloat)(green), (C.GLfloat)(blue), (C.GLfloat)(alpha))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (s *UniformSample) Clear() {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\ts.count = 0\n\ts.values = make([]int64, 0, s.reservoirSize)\n}",
"func (b *Buffer) Clear() {\n\tb.series = make(map[string]*influxdb.Series)\n\tb.size = 0\n}",
"func (this *channelStruct) Clear() {\n\tthis.samples = make([]float64... | [
"0.6964405",
"0.67491966",
"0.67166877",
"0.6640258",
"0.6579979",
"0.6576724",
"0.65722305",
"0.6554715",
"0.6526159",
"0.64833635",
"0.64789146",
"0.6452193",
"0.6428444",
"0.64101845",
"0.6362103",
"0.6338142",
"0.6329918",
"0.6329918",
"0.624533",
"0.6206225",
"0.62022775... | 0.6179983 | 21 |
fill a buffer object's data store with a fixed value | func ClearBufferData(target uint32, internalformat uint32, format uint32, xtype uint32, data unsafe.Pointer) {
C.glowClearBufferData(gpClearBufferData, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLenum)(format), (C.GLenum)(xtype), data)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"func (dataBlock *DataBlock) fill(offset uint64, buf *bytes.Buffer) uint64 {\n\tbyteToFill := dataBlock.Capacity - offset\n\tbyteActualFill := buf.Next(int(byteToFill)) // API user...\n\tif len(byteActualFill) < int(byteToFill) {\n\t\t// Not sure if the byte at `offset` would be covered by new value...?????????????... | [
"0.5932752",
"0.5734838",
"0.5678285",
"0.56575704",
"0.565682",
"0.5643374",
"0.5642318",
"0.55881345",
"0.5571034",
"0.55051994",
"0.5500698",
"0.5496386",
"0.5485012",
"0.5478254",
"0.54011256",
"0.53939354",
"0.53479874",
"0.5335982",
"0.5331352",
"0.532966",
"0.5309759",... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.