id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1 value |
|---|---|---|
c182200 | panic("arm Removed is not set")
}
return val
} | |
c182201 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Removed" {
result = *u.Removed
ok = true
}
return
} | |
c182202 | panic("arm State is not set")
}
return val
} | |
c182203 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "State" {
result = *u.State
ok = true
}
return
} | |
c182204 | err = fmt.Errorf("invalid value, must be []OperationMeta")
return
}
result.Operations = &tv
}
return
} | |
c182205 | panic("arm Operations is not set")
}
return val
} | |
c182206 | _ := u.ArmForSwitch(int32(u.V))
if armName == "Operations" {
result = *u.Operations
ok = true
}
return
} | |
c182207 | ok := errorCodeMap[v]
return ok
} | |
c182208 | ok := ipAddrTypeMap[v]
return ok
} | |
c182209 |
case IpAddrTypeIPv6:
return "Ipv6", true
}
return "-", false
} | |
c182210 | if !ok {
err = fmt.Errorf("invalid value, must be [4]byte")
return
}
result.Ipv4 = &tv
case IpAddrTypeIPv6:
tv, ok := value.([16]byte)
if !ok {
err = fmt.Errorf("invalid value, must be [16]byte")
return
}
result.Ipv6 = &tv
}
return
} | |
c182211 | panic("arm Ipv4 is not set")
}
return val
} | |
c182212 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Ipv4" {
result = *u.Ipv4
ok = true
}
return
} | |
c182213 | panic("arm Ipv6 is not set")
}
return val
} | |
c182214 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Ipv6" {
result = *u.Ipv6
ok = true
}
return
} | |
c182215 | ok := messageTypeMap[v]
return ok
} | |
c182216 | MessageTypeGetScpQuorumset:
return "QSetHash", true
case MessageTypeScpQuorumset:
return "QSet", true
case MessageTypeScpMessage:
return "Envelope", true
case MessageTypeGetScpState:
return "GetScpLedgerSeq", true
}
return "-", false
} | |
c182217 | []PeerAddress")
return
}
result.Peers = &tv
case MessageTypeGetTxSet:
tv, ok := value.(Uint256)
if !ok {
err = fmt.Errorf("invalid value, must be Uint256")
return
}
result.TxSetHash = &tv
case MessageTypeTxSet:
tv, ok := value.(TransactionSet)
if !ok {
err = fmt.Errorf("invalid value, must be TransactionSet")
return
}
result.TxSet = &tv
case MessageTypeTransaction:
tv, ok := value.(TransactionEnvelope)
if !ok {
err = fmt.Errorf("invalid value, must be TransactionEnvelope")
return
}
result.Transaction = &tv
case MessageTypeGetScpQuorumset:
tv, ok := value.(Uint256)
if !ok {
err = fmt.Errorf("invalid value, must be Uint256")
return
}
result.QSetHash = &tv
case MessageTypeScpQuorumset:
tv, ok := value.(ScpQuorumSet)
if !ok {
err = fmt.Errorf("invalid value, must be ScpQuorumSet")
return
}
result.QSet = &tv
case MessageTypeScpMessage:
tv, ok := value.(ScpEnvelope)
if !ok {
err = fmt.Errorf("invalid value, must be ScpEnvelope")
return
}
result.Envelope = &tv
case MessageTypeGetScpState:
tv, ok := value.(Uint32)
if !ok {
err = fmt.Errorf("invalid value, must be Uint32")
return
}
result.GetScpLedgerSeq = &tv
}
return
} | |
c182218 | panic("arm Error is not set")
}
return val
} | |
c182219 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Error" {
result = *u.Error
ok = true
}
return
} | |
c182220 | panic("arm Hello is not set")
}
return val
} | |
c182221 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Hello" {
result = *u.Hello
ok = true
}
return
} | |
c182222 | panic("arm Auth is not set")
}
return val
} | |
c182223 | := u.ArmForSwitch(int32(u.Type))
if armName == "Auth" {
result = *u.Auth
ok = true
}
return
} | |
c182224 | panic("arm DontHave is not set")
}
return val
} | |
c182225 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "DontHave" {
result = *u.DontHave
ok = true
}
return
} | |
c182226 | panic("arm Peers is not set")
}
return val
} | |
c182227 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Peers" {
result = *u.Peers
ok = true
}
return
} | |
c182228 | panic("arm TxSetHash is not set")
}
return val
} | |
c182229 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "TxSetHash" {
result = *u.TxSetHash
ok = true
}
return
} | |
c182230 | panic("arm TxSet is not set")
}
return val
} | |
c182231 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "TxSet" {
result = *u.TxSet
ok = true
}
return
} | |
c182232 |
panic("arm Transaction is not set")
}
return val
} | |
c182233 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Transaction" {
result = *u.Transaction
ok = true
}
return
} | |
c182234 | panic("arm QSetHash is not set")
}
return val
} | |
c182235 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "QSetHash" {
result = *u.QSetHash
ok = true
}
return
} | |
c182236 | panic("arm QSet is not set")
}
return val
} | |
c182237 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "QSet" {
result = *u.QSet
ok = true
}
return
} | |
c182238 | panic("arm Envelope is not set")
}
return val
} | |
c182239 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Envelope" {
result = *u.Envelope
ok = true
}
return
} | |
c182240 | u.GetGetScpLedgerSeq()
if !ok {
panic("arm GetScpLedgerSeq is not set")
}
return val
} | |
c182241 | := u.ArmForSwitch(int32(u.Type))
if armName == "GetScpLedgerSeq" {
result = *u.GetScpLedgerSeq
ok = true
}
return
} | |
c182242 |
return "V0", true
}
return "-", false
} | |
c182243 | err = fmt.Errorf("invalid value, must be AuthenticatedMessageV0")
return
}
result.V0 = &tv
}
return
} | |
c182244 | ok := scpStatementTypeMap[v]
return ok
} | |
c182245 |
case ScpStatementTypeScpStExternalize:
return "Externalize", true
case ScpStatementTypeScpStNominate:
return "Nominate", true
}
return "-", false
} | |
c182246 |
tv, ok := value.(ScpStatementExternalize)
if !ok {
err = fmt.Errorf("invalid value, must be ScpStatementExternalize")
return
}
result.Externalize = &tv
case ScpStatementTypeScpStNominate:
tv, ok := value.(ScpNomination)
if !ok {
err = fmt.Errorf("invalid value, must be ScpNomination")
return
}
result.Nominate = &tv
}
return
} | |
c182247 | !ok {
panic("arm Prepare is not set")
}
return val
} | |
c182248 | == "Prepare" {
result = *u.Prepare
ok = true
}
return
} | |
c182249 | !ok {
panic("arm Confirm is not set")
}
return val
} | |
c182250 | == "Confirm" {
result = *u.Confirm
ok = true
}
return
} | |
c182251 | !ok {
panic("arm Externalize is not set")
}
return val
} | |
c182252 | armName == "Externalize" {
result = *u.Externalize
ok = true
}
return
} | |
c182253 |
panic("arm Nominate is not set")
}
return val
} | |
c182254 | _ := u.ArmForSwitch(int32(u.Type))
if armName == "Nominate" {
result = *u.Nominate
ok = true
}
return
} | |
c182255 | err
}
if count.Count != l {
return fmt.Errorf("input not fully consumed. expected to read: %d, actual: %d", l, count.Count)
}
return nil
} | |
c182256 | len(data) {
return fmt.Errorf("input not fully consumed. expected to read: %d, actual: %d", len(data), n)
}
return nil
} | |
c182257 | range s.Offers {
if o.AssetBought.String() != sa.String() {
break
}
ret += o.AmountBought
}
return ret
} | |
c182258 |
if err != nil {
return
}
err = decodeResponse(resp, &account)
return
} | |
c182259 | strconv.ParseUint(a.Sequence, 10, 64)
if err != nil {
return 0, err
}
return xdr.SequenceNumber(seq), nil
} | |
c182260 | c.Client.PostForm(c.URL+"/transactions", v)
if err != nil {
return
}
err = decodeResponse(resp, &response)
return
} | |
c182261 | r := other.MustOffer()
return l.SellerId.Equals(r.SellerId) && l.OfferId == r.OfferId
case LedgerEntryTypeTrustline:
l := key.MustTrustLine()
r := other.MustTrustLine()
return l.AccountId.Equals(r.AccountId) && l.Asset.Equals(r.Asset)
default:
panic(fmt.Errorf("Unknown ledger key type: %v", key.Type))
}
} | |
c182262 | NewLedgerKey(LedgerEntryTypeAccount, data)
if err != nil {
return err
}
*key = nkey
return nil
} | |
c182263 | := NewLedgerKey(LedgerEntryTypeData, data)
if err != nil {
return err
}
*key = nkey
return nil
} | |
c182264 | := NewLedgerKey(LedgerEntryTypeOffer, data)
if err != nil {
return err
}
*key = nkey
return nil
} | |
c182265 | := NewLedgerKey(LedgerEntryTypeTrustline, data)
if err != nil {
return err
}
*key = nkey
return nil
} | |
c182266 | {
b.keys = append(b.keys, key)
b.values = append(b.values, value)
} | |
c182267 | {
return false
}
duplicate[h] = true
}
// Update seen hashes
for _, h := range hashes {
seen[h] = true
}
// Add the hash index.
indices[bucket.index] = ri
// Update the the hash table.
for i, h := range hashes {
keys[h] = bucket.keys[i]
values[h] = bucket.values[i]
}
return true
} | |
c182268 | (hasher(b) ^ h.r[0]) % h.buckets
} | |
c182269 | {
return uint64(binary.LittleEndian.Uint32(b.Read(4)))
} | |
c182270 | return nil, err
}
return Mmap(b)
} | |
c182271 | ti := (h ^ r) % uint64(len(c.keys))
// fmt.Printf("r[0]=%d, h=%d, i=%d, ri=%d, r=%d, ti=%d\n", c.r[0], h, i, ri, r, ti)
k := c.keys[ti]
if bytes.Compare(k, key) != 0 {
return nil
}
v := c.values[ti]
return v
} | |
c182272 | return nil
}
return &Iterator{c: c}
} | |
c182273 | v := c.keys[i], c.values[i]
if err := write(uint32(len(k)), uint32(len(v))); err != nil {
return err
}
if _, err := w.Write(k); err != nil {
return err
}
if _, err := w.Write(v); err != nil {
return err
}
}
return nil
} | |
c182274 | return errors.New("registering datasources: " + e)
}
return errors.New("error while registering datasources")
}
return nil
} | |
c182275 | return errors.New("registering fonts: " + e)
}
return errors.New("error while registering fonts")
}
return nil
} | |
c182276 | C.uint(600)),
width: 800,
height: 600,
}
} | |
c182277 | C.mapnik_map(C.uint(width), C.uint(height)),
width: width,
height: height,
}
} | |
c182278 | if C.mapnik_map_load(m.m, cs) != 0 {
return m.lastError()
}
return nil
} | |
c182279 | C.uint(width), C.uint(height))
m.width = width
m.height = height
} | |
c182280 | C.mapnik_map_free(m.m)
m.m = nil
} | |
c182281 | C.GoString(C.mapnik_map_get_srs(m.m))
} | |
c182282 | return m.lastError()
}
return nil
} | |
c182283 | defer C.mapnik_bbox_free(bbox)
C.mapnik_map_zoom_to_box(m.m, bbox)
} | |
c182284 | }
b := C.mapnik_image_to_blob(i, format)
if b == nil {
return nil, errors.New("mapnik: " + C.GoString(C.mapnik_image_last_error(i)))
}
C.free(unsafe.Pointer(format))
defer C.mapnik_image_blob_free(b)
return C.GoBytes(unsafe.Pointer(b.ptr), C.int(b.len)), nil
} | |
c182285 | := 0
raw := C.mapnik_image_to_raw(i, (*C.size_t)(unsafe.Pointer(&size)))
b := C.GoBytes(unsafe.Pointer(raw), C.int(size))
img := &image.NRGBA{
Pix: b,
Stride: int(m.width * 4),
Rect: image.Rect(0, 0, int(m.width), int(m.height)),
}
return img, nil
} | |
c182286 | {
format = C.CString("png256")
}
defer C.free(unsafe.Pointer(format))
if C.mapnik_map_render_to_file(m.m, cs, C.double(opts.Scale), C.double(scaleFactor), format) != 0 {
return m.lastError()
}
return nil
} | |
c182287 | C.mapnik_map_set_buffer_size(m.m, C.int(s))
} | |
c182288 | can respond
_, err = conn.WriteTo(searchBytes, broadcastAddr)
if err != nil {
return nil, err
}
return readSearchResponses(conn, mx)
} | |
c182289 | var err error
conn.Conn, err = p.factory()
if err != nil {
conn.start = time.Now()
p.put(conn)
return nil, err
}
}
conn.unusable = false
return conn, nil
case <-time.After(time.Second*p.timeout):
return nil, ErrTimeout
}
} | |
c182290 | underlying net.Conn is set to nil
if conn.unusable {
if conn.Conn != nil {
conn.Conn.Close()
conn.Conn = nil
}
}
//It is impossible to block as number of connections is never more than length of channel
conns <-conn
return nil
} | |
c182291 | {
stereoData[j] = buf.Data[i]
j++
stereoData[j] = buf.Data[i]
j++
}
buf.Data = stereoData
buf.Format.NumChannels = 2
return nil
} | |
c182292 | frac = signum(frac) * math.Floor(math.Abs(frac)/stepSize+0.5) * stepSize
buf.Data[i] = math.Ldexp(frac, exp)
}
} | |
c182293 |
}
if max != 0.0 {
for i := 0; i < len(buf.Data); i++ {
buf.Data[i] /= max
}
}
} | |
c182294 | := 0; i < len(buf.Data); i++ {
buf.Data[i] *= multiplier
}
return nil
} | |
c182295 | i++ {
newData[i] = 0
for j := 0; j < nChans; j++ {
newData[i] += buf.Data[i*nChans+j]
}
newData[i] /= nChansF
}
buf.Data = newData
buf.Format.NumChannels = 1
return nil
} | |
c182296 | - 1
bufLen := len(buf.Data)
for i := 0; i < bufLen; i++ {
buf.Data[i] = round((buf.Data[i]+1)*max)/max - 1.0
}
} | |
c182297 | for i := 0; i < len(buf.Data); i++ {
buf.Data[i] *= factor
}
return nil
} | |
c182298 | <= len(buf.Data); i += 2 {
buf.Data[i+1] *= (pan * 2)
}
} else {
for i := 0; i+2 <= len(buf.Data); i += 2 {
buf.Data[i] *= ((1 - pan) * 2)
}
}
return nil
} | |
c182299 | f.lock.Lock()
defer f.lock.Unlock()
return f.leader
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.