id
stringlengths
2
7
text
stringlengths
17
51.2k
title
stringclasses
1 value
c19400
uintptr(unsafe.Pointer(idata)), uintptr(GetUserDefaultLCID()), uintptr(unsafe.Pointer(&pptinfo))) if hr != 0 { err = NewError(hr) } return }
c19401
procCopyMemory.Call(uintptr(dest), uintptr(src), uintptr(length)) }
c19402
_, _ := procGetUserDefaultLCID.Call() lcid = uint32(ret) return }
c19403
procDispatchMessageW.Call(uintptr(unsafe.Pointer(msg))) ret = int32(r0) return }
c19404
if r != 0 { return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil } return time.Now(), errors.New("Could not convert to time, passing current time.") }
c19405
= BstrToString(e.bstrDescription) } if e.bstrHelpFile == nil { hlp = "<nil>" } else { hlp = BstrToString(e.bstrHelpFile) } return fmt.Sprintf( "wCode: %#x, bstrSource: %v, bstrDescription: %v, bstrHelpFile: %v, dwHelpContext: %#x, scode: %#x", e.wCode, src, desc, hlp, e.dwHelpContext, e.scode, ) }
c19406
code := e.scode if e.wCode != 0 { code = uint32(e.wCode) } return fmt.Sprintf("%v: %#x", src, code) }
c19407
= v.GetIDsOfName([]string{name}) if err != nil { return } displayID = displayIDs[0] return }
c19408
1 { result, err = v.Invoke(displayID, dispatch) } else { result, err = v.Invoke(displayID, dispatch, params...) } return }
c19409
return v.InvokeWithOptionalArgs(name, DISPATCH_METHOD, params) }
c19410
return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYGET, params) }
c19411
return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYPUT, params) }
c19412
} } unknown, err := CreateInstance(clsid, IID_IUnknown) if err != nil { return } c.Object = unknown return }
c19413
{ tempErrors = append(tempErrors, err) numErrors += 1 continue } break } copy(errors, tempErrors[0:numErrors]) return }
c19414
err != nil { return } object = &Dispatch{dispatch} return }
c19415
id, err := d.GetId(method) if err != nil { return } result, err = d.Invoke(id, DISPATCH_METHOD, params) return }
c19416
if err != nil { panic(err) } result, err = d.Invoke(id, DISPATCH_METHOD, params) if err != nil { panic(err) } return }
c19417
result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params) return }
c19418
if err != nil { panic(err) } result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params) if err != nil { panic(err) } return }
c19419
result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params) return }
c19420
if err != nil { panic(err) } result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params) if err != nil { panic(err) } return }
c19421
d.Object.GetIDsOfName([]string{name}) if err != nil { return } id = dispid[0] return }
c19422
[]int32, err error) { dispid, err = d.Object.GetIDsOfName(names) return }
c19423
if len(params) < 1 { result, err = d.Object.Invoke(id, dispatch) } else { result, err = d.Object.Invoke(id, dispatch, params...) } return }
c19424
connection.Load(names...) return }
c19425
uintptr(unsafe.Pointer(&element)))) str = BstrToString(*(**uint16)(unsafe.Pointer(&element))) SysFreeString(element) return }
c19426
err = CLSIDFromString(programID) if err != nil { return } } return }
c19427
for a[i] != 0 { i++ } return string(a[:i]) }
c19428
a[i] = *(*uint16)(ptr) ptr = unsafe.Pointer(uintptr(ptr) + 2) } return string(utf16.Decode(a)) }
c19429
a[i] = *(*uint16)(ptr) ptr = unsafe.Pointer(uintptr(ptr) + 2) } return string(utf16.Decode(a)) }
c19430
length = int64(i) break } ptr = unsafe.Pointer(uintptr(ptr) + 2) } return }
c19431
0 { err = NewError(hr) } return }
c19432
return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) } // trim terminating \r and \n for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { } return string(utf16.Decode(b[:n])) }
c19433
oleutil.MustGetProperty(cell, "string").ToString() }
c19434
string) { oleutil.MustPutProperty(cell, "string", text) }
c19435
float64) { oleutil.MustPutProperty(cell, "value", value) }
c19436
// alternative: private:factory/swriter "_blank", 0, args).ToIDispatch() return }
c19437
cell1_4 := LOGetCell(sheet0, 1, 4) // cell B5 LOSetCellString(cell1_1, "Hello World") LOSetCellValue(cell1_2, 33.45) LOSetCellFormula(cell1_3, "=B3+5") b4Value := LOGetCellString(cell1_3) LOSetCellString(cell1_4, b4Value) // set background color yellow: oleutil.MustPutProperty(cell1_1, "cellbackcolor", 0xFFFF00...
c19438
return &OleError{hr: hr, description: description} }
c19439
return &OleError{hr: hr, description: description, subError: err} }
c19440
v.description + ")" } return errstr(int(v.hr)) }
c19441
procWindowsDeleteString.Call(uintptr(hstring)) if hr != 0 { err = NewError(hr) } return }
c19442
Len: int(u16len), Cap: int(u16len)} u16 := *(*[]uint16)(unsafe.Pointer(&u16hdr)) return syscall.UTF16ToString(u16) }
c19443
return ole.ClassIDFrom(programID) }
c19444
if err != nil { return } unknown, err = ole.CreateInstance(classID, ole.IID_IUnknown) if err != nil { return } return }
c19445
if err != nil { return } unknown, err = ole.GetActiveObject(classID, ole.IID_IUnknown) if err != nil { return } return }
c19446
(result *ole.VARIANT, err error) { return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_METHOD, params) }
c19447
*ole.VARIANT) { r, err := CallMethod(disp, name, params...) if err != nil { panic(err.Error()) } return r }
c19448
return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYGET, params) }
c19449
*ole.VARIANT) { r, err := GetProperty(disp, name, params...) if err != nil { panic(err.Error()) } return r }
c19450
return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUT, params) }
c19451
*ole.VARIANT) { r, err := PutProperty(disp, name, params...) if err != nil { panic(err.Error()) } return r }
c19452
(result *ole.VARIANT, err error) { return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUTREF, params) }
c19453
*ole.VARIANT) { r, err := PutPropertyRef(disp, name, params...) if err != nil { panic(err.Error()) } return r }
c19454
c := source.At(x, y) if c == color.Transparent { continue } target.Set(x, y, c) } } }
c19455
for y := bounds.Min.Y; y < bounds.Max.Y; y++ { for x := bounds.Min.X; x < bounds.Max.X; x++ { target.Set(x, y, source.At(x, y)) } } }
c19456
w.Write([]byte(fmt.Sprintf("\033[999D\033[%dA", rows))) }
c19457
w: w, c: mergeConfig(c), } }
c19458
} c++ if err := i.Scan(r); err != nil { return err } if err := enc.Encode(r); err != nil { return err } } // Close paren. if _, err := w.Write([]byte{']'}); err != nil { return err } return nil }
c19459
return err } if err := enc.Encode(r); err != nil { return err } } return nil }
c19460
case string: if x == "" { continue } } c[k] = v } return c }
c19461
err != nil { return err } mapBytesToString(r) return nil }
c19462
cleanParams(params) dsn, ok := params["dsn"].(string) if !ok { dsn = connector(params) } return sqlx.Connect(driver, dsn) }
c19463
{ rows, err = db.NamedQuery(sql, params) } else { rows, err = db.Queryx(sql) } if err != nil { return nil, err } cols, err := rows.Columns() if err != nil { return nil, err } return &Iterator{ Cols: cols, rows: rows, }, nil }
c19464
_, db := range connMap { db.Close() } connMapMutex.Unlock() }
c19465
if params["boundary"] == "NL" { return "application/x-ldjson" } default: if _, ok := mimetypeFormats[mimetype]; !ok { return "" } } return mimetype }
c19466
match(source, target, unicode.ToLower) }
c19467
find(source, targets, noop) }
c19468
find(source, targets, unicode.ToLower) }
c19469
rank(source, target, unicode.ToLower) }
c19470
distance := LevenshteinDistance(source, target) r = append(r, Rank{source, target, distance, index}) } } return r }
c19471
:= LevenshteinDistance(source, target) r = append(r, Rank{source, target, distance, index}) } } return r }
c19472
0 { result = tr.mappedRune break } if rrm.ToLo < rrm.ToHi { result = rrm.ToLo + r - rrm.FromLo } else if rrm.ToLo > rrm.ToHi { // ToHi can be smaller than ToLo if range is from higher to lower. result = rrm.ToLo - r + rrm.FromLo } else { result = rrm.ToLo } break...
c19473
(r == '\'' || r == '-'): // Still in word. default: inWord = false } str = str[size:] } return n }
c19474
Rare CJK characters. case r >= '\u3400' && r <= '\u4D85': return false // Rare and historic CJK characters. case r >= '\U00020000' && r <= '\U0002B81D': return false } return true }
c19475
buf.WriteRune(unicode.ToUpper(r)) default: buf.WriteRune(r) } str = str[size:] } return buf.String() }
c19476
if !unicode.IsLower(r) { return str } buf := &bytes.Buffer{} buf.WriteRune(unicode.ToUpper(r)) buf.WriteString(str[size:]) return buf.String() }
c19477
if !unicode.IsUpper(r) { return str } buf := &bytes.Buffer{} buf.WriteRune(unicode.ToLower(r)) buf.WriteString(str[size:]) return buf.String() }
c19478
index = r.Intn(i + 1) if i != index { runes[i], runes[index] = runes[index], runes[i] } } return string(runes) }
c19479
= append(s[:tail], []byte(str[:size])...) str = str[size:] } return string(buf) }
c19480
head = str[:index] match = str[index : index+len(sep)] tail = str[index+len(sep):] return }
c19481
head = str[:index] match = str[index : index+len(sep)] tail = str[index+len(sep):] return }
c19482
0, index) + src + Slice(dst, index, -1) }
c19483
} else if hasError { hasError = false buf.WriteString(repl) origin = origin[pos:] pos = 0 } pos += size str = str[size:] } if buf != nil { buf.WriteString(origin) return buf.String() } // No invalid byte. return origin }
c19484
!inWord { inWord = true word = str pos = 0 } case inWord && (r == '\'' || r == '-'): // Still in word. default: if inWord { inWord = false words = append(words, word[:pos]) } } pos += size str = str[size:] } if inWord { words = append(words, word[:pos]) } return wor...
c19485
much memory at once. if maxSize > bufferMaxInitGrowSize { maxSize = bufferMaxInitGrowSize } output.Grow(maxSize) output.WriteString(orig[:len(orig)-len(cur)]) return output }
c19486
wait <- Done{} }() return wait }
c19487
portMap[p] = false } return &InputGuard{portMap, 0} }
c19488
{ g.ports[port] = true g.complete++ } return g.complete >= len(g.ports) }
c19489
export.Private[strings.Index(export.Private, ".")+1:] // Try to detect port direction using reflection procType := reflect.TypeOf(net.Get(procName)).Elem() field, fieldFound := procType.FieldByName(procPort) if !fieldFound { panic("Private port '" + export.Private + "' not found") } if field.Type...
c19490
nil { return nil } return ParseJSON(js) }
c19491
LoadJSON(filePath) } return Register(componentName, constructor) }
c19492
== 1 { conf = config[0] } return &Factory{ registry: make(map[string]registryEntry, conf.RegistryCapacity), } }
c19493
f.registry[componentName] = registryEntry{ Constructor: constructor, Info: ComponentInfo{ Name: componentName, }, } return nil }
c19494
error: component '%s' is not registered", componentName) } entry := f.registry[componentName] entry.Info.Description = annotation.Description entry.Info.Icon = annotation.Icon f.registry[componentName] = entry return nil }
c19495
nil } return fmt.Errorf("Registry error: component '%s' is not registered", componentName) }
c19496
return nil, fmt.Errorf("Factory error: component '%s' does not exist", componentName) }
c19497
found if !channel.IsValid() { // Make a channel of an appropriate type chanType := reflect.ChanOf(reflect.BothDir, sndPortType.Elem()) channel = reflect.MakeChan(chanType, bufferSize) } // Set the channels // TODO fix rewiring a graph without disconnecting ports if senderPortVal.IsNil() { senderPortVal.S...
c19498
if err != nil { return nilValue, fmt.Errorf("Connect error: process '%s' does not have port '%s'", procName, portName) } // Validate port type portType := portVal.Type() // Sender port can be an array port if dir == reflect.SendDir && portType.Kind() == reflect.Slice { portType = portType.Elem() } // Va...
c19499
_, conn := range n.connections { var p portName if dir == reflect.SendDir { p = conn.src } else { p = conn.tgt } if p.port == procPort && p.proc == proc { channel = conn.channel break } } return channel }