id
stringlengths
2
7
text
stringlengths
17
51.2k
title
stringclasses
1 value
c179900
return cdp.Execute(ctx, CommandDisposeBrowserContext, p, nil) }
c179901
SessionID) *SendMessageToTargetParams { p.SessionID = sessionID return &p }
c179902
return cdp.Execute(ctx, CommandSendMessageToTarget, p, nil) }
c179903
return cdp.Execute(ctx, CommandSetAutoAttach, p, nil) }
c179904
return cdp.Execute(ctx, CommandSetDiscoverTargets, p, nil) }
c179905
return cdp.Execute(ctx, CommandSetRemoteLocations, p, nil) }
c179906
*EnableParams { p.Patterns = patterns return &p }
c179907
p.HandleAuthRequests = handleAuthRequests return &p }
c179908
return cdp.Execute(ctx, CommandFailRequest, p, nil) }
c179909
string) *FulfillRequestParams { p.Body = body return &p }
c179910
p.ResponsePhrase = responsePhrase return &p }
c179911
return cdp.Execute(ctx, CommandFulfillRequest, p, nil) }
c179912
string) *ContinueRequestParams { p.URL = url return &p }
c179913
{ p.Method = method return &p }
c179914
{ p.PostData = postData return &p }
c179915
[]*HeaderEntry) *ContinueRequestParams { p.Headers = headers return &p }
c179916
return cdp.Execute(ctx, CommandContinueRequest, p, nil) }
c179917
return cdp.Execute(ctx, CommandContinueWithAuth, p, nil) }
c179918
return cdp.Execute(ctx, CommandContinueToLocation, p, nil) }
c179919
p.IncludeCommandLineAPI = includeCommandLineAPI return &p }
c179920
return cdp.Execute(ctx, CommandPause, nil, nil) }
c179921
return cdp.Execute(ctx, CommandPauseOnAsyncCall, p, nil) }
c179922
return cdp.Execute(ctx, CommandRemoveBreakpoint, p, nil) }
c179923
return cdp.Execute(ctx, CommandResume, nil, nil) }
c179924
return cdp.Execute(ctx, CommandSetAsyncCallStackDepth, p, nil) }
c179925
return cdp.Execute(ctx, CommandSetBlackboxPatterns, p, nil) }
c179926
return cdp.Execute(ctx, CommandSetBlackboxedRanges, p, nil) }
c179927
string) *SetBreakpointByURLParams { p.URL = url return &p }
c179928
string) *SetBreakpointByURLParams { p.URLRegex = urlRegex return &p }
c179929
{ p.ScriptHash = scriptHash return &p }
c179930
p.ColumnNumber = columnNumber return &p }
c179931
string) *SetBreakpointOnFunctionCallParams { p.Condition = condition return &p }
c179932
return cdp.Execute(ctx, CommandSetBreakpointsActive, p, nil) }
c179933
return cdp.Execute(ctx, CommandSetPauseOnExceptions, p, nil) }
c179934
return cdp.Execute(ctx, CommandSetReturnValue, p, nil) }
c179935
{ p.DryRun = dryRun return &p }
c179936
return cdp.Execute(ctx, CommandSetSkipAllPauses, p, nil) }
c179937
return cdp.Execute(ctx, CommandSetVariableValue, p, nil) }
c179938
p.BreakOnAsyncCall = breakOnAsyncCall return &p }
c179939
return cdp.Execute(ctx, CommandStepInto, p, nil) }
c179940
return cdp.Execute(ctx, CommandStepOut, nil, nil) }
c179941
return cdp.Execute(ctx, CommandStepOver, nil, nil) }
c179942
nb.ListenF != nil { nb.ListenF(n, a) } }
c179943
nb.ListenCloseF != nil { nb.ListenCloseF(n, a) } }
c179944
c Conn) { if nb.ConnectedF != nil { nb.ConnectedF(n, c) } }
c179945
c Conn) { if nb.DisconnectedF != nil { nb.DisconnectedF(n, c) } }
c179946
s Stream) { if nb.OpenedStreamF != nil { nb.OpenedStreamF(n, s) } }
c179947
s Stream) { if nb.ClosedStreamF != nil { nb.ClosedStreamF(n, s) } }
c179948
context.WithValue(ctx, noDial, reason) }
c179949
nil { return true, v.(string) } return false, "" }
c179950
context.WithValue(ctx, dialPeerTimeoutCtxKey{}, timeout) }
c179951
driver.Conn which // also implements Execer return &ExecerContext{wrapped}, nil } else if isQueryer(conn) { // If conn implements an Queryer interface, return a driver.Conn which // also implements Queryer return &QueryerContext{wrapped}, nil } return wrapped, nil }
c179952
-1 } a0, a1, b0, b1 := f.LegalPos() switch { case from == a0: return -1 case from > a0 && from <= a1: return from - 1 case from == b0: return a1 case from > b0 && from <= b1: return from - 1 } return -1 }
c179953
fit without wrapping return last } return last % f.N }
c179954
<= 0 { return } if n >= f.Readable { f.Readable = 0 return } f.Readable -= n }
c179955
0, Readable: 0, } r.A = make([]float64, n, n) return r }
c179956
second stay an empty slice. return b.A[b.Beg:(b.Beg + b.Readable)], second } return b.A[b.Beg:b.N], b.A[0:(extent % b.N)] }
c179957
return } return b.A[b.Beg], true }
c179958
out := make([]float64, len(first) + len(second)) copy(out, first) copy(out[len(first):], second) return out }
c179959
wrap, linearize into the other. N: n, Beg: 0, readable: 0, } r.A[0] = make([]byte, n, n) r.A[1] = make([]byte, n, n) return r }
c179960
b.Beg = 0 b.readable = 0 b.Use = 0 }
c179961
0, Readable: 0, } r.A = make([]interface{}, n, n) return r }
c179962
empty slice. return b.A[b.Beg:(b.Beg + b.Readable)], second } return b.A[b.Beg:b.N], b.A[0:(extent % b.N)] }
c179963
(r.Trailer().Key("Root").Key("Pages").Key("Count").Int64()) }
c179964
{ return Font{p.Resources().Key("Font").Key(name)} }
c179965
if code < first || last < code { return 0 } return f.V.Key("Widths").Index(code - first).Float64() }
c179966
try ToUnicode default: println("unexpected encoding", enc.String()) return &nopEncoder{} } toUnicode := f.V.Key("ToUnicode") if toUnicode.Kind() == Dict { m := readCmap(toUnicode) if m == nil { return &nopEncoder{} } return m } return &byteEncoder{&pdfDocEncoding} }
c179967
d.Kind() != Dict { panic("cannot begin non-dict") } dicts = append(dicts, d.data.(dict)) continue case "end": if len(dicts) <= 0 { panic("mismatched begin/end") } dicts = dicts[:len(dicts)-1] continue case "def": if len(dicts) <= 0 { panic("def without open dict") } val := stk.Pop() key, ok := stk.Pop().data.(name) if !ok { panic("def of non-name") } dicts[len(dicts)-1][key] = val.data continue case "pop": stk.Pop() continue } } b.unreadToken(tok) obj := b.readObject() stk.Push(Value{nil, objptr{}, obj}) } }
c179968
if err != nil { f.Close() return nil, err } return NewReader(f, fi.Size()) }
c179969
return NewReaderEncrypted(f, size, nil) }
c179970
if !ok { return nil, fmt.Errorf("malformed PDF file: startxref not followed by integer") } b = newBuffer(io.NewSectionReader(r.f, startxref, r.end-startxref), startxref) xref, trailerptr, trailer, err := readXref(r, b) if err != nil { return nil, err } r.xref = xref r.trailer = trailer r.trailerptr = trailerptr if trailer["Encrypt"] == nil { return r, nil } err = r.initEncrypt("") if err == nil { return r, nil } if pw == nil || err != ErrInvalidPassword { return nil, err } for { next := pw() if next == "" { break } if r.initEncrypt(next) == nil { return r, nil } } return nil, err }
c179971
r.trailerptr, r.trailer} }
c179972
return Name case dict: return Dict case array: return Array case stream: return Stream } }
c179973
buf: make([]byte, 0, 4096), allowObjptr: true, allowStream: true, } }
c179974
(page - 1) * perPage r.Query.Skip(skip).Limit(perPage) info.TotalPages = totalPages info.PerPage = perPage info.Current = page info.TotalRecords = count if info.Current < info.TotalPages { info.RecordsOnPage = info.PerPage } else { info.RecordsOnPage = int(math.Mod(float64(count), float64(perPage))) if info.RecordsOnPage == 0 && count > 0 { info.RecordsOnPage = perPage } } return info, nil }
c179975
if err != nil { panic(err) } conf.ReferenceQuery = []*ReferenceField{&ReferenceField{"_id", id}} } cascadeDeleteWithConfig(conf) } } }
c179976
} q := bson.M{} for _, f := range conf.ReferenceQuery { q[f.BsonName] = f.Value } update["$pull"][conf.ThroughProp] = q return conf.Collection.Collection().UpdateAll(conf.Query, update) } return &mgo.ChangeInfo{}, errors.New("Invalid relation type") }
c179977
f := range conf.ReferenceQuery { q[f.BsonName] = f.Value } update1["$pull"][conf.ThroughProp] = q if len(conf.OldQuery) > 0 { ret, err := conf.Collection.Collection().UpdateAll(conf.OldQuery, update1) if conf.RemoveOnly { return ret, err } } // Remove self from current relations, so we can replace it conf.Collection.Collection().UpdateAll(conf.Query, update1) update2 := map[string]map[string]interface{}{ "$push": map[string]interface{}{}, } update2["$push"][conf.ThroughProp] = data return conf.Collection.Collection().UpdateAll(conf.Query, update2) } return &mgo.ChangeInfo{}, errors.New("Invalid relation type") }
c179978
ok := curData[s].(map[string]interface{}); ok { curData = mapped } else { panic("Cannot access non-map property via dot notation") } } } val, _ := dotaccess.Get(doc, prop) // if bsonId, ok := val.(bson.ObjectId); ok { // if !bsonId.Valid() { // curData[actualProp] = "" // continue // } // } curData[actualProp] = val } } return data }
c179979
due to error: %s", m.Config.ConnectionString, err.Error())) } } session, err := mgo.DialWithInfo(m.Config.DialInfo) if err != nil { return err } m.Session = session m.Session.SetMode(mgo.Monotonic, true) return nil }
c179980
return string(unicode.ToLower(v)) + str[i+1:] } return "" }
c179981
resultset.Query = q resultset.Params = query resultset.Collection = c return resultset }
c179982
to='%s' id='%s' type='%s'><query xmlns='%s'>%s</query></iq>" _, err := fmt.Fprintf(c.conn, xmlIQ, xmlEscape(from), xmlEscape(to), id, iqType, requestNamespace, body) return id, err }
c179983
err != nil { return nil, err } insecureSkipVerify := DefaultConfig.InsecureSkipVerify if o.TLSConfig != nil { insecureSkipVerify = o.TLSConfig.InsecureSkipVerify } if !insecureSkipVerify { if err = tlsconn.VerifyHostname(host); err != nil { return nil, err } } client.conn = tlsconn } if err := client.init(&o); err != nil { client.Close() return nil, err } return client, nil }
c179984
return c.conn.Close() } return nil }
c179985
var err error fmt.Fprintf(c.conn, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n") var k tlsProceed if err = c.p.DecodeElement(&k, nil); err != nil { return f, errors.New("unmarshal <proceed>: " + err.Error()) } tc := o.TLSConfig if tc == nil { tc = new(tls.Config) *tc = DefaultConfig //TODO(scott): we should consider using the server's address or reverse lookup tc.ServerName = domain } t := tls.Client(c.conn, tc) if err = t.Handshake(); err != nil { return f, errors.New("starttls handshake: " + err.Error()) } c.conn = t // restart our declaration of XMPP stream intentions. tf, err := c.startStream(o, domain) if err != nil { return f, err } return tf, nil }
c179986
nsStream || se.Name.Local != "stream" { return nil, fmt.Errorf("expected <stream> but got <%v> in %v", se.Name.Local, se.Name.Space) } // Now we're in the stream and can use Unmarshal. // Next message should be <features> to tell us authentication options. // See section 4.6 in RFC 3920. f := new(streamFeatures) if err = c.p.DecodeElement(f, nil); err != nil { return f, errors.New("unmarshal <features>: " + err.Error()) } return f, nil }
c179987
:= c.conn.(*tls.Conn) return ok }
c179988
// TODO check more strictly if bytes.Equal(bytes.TrimSpace(v.Query), []byte(`<ping xmlns='urn:xmpp:ping'/>`)) || bytes.Equal(bytes.TrimSpace(v.Query), []byte(`<ping xmlns="urn:xmpp:ping"/>`)) { err := c.SendResultPing(v.ID, v.From) if err != nil { return Chat{}, err } } return IQ{ID: v.ID, From: v.From, To: v.To, Type: v.Type, Query: v.Query}, nil } } }
c179989
type='%s' id='%s' xml:lang='en'>" + subtext + "<body>%s</body>" + thdtext + "</message>" return fmt.Fprintf(c.conn, stanza, xmlEscape(chat.Remote), xmlEscape(chat.Type), cnonce(), xmlEscape(chat.Text)) }
c179990
{ return fmt.Fprint(c.conn, org) }
c179991
return fmt.Fprintf(c.conn, " ") }
c179992
xmlns='http://www.w3.org/1999/xhtml'>%s</body></html></message>", xmlEscape(chat.Remote), xmlEscape(chat.Type), xmlEscape(chat.Text), chat.Text) }
c179993
switch t := t.(type) { case xml.StartElement: return t, nil } } }
c179994
xmlEscape(password), history) case SecondsHistory: return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+ "<x xmlns='%s'>\n"+ "<password>%s</password>\n"+ "<history seconds='%d'/></x>\n"+ "</presence>", xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history) case SinceHistory: if history_date != nil { return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+ "<x xmlns='%s'>\n"+ "<password>%s</password>\n"+ "<history since='%s'/></x>\n"+ "</presence>", xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history_date.Format(time.RFC3339)) } } return 0, errors.New("Unknown history option") }
c179995
type='unavailable' />", c.jid, xmlEscape(jid)) }
c179996
{ m.Attachments[filename] = &Attachment{ Filename: filename, Data: buf, Inline: inline, } return nil }
c179997
m.attach(file, false) }
c179998
m.attach(file, true) }
c179999
:= Header{Key: key, Value: value} m.Headers = append(m.Headers, newHeader) return newHeader }