text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (joint B2WheelJoint) GetLocalAxisA() B2Vec2 {
return joint.M_localXAxisA
} | [
1.669972538948059,
-1.55558443069458,
0.21897515654563904,
0.3726069927215576,
-0.5883784294128418,
-0.25350135564804077,
0.628283679485321,
0.2964964807033539,
-0.027338199317455292,
-0.30293959379196167,
-0.04160911217331886,
1.2609198093414307,
-0.24708855152130127,
0.21128985285758972,... |
func (def *B2WheelJointDef) Initialize(bA *B2Body, bB *B2Body, anchor B2Vec2, axis B2Vec2) {
def.BodyA = bA
def.BodyB = bB
def.LocalAnchorA = def.BodyA.GetLocalPoint(anchor)
def.LocalAnchorB = def.BodyB.GetLocalPoint(anchor)
def.LocalAxisA = def.BodyA.GetLocalVector(axis)
} | [
1.0224947929382324,
-0.6474608182907104,
0.47615334391593933,
-0.36970120668411255,
0.8755064010620117,
0.04100530594587326,
0.35952576994895935,
0.08432891964912415,
-0.6465016007423401,
-0.24894985556602478,
-0.20833584666252136,
1.1680976152420044,
-0.28999918699264526,
0.20445564389228... |
func (joint B2WheelJoint) IsLimitEnabled() bool {
return joint.M_enableLimit
} | [
1.501444935798645,
-0.5969630479812622,
0.39723140001296997,
0.7361063957214355,
0.24913327395915985,
-0.12406597286462784,
-0.6400863528251648,
0.9371914863586426,
0.5498002171516418,
0.7964031100273132,
-0.7212707996368408,
-0.010953174903988838,
-2.3461055755615234,
-0.5025292634963989,... |
func (joint B2WheelJoint) EnableLimit(flag bool) {
if flag != joint.M_enableLimit {
joint.M_bodyA.SetAwake(true)
joint.M_bodyB.SetAwake(true)
joint.M_enableLimit = flag
joint.M_lowerImpulse = 0.0
joint.M_upperImpulse = 0.0
}
} | [
1.641430377960205,
-0.49581995606422424,
0.6442431211471558,
0.27300941944122314,
0.10278013348579407,
0.8256645798683167,
0.49943816661834717,
1.0226099491119385,
0.004056438338011503,
-0.11920430511236191,
-0.4985834062099457,
0.12512201070785522,
-1.0675570964813232,
-0.443815141916275,... |
func (joint B2WheelJoint) GetLowerLimit() float64 {
return joint.M_lowerTranslation
} | [
1.7547624111175537,
-0.19952377676963806,
0.36796730756759644,
-0.05425816401839256,
-0.133366659283638,
0.0063598062843084335,
-0.6234228014945984,
-0.6158112287521362,
-0.48654472827911377,
-0.4380297064781189,
-0.44313693046569824,
0.5305089354515076,
-1.7218315601348877,
-0.38474869728... |
func (joint B2WheelJoint) GetUpperLimit() float64 {
return joint.M_upperTranslation
} | [
0.6875879168510437,
0.004674697294831276,
0.5041242837905884,
0.4922020137310028,
-0.3037920594215393,
0.32210657000541687,
-0.4195321202278137,
0.45141974091529846,
-0.3375248908996582,
-0.13669215142726898,
-0.5211828351020813,
0.4361589848995209,
-0.6580550074577332,
-0.6684969663619995... |
func (joint B2WheelJoint) SetLimits(lower float64, upper float64) {
B2Assert(lower <= upper)
if lower != joint.M_lowerTranslation || upper != joint.M_upperTranslation {
joint.M_bodyA.SetAwake(true)
joint.M_bodyB.SetAwake(true)
joint.M_lowerTranslation = lower
joint.M_upperTranslation = upper
joint.M_lowerIm... | [
0.6625813841819763,
-0.21489451825618744,
0.514539897441864,
-0.17016011476516724,
-0.16969217360019684,
0.2702699601650238,
-0.022509831935167313,
-0.2169272005558014,
-0.5365965366363525,
-0.4981183707714081,
-0.5465637445449829,
0.07501974701881409,
-1.0831490755081177,
0.25658708810806... |
func (joint *B2WheelJoint) SetStiffness(stiffness float64) {
joint.M_stiffness = stiffness
} | [
0.6350588798522949,
-0.9645445346832275,
0.13875475525856018,
0.935461163520813,
-0.04571009799838066,
0.19973939657211304,
0.8143377304077148,
0.595069408416748,
-0.5338294506072998,
0.10524113476276398,
-0.9640005230903625,
-0.15220917761325836,
-0.8046520352363586,
1.1698238849639893,
... |
func (joint B2WheelJoint) GetStiffness() float64 {
return joint.M_stiffness
} | [
0.8468832969665527,
-0.8702589273452759,
0.12213282287120819,
0.9872221350669861,
-0.05482405796647072,
-0.07164645195007324,
0.8127190470695496,
0.18920862674713135,
-0.5849257707595825,
-0.2764994204044342,
-0.8043152093887329,
0.09858711063861847,
-1.2108906507492065,
0.7258644104003906... |
func skipSpace(s string) (rest string) {
i := 0
for ; i < len(s); i++ {
if b := s[i]; b != ' ' && b != '\t' {
break
}
}
return s[i:]
} | [
0.4247361421585083,
-0.21135619282722473,
0.39585933089256287,
-0.12112826853990555,
-0.4803558886051178,
0.2971165180206299,
0.39730751514434814,
-0.783947765827179,
0.3383174538612366,
0.48011940717697144,
0.46515315771102905,
-0.1406431496143341,
-0.3828026056289673,
-1.2070536613464355... |
func nextToken(s string) (token, rest string) {
i := 0
for ; i < len(s); i++ {
if !isTokenOctet[s[i]] {
break
}
}
return s[:i], s[i:]
} | [
0.12303542345762253,
-0.5184974074363708,
0.32261326909065247,
-0.09938996285200119,
-0.9937729239463806,
-0.2403387427330017,
-0.12765288352966309,
-0.21114830672740936,
0.26962926983833313,
0.03856056183576584,
-0.015789387747645378,
1.0893659591674805,
-0.14242857694625854,
-0.691308319... |
func equalASCIIFold(s, t string) bool {
for s != "" && t != "" {
sr, size := utf8.DecodeRuneInString(s)
s = s[size:]
tr, size := utf8.DecodeRuneInString(t)
t = t[size:]
if sr == tr {
continue
}
if 'A' <= sr && sr <= 'Z' {
sr = sr + 'a' - 'A'
}
if 'A' <= tr && tr <= 'Z' {
tr = tr... | [
0.6053211688995361,
-0.3636702001094818,
0.44911566376686096,
-0.9741083979606628,
-0.4196016490459442,
-0.44750234484672546,
-0.33908116817474365,
-0.26675352454185486,
-0.5484283566474915,
0.8232027888298035,
-0.902553379535675,
0.823297917842865,
0.05777865648269653,
-0.1515799611806869... |
func (s AgentConfigurationStatus) String() string {
return awsutil.Prettify(s)
} | [
0.4392947852611542,
-0.6285121440887451,
0.009398993104696274,
-0.5930830836296082,
-0.7641639113426208,
0.5632920861244202,
0.12117362767457962,
-0.3544164299964905,
0.3544365167617798,
0.46704891324043274,
-0.022889459505677223,
-0.35295379161834717,
1.3060133457183838,
0.005160483065992... |
func (s AgentInfo) String() string {
return awsutil.Prettify(s)
} | [
1.117443323135376,
-1.2661290168762207,
0.12032943218946457,
-0.947969377040863,
-0.574124813079834,
0.7866115570068359,
-0.01163940317928791,
-0.9258965253829956,
-0.25080934166908264,
-0.358498215675354,
0.20128852128982544,
0.4275573790073395,
0.7866057753562927,
-0.22698628902435303,
... |
func (s AgentNetworkInfo) String() string {
return awsutil.Prettify(s)
} | [
1.1182035207748413,
-0.40971839427948,
0.05677884817123413,
-0.9328119158744812,
-0.209083691239357,
0.9848762154579163,
-0.127675861120224,
-1.4610934257507324,
-0.14558663964271545,
-0.4425850510597229,
0.14580689370632172,
-0.45969295501708984,
1.1695451736450195,
-0.2520272135734558,
... |
func (s BatchDeleteImportDataError) String() string {
return awsutil.Prettify(s)
} | [
0.49148547649383545,
-0.3870663046836853,
0.08149364590644836,
-0.34658098220825195,
-0.3866581320762634,
1.0505837202072144,
-0.19047817587852478,
-0.4842779338359833,
-0.13874658942222595,
0.5425789952278137,
0.1766778826713562,
1.5801997184753418,
0.3886910378932953,
-0.5570493936538696... |
func (s ConfigurationTag) String() string {
return awsutil.Prettify(s)
} | [
0.38700202107429504,
0.04019143432378769,
-0.03888433054089546,
-0.4832760989665985,
-0.3834705948829651,
-0.07284576445817947,
0.28221771121025085,
-0.5442700982093811,
-0.4925166964530945,
0.23597314953804016,
-0.3997155725955963,
-0.3002471923828125,
0.7420761585235596,
0.91142827272415... |
func (s ContinuousExportDescription) String() string {
return awsutil.Prettify(s)
} | [
1.4971452951431274,
-0.6475927829742432,
0.243000790476799,
-0.12791502475738525,
-0.7512707710266113,
0.9043101668357849,
0.41748183965682983,
-0.289666086435318,
-0.0693112313747406,
0.4152185618877411,
0.3647603690624237,
1.1475228071212769,
-0.158186137676239,
-0.7211238145828247,
1.... |
func (s CustomerAgentInfo) String() string {
return awsutil.Prettify(s)
} | [
1.3763326406478882,
-1.536528468132019,
0.08459241688251495,
-0.8470484018325806,
-0.9594982266426086,
0.6027370691299438,
0.20020082592964172,
-0.8214519023895264,
-0.07980147749185562,
-0.4620552062988281,
-0.3734661340713501,
0.10452862083911896,
0.7643743753433228,
-0.04117091745138168... |
func (s CustomerConnectorInfo) String() string {
return awsutil.Prettify(s)
} | [
0.47531822323799133,
-1.1145861148834229,
0.21795344352722168,
-0.5984498262405396,
-0.937868058681488,
0.24110284447669983,
0.03352651372551918,
-0.7777596712112427,
-0.48673227429389954,
-0.7771812677383423,
0.2209056317806244,
-0.1935235857963562,
0.523067057132721,
-0.08116771280765533... |
func (s ExportFilter) String() string {
return awsutil.Prettify(s)
} | [
-0.08023829013109207,
-0.21207526326179504,
0.06591896712779999,
-0.5380824208259583,
-1.1239134073257446,
0.10243381559848785,
0.2144388109445572,
-0.7139322757720947,
0.056308794766664505,
0.4928874373435974,
-0.01989314705133438,
1.502917766571045,
0.5225459933280945,
-0.532240152359008... |
func (s *ExportFilter) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ExportFilter"}
if s.Condition == nil {
invalidParams.Add(aws.NewErrParamRequired("Condition"))
}
if s.Name == nil {
invalidParams.Add(aws.NewErrParamRequired("Name"))
}
if s.Values == nil {
invalidParams.Add(aws.New... | [
-0.4476637542247772,
0.5658374428749084,
0.48086652159690857,
0.23155750334262848,
-0.5644214153289795,
-0.5238949656486511,
-0.6931312084197998,
-0.3196484446525574,
-0.3486464321613312,
0.612311601638794,
0.24777023494243622,
0.5697435736656189,
-0.4600892961025238,
1.0993714332580566,
... |
func (s ExportInfo) String() string {
return awsutil.Prettify(s)
} | [
0.7701035737991333,
-0.7472324371337891,
0.25386226177215576,
-0.49690788984298706,
-0.9956830739974976,
0.6221563816070557,
-0.022717202082276344,
-0.980802595615387,
-0.09043700993061066,
-0.18462586402893066,
0.3211822509765625,
0.5918904542922974,
0.6508845686912537,
-0.858447909355163... |
func (s Filter) String() string {
return awsutil.Prettify(s)
} | [
0.16747614741325378,
-0.43773937225341797,
-0.006706503685563803,
-0.595130205154419,
-0.9524412155151367,
0.2342042326927185,
0.593308687210083,
-0.5836086273193359,
-0.2329566925764084,
-0.06682438403367996,
-0.14600786566734314,
1.5760630369186401,
0.9259623885154724,
-0.388891458511352... |
func (s *Filter) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "Filter"}
if s.Condition == nil {
invalidParams.Add(aws.NewErrParamRequired("Condition"))
}
if s.Name == nil {
invalidParams.Add(aws.NewErrParamRequired("Name"))
}
if s.Values == nil {
invalidParams.Add(aws.NewErrParamRequ... | [
-0.2530687153339386,
-0.024656424298882484,
0.4611578583717346,
0.3235931396484375,
-0.2495870292186737,
-0.26579391956329346,
-0.7346606850624084,
-0.32473793625831604,
-0.7192208170890808,
0.2536417245864868,
0.3536564111709595,
0.7036412358283997,
-0.16129107773303986,
1.519246220588684... |
func (s ImportTask) String() string {
return awsutil.Prettify(s)
} | [
1.0332599878311157,
-0.5028215646743774,
0.2522643506526947,
-0.07868875563144684,
-0.9858825206756592,
0.8261196613311768,
0.3555198609828949,
-0.4532802104949951,
-0.09627685695886612,
0.7377474308013916,
-0.5356070399284363,
0.5961511731147766,
0.9615145325660706,
-0.33225271105766296,
... |
func (s ImportTaskFilter) String() string {
return awsutil.Prettify(s)
} | [
0.15786343812942505,
-0.16028833389282227,
0.10830728709697723,
-0.18536265194416046,
-1.044252872467041,
0.6298441886901855,
0.6596763730049133,
-0.5094219446182251,
-0.5252866744995117,
0.5628763437271118,
-0.26372030377388,
1.1737306118011475,
0.6307357549667358,
-0.23817726969718933,
... |
func (s *ImportTaskFilter) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ImportTaskFilter"}
if s.Values != nil && len(s.Values) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Values", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
} | [
-0.37883490324020386,
0.9224861264228821,
0.512437105178833,
0.4516534209251404,
-0.22730207443237305,
-0.20783917605876923,
0.01930338144302368,
-0.3117496371269226,
-0.7634972929954529,
0.3153548538684845,
0.2819155752658844,
0.12519723176956177,
-0.16682183742523193,
1.1421672105789185,... |
func (s NeighborConnectionDetail) String() string {
return awsutil.Prettify(s)
} | [
0.6285390257835388,
-0.4031539261341095,
0.10503319650888443,
-0.8165343403816223,
-0.583298921585083,
0.900856614112854,
0.04783422127366066,
-1.147796630859375,
-0.27464041113853455,
0.055569879710674286,
0.3478820025920868,
0.36589768528938293,
0.26979970932006836,
-0.088834747672081,
... |
func (s OrderByElement) String() string {
return awsutil.Prettify(s)
} | [
0.4022091329097748,
-0.27390843629837036,
0.13779199123382568,
0.4239971339702606,
-0.5993961691856384,
0.29234421253204346,
0.6362942457199097,
-1.2827421426773071,
-0.3907216787338257,
-0.04514360800385475,
0.25461187958717346,
0.43417370319366455,
0.516015350818634,
-0.3331645131111145,... |
func (s *OrderByElement) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "OrderByElement"}
if s.FieldName == nil {
invalidParams.Add(aws.NewErrParamRequired("FieldName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
} | [
-0.5473799705505371,
0.538547933101654,
0.5367950797080994,
0.8865702152252197,
0.3810105323791504,
-0.44751471281051636,
0.10798273235559464,
-0.4957587718963623,
-0.7356429696083069,
0.2440824657678604,
0.45934343338012695,
-0.27228376269340515,
-0.45857927203178406,
0.755450963973999,
... |
func (s Tag) String() string {
return awsutil.Prettify(s)
} | [
0.9061236381530762,
-0.38141173124313354,
-0.025085315108299255,
-0.6613766551017761,
-0.3960002362728119,
0.2507806420326233,
0.18902528285980225,
-0.7333535552024841,
-0.5272843837738037,
-0.35804352164268494,
-0.43864449858665466,
0.7258638143539429,
0.8695554137229919,
0.67136991024017... |
func (s *Tag) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "Tag"}
if s.Key == nil {
invalidParams.Add(aws.NewErrParamRequired("Key"))
}
if s.Value == nil {
invalidParams.Add(aws.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
} | [
-0.363039493560791,
-0.07342372834682465,
0.46755677461624146,
0.08331042528152466,
0.08425553888082504,
-0.2536173164844513,
-0.8421048521995544,
-0.311442494392395,
-1.0466605424880981,
0.5212530493736267,
0.43764567375183105,
0.14975567162036896,
-0.10699980705976486,
1.8671810626983643... |
func (s TagFilter) String() string {
return awsutil.Prettify(s)
} | [
0.40619584918022156,
-0.12369392812252045,
-0.06025432050228119,
-0.570091724395752,
-0.8567332029342651,
0.09443538635969162,
0.07440915703773499,
-0.9951072335243225,
-0.7437294721603394,
-0.10716573148965836,
-0.24852992594242096,
1.1334543228149414,
0.9525970220565796,
0.19395054876804... |
func (s *TagFilter) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "TagFilter"}
if s.Name == nil {
invalidParams.Add(aws.NewErrParamRequired("Name"))
}
if s.Values == nil {
invalidParams.Add(aws.NewErrParamRequired("Values"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
retu... | [
-0.31309688091278076,
0.40890684723854065,
0.16757920384407043,
0.0572480745613575,
-0.29061654210090637,
-0.45818910002708435,
-1.005008339881897,
-0.6733121871948242,
-1.2621259689331055,
-0.16525593400001526,
0.19969917833805084,
0.42365002632141113,
-0.06660571694374084,
1.671740055084... |
func addJoinAndMoveListener(client *ts3.Client) {
_, err := client.Exec(ts3.Command{
Command: "servernotifyregister",
Params: map[string][]string{
"event": []string{"channel"},
"id": []string{"0"},
},
})
if err != nil {
log.Fatal(err)
}
} | [
0.5022518038749695,
-0.10797256976366043,
0.6757833361625671,
0.18447035551071167,
0.9537128210067749,
0.6314361691474915,
-0.42970696091651917,
0.9578620195388794,
-0.6694120764732361,
0.6288291215896606,
-1.0557892322540283,
0.7287169694900513,
-0.633725106716156,
0.786881685256958,
0.... |
func Proverb(rhyme []string) []string {
parts := make([]string, 0, len(rhyme))
for i := 0; i < len(rhyme)-1; i++ {
parts = append(parts, fmt.Sprintf("For want of a %s the %s was lost.", rhyme[i], rhyme[i+1]))
}
if len(rhyme) > 0 {
parts = append(parts, fmt.Sprintf("And all for the want of a %s.", rhyme[0]))
... | [
-0.4536336362361908,
-0.39687448740005493,
0.7982262372970581,
-0.0480407290160656,
0.48080727458000183,
0.2981661856174469,
0.026017043739557266,
-0.8510867357254028,
0.8098698258399963,
0.347284197807312,
1.0137641429901123,
0.8320100903511047,
-0.8359290361404419,
1.119869351387024,
0... |
func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) {
// this method is based off
// https://github.com/google/go-github/blob/master/github/github.go:
// NewRequest as it's a very nice way of doing this
_, err := url.Parse(urlStr)
if err != nil {
return nil, err
}
// Th... | [
-0.3303207457065582,
-0.44479861855506897,
0.9267192482948303,
0.2675137519836426,
0.16783639788627625,
-0.8285456895828247,
-1.0712642669677734,
-0.22888092696666718,
0.0794496014714241,
-0.22659437358379364,
0.2677333950996399,
0.3824092447757721,
0.23635977506637573,
0.3511812388896942,... |
func (c *Client) Do(req *http.Request, respStr interface{}) (*http.Response, error) {
resp, err := c.Client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode > 299 || resp.StatusCode < 200 {
return nil, errors.New(fmt.Sprintf("http request failed, resp: %#v", resp))
}
// ... | [
0.10813574492931366,
-0.6640101075172424,
0.8463427424430847,
-0.009649382904171944,
0.07699349522590637,
-0.18139643967151642,
-0.7390777468681335,
-1.0863144397735596,
0.11552600562572479,
0.11941669881343842,
0.20293118059635162,
0.2390458881855011,
0.5409613251686096,
-0.42261555790901... |
func (o *DeleteCatalogsByIDSharedProductOptionsByIDValuesByIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 204:
result := NewDeleteCatalogsByIDSharedProductOptionsByIDValuesByIDNoContent()
if err := result.readResponse(respon... | [
-0.013340591453015804,
-0.7342488765716553,
0.5375121831893921,
0.5294215679168701,
0.4440229535102844,
-0.48994821310043335,
0.3499813675880432,
-0.17272205650806427,
0.5640174746513367,
0.20028218626976013,
0.27642640471458435,
-0.7008001208305359,
-0.5907347798347473,
-0.026377066969871... |
func NewDeleteCatalogsByIDSharedProductOptionsByIDValuesByIDNoContent() *DeleteCatalogsByIDSharedProductOptionsByIDValuesByIDNoContent {
return &DeleteCatalogsByIDSharedProductOptionsByIDValuesByIDNoContent{}
} | [
0.3625599145889282,
-0.3590936064720154,
0.216766819357872,
0.19190257787704468,
0.43671101331710815,
0.5461875796318054,
0.6757038831710815,
-0.9329286217689514,
0.4221455752849579,
-1.106008768081665,
-0.46096330881118774,
-0.8320249319076538,
0.2726075053215027,
0.07127095758914948,
0... |
func NewDeleteCatalogsByIDSharedProductOptionsByIDValuesByIDNotFound() *DeleteCatalogsByIDSharedProductOptionsByIDValuesByIDNotFound {
return &DeleteCatalogsByIDSharedProductOptionsByIDValuesByIDNotFound{}
} | [
0.4042218029499054,
-1.1976006031036377,
0.42319631576538086,
0.3577180504798889,
1.1069320440292358,
0.9406694173812866,
0.8079272508621216,
-0.1404789388179779,
0.43381914496421814,
-0.9187639355659485,
-0.5745542645454407,
-0.3410499393939972,
0.5213350653648376,
0.5018460154533386,
0... |
func NewClientStore() *ClientStore {
return &ClientStore{
data: make(map[string]oauth2.ClientInfo),
}
} | [
0.4447656571865082,
-1.3631025552749634,
-0.05551791936159134,
-0.36316001415252686,
-1.622859001159668,
-0.1544385403394699,
-1.0308046340942383,
-0.6181332468986511,
-0.34267866611480713,
-0.4376393258571625,
-0.01917109452188015,
0.5035431385040283,
-0.4030127227306366,
0.36435016989707... |
func (cs *ClientStore) GetByID(id string) (cli oauth2.ClientInfo, err error) {
cs.RLock()
defer cs.RUnlock()
if c, ok := cs.data[id]; ok {
cli = c
return
}
err = errors.New("not found")
return
} | [
0.4727316200733185,
-0.35877397656440735,
0.15165063738822937,
-0.3366818130016327,
-0.2305172085762024,
-0.03005192056298256,
0.22047452628612518,
-1.2627670764923096,
0.18871533870697021,
-0.19818314909934998,
-0.13653205335140228,
1.4698978662490845,
-0.17263412475585938,
-0.86114877462... |
func (cs *ClientStore) Set(id string, cli oauth2.ClientInfo) (err error) {
cs.Lock()
defer cs.Unlock()
cs.data[id] = cli
return
} | [
-0.39154037833213806,
-0.491237610578537,
-0.13535133004188538,
-0.7545633316040039,
0.12198925018310547,
0.606106162071228,
-0.544308602809906,
-1.1835530996322632,
-0.5066217184066772,
-0.2290920466184616,
-0.7512304782867432,
0.9972416162490845,
0.17895637452602386,
-0.5200691223144531,... |
func WriteRef(t testing.TB, cfg config.Cfg, repoPath string, ref git.ReferenceName, oid git.ObjectID) {
Exec(t, cfg, "-C", repoPath, "update-ref", ref.String(), oid.String())
} | [
0.062382351607084274,
-0.10518915951251984,
0.43676382303237915,
-0.5587419271469116,
1.1167312860488892,
0.025661703199148178,
0.35461437702178955,
-0.17002932727336884,
-0.18480372428894043,
0.9680832624435425,
-0.2376294881105423,
1.069246530532837,
-0.3893207609653473,
0.21830342710018... |
func Creature(card *match.Card, ctx *match.Context) {
// Clear conditions
if _, ok := ctx.Event.(*match.EndOfTurnStep); ok {
card.ClearConditions()
}
// Untap the card, add creature condition
if _, ok := ctx.Event.(*match.UntapStep); ok {
card.AddCondition(cnd.Creature, nil, nil)
if ctx.Match.IsPlayerTur... | [
0.005887228064239025,
-0.7216482758522034,
0.9047321081161499,
0.26180821657180786,
-0.04307946562767029,
-0.42376235127449036,
0.47207382321357727,
0.8187168836593628,
0.7216629385948181,
-0.2900470197200775,
0.0999029353260994,
-0.16747470200061798,
0.5621514320373535,
0.3997554183006286... |
func GetTransactionParticipants(stxnad *transactions.SignedTxnWithAD, includeInner bool, add func(address basics.Address)) {
txn := &stxnad.Txn
add(txn.Sender)
switch txn.Type {
case protocol.PaymentTx:
add(txn.Receiver)
// Close address is optional.
if !txn.CloseRemainderTo.IsZero() {
add(txn.CloseRemai... | [
0.2128026932477951,
-0.17472516000270844,
0.601931631565094,
-1.5645833015441895,
-0.3410409092903137,
-0.31634974479675293,
-0.332173228263855,
0.4584979712963104,
0.09734145551919937,
0.18787235021591187,
0.15423798561096191,
-0.46067461371421814,
-0.32817211747169495,
-0.324827671051025... |
func analyzeVisit(ast astNode, inObject bool, vars identifierSet) (identifierSet, error) {
var r identifierSet
return r, nil
} | [
-1.460936188697815,
-0.12196589261293411,
0.4388168752193451,
-0.5262760519981384,
-0.5768559575080872,
-0.7726876139640808,
0.5743853449821472,
0.038553714752197266,
0.1346796154975891,
0.0885683000087738,
0.232225701212883,
0.4165629744529724,
-0.06054988503456116,
-0.5474502444267273,
... |
func TestNakedSingles(t *testing.T) {
inputBoard := []byte(nakedSinglesParam)
b := NewBoard(inputBoard)
assert.NotEqual(t, '8', b.finalValue[5])
assert.NotEqual(t, '8', b.finalValue[11])
b.NakedSingles()
assert.Equal(t, '8', b.finalValue[5])
assert.Equal(t, '8', b.finalValue[11])
} | [
-0.9028517603874207,
1.3758000135421753,
0.42533284425735474,
0.09772744029760361,
0.4087086617946625,
0.8388766646385193,
0.5890589952468872,
-0.3634972870349884,
0.16081172227859497,
-0.5121973752975464,
-1.3665560483932495,
0.45216232538223267,
-0.7101501226425171,
0.9191657304763794,
... |
func TestNakedPairs(t *testing.T) {
inputBoard := []byte(nakedPairsParam)
b := NewBoard(inputBoard)
assert.True(t, b.candidates[64].Contains('C'))
assert.True(t, b.candidates[73].Contains('G'))
assert.True(t, b.candidates[78].Contains('B'))
assert.True(t, b.candidates[78].Contains('G'))
b.NakedPairs()
assert... | [
-0.7199624180793762,
0.5151479244232178,
0.6924310922622681,
-0.08698166906833649,
-0.5539807677268982,
1.2549645900726318,
1.0395978689193726,
-0.22763308882713318,
-0.04194791242480278,
-0.5165801644325256,
-0.4290432631969452,
0.039031561464071274,
-0.8825305104255676,
0.557730793952941... |
func TestPointingPairs(t *testing.T) {
inputBoard := []byte(pointingPairsParam)
b := NewBoard(inputBoard)
assert.True(t, b.candidates[18].Contains('1'))
assert.True(t, b.candidates[20].Contains('1'))
assert.True(t, b.candidates[32].Contains('2'))
assert.True(t, b.candidates[41].Contains('2'))
assert.True(t, b.... | [
-0.814450204372406,
0.06808579713106155,
1.0747485160827637,
0.3926560580730438,
-0.5979399085044861,
1.295745849609375,
1.2678455114364624,
0.8094885945320129,
-0.12290425598621368,
-0.05009561777114868,
0.16412070393562317,
-0.7782787680625916,
-1.3834933042526245,
-0.08786208927631378,
... |
func TestXWings(t *testing.T) {
inputBoard := []byte(xWingsParam)
b := NewBoard(inputBoard)
assert.True(t, b.candidates[1].Contains('4'))
assert.True(t, b.candidates[4].Contains('4'))
assert.True(t, b.candidates[10].Contains('4'))
assert.True(t, b.candidates[13].Contains('4'))
assert.True(t, b.candidates[46].Co... | [
0.29433315992355347,
0.11913558840751648,
0.8906813859939575,
0.11972138285636902,
-0.07181423157453537,
1.0201517343521118,
-0.12360808253288269,
-0.07782843708992004,
0.015545506030321121,
-0.8882362842559814,
-0.41616758704185486,
-0.2341870814561844,
-1.3419952392578125,
-0.04326019436... |
func TestHiddenPairs(t *testing.T) {
inputBoard := []byte(hiddenPairsParam)
b := NewBoard(inputBoard)
assert.True(t, b.candidates[44].Contains('6'))
b.HiddenPairs()
assert.True(t, !b.candidates[44].Contains('6'))
} | [
-0.17757052183151245,
0.8885347247123718,
0.4762779176235199,
0.24092768132686615,
-0.5988785028457642,
1.1118911504745483,
1.0273739099502563,
0.4281671345233917,
0.12450108677148819,
-0.7559704780578613,
-0.9132637977600098,
-0.46992212533950806,
-1.5950126647949219,
0.381341814994812,
... |
func Constructor() Codec {
return Codec{}
} | [
0.6006538271903992,
-1.2172949314117432,
0.11367952078580856,
0.47442013025283813,
-1.084197759628296,
-0.32469648122787476,
0.6670733690261841,
0.3562362790107727,
0.15738806128501892,
-1.8123115301132202,
-0.15931150317192078,
0.5519931316375732,
1.0256346464157104,
0.29251939058303833,
... |
func (c *Codec) serialize(root *TreeNode) string {
var q []*TreeNode
q = append(q, root)
var out []string
for len(q) != 0 {
for k := len(q); k > 0; k-- {
curr := q[0]
if curr != nil {
out = append(out, strconv.Itoa(curr.Val))
q = append(q, curr.Left, curr.Right)
} else {
out = append(out, "nu... | [
-0.027646120637655258,
-0.5974023342132568,
0.9107875823974609,
-0.6049787998199463,
-0.3267180919647217,
-0.7100048661231995,
-0.6727754473686218,
-0.5433171987533569,
0.18245205283164978,
0.565880537033081,
-0.3654334843158722,
0.8804157972335815,
-0.24346579611301422,
0.7867436408996582... |
func (c *Codec) deserialize(data string) *TreeNode {
if len(data) < 2 {
return nil
}
if data[0] != '[' && data[len(data)-1] != ']' {
return nil
}
data = data[1 : len(data)-1]
var nums []*int
for _, s := range strings.Split(data, ",") {
if s == "null" {
nums = append(nums, nil)
} else {
num, err :=... | [
0.6509366631507874,
-0.025395747274160385,
0.9704213738441467,
-0.7286454439163208,
-0.6153901219367981,
-1.3736222982406616,
-0.10102250427007675,
-0.09731373190879822,
0.5515684485435486,
-0.29965686798095703,
-0.5483365058898926,
0.8617945909500122,
-1.069126844406128,
0.146558985114097... |
func chooseDirection(elevState cost.AssignedOrderInformation, ID string, floor int) elevio.MotorDirection {
switch elevState.States[ID].Direction {
case "stop":
fallthrough
case "down":
if ordersBelow(elevState, ID, floor) {
return elevio.MD_Down
} else if ordersAbove(elevState, ID, floor) {
return elevi... | [
-0.23679809272289276,
-0.5301147699356079,
0.6752681136131287,
0.4556402564048767,
-0.27987679839134216,
0.13661068677902222,
0.0644410103559494,
-0.38082218170166016,
-0.10766857117414474,
-0.054289694875478745,
0.5201555490493774,
-0.3721572160720825,
0.3022460341453552,
0.33912488818168... |
func ordersBelow(elevState cost.AssignedOrderInformation, ID string, reachedFloor int) bool {
for floor := 0; floor < reachedFloor; floor++ {
if elevState.States[ID].CabRequests[floor] {
return true
}
for button := 0; button < 2; button++ {
if elevState.AssignedOrders[ID][floor][button] {
return true
... | [
-0.4692309498786926,
-0.07988335192203522,
0.6965248584747314,
0.39325061440467834,
-0.027488572522997856,
0.2881091237068176,
-0.34055227041244507,
-1.1927450895309448,
-0.3113326132297516,
-0.3756212294101715,
-0.39310476183891296,
-0.0727647989988327,
0.06394509226083755,
0.639044940471... |
func ordersAbove(elevState cost.AssignedOrderInformation, ID string, reachedFloor int) bool {
for floor := reachedFloor + 1; floor < FLOORS; floor++ {
if elevState.States[ID].CabRequests[floor] {
return true
}
for button := 0; button < 2; button++ {
if elevState.AssignedOrders[ID][floor][button] {
retu... | [
-1.2375811338424683,
0.051695454865694046,
0.8616869449615479,
0.4251287877559662,
0.01797064021229744,
0.2347361445426941,
-0.331760048866272,
-0.6536855101585388,
-0.6563518047332764,
0.4169357419013977,
-0.521396815776825,
-0.6384774446487427,
-0.11963186413049698,
0.675163745880127,
... |
func shouldElevStop(elevState cost.AssignedOrderInformation, ID string, floor int) bool {
switch elevState.States[ID].Direction {
case "down":
return (elevState.AssignedOrders[ID][floor][elevio.BT_HallDown] ||
elevState.States[ID].CabRequests[floor] ||
!ordersBelow(elevState, ID, floor))
case "up":
return ... | [
-0.9811120629310608,
0.13076665997505188,
0.744507372379303,
0.035478733479976654,
-0.597876250743866,
0.8364280462265015,
-0.7530333399772644,
-0.2500019371509552,
0.3122433125972748,
0.17595797777175903,
0.21329118311405182,
-0.6523865461349487,
0.5591239929199219,
0.396481990814209,
-... |
func clearAtFloor(elevState cost.AssignedOrderInformation, ID string, floor int, ch_network_update chan<- backup.UpdateMessage) bool {
// For cab requests
cleared := false
update := backup.UpdateMessage{
MessageType: 0,
Floor: floor,
Button: 2,
Behaviour: elevState.States[ID].Behaviour... | [
-0.4885871708393097,
-0.17616485059261322,
1.0081570148468018,
-0.06688423454761505,
-0.13620448112487793,
0.5872226357460022,
-0.2748531699180603,
-0.9149717092514038,
-0.0993620827794075,
0.7974423766136169,
-0.04422987252473831,
-0.6222108602523804,
0.19091467559337616,
0.77497965097427... |
func setAllLights(elevState cost.AssignedOrderInformation, ID string) {
for floor := 0; floor < FLOORS; floor++ {
elevio.SetButtonLamp(elevio.BT_Cab, floor, elevState.States[ID].CabRequests[floor])
for button := elevio.BT_HallUp; button < elevio.BT_Cab; button++ {
elevio.SetButtonLamp(button, floor, elevState.H... | [
-0.198343425989151,
0.22031690180301666,
0.751837432384491,
0.8359163999557495,
-0.35486647486686707,
0.16716870665550232,
-0.4291191101074219,
0.27462026476860046,
0.8161858320236206,
-0.21281546354293823,
-0.6117178201675415,
-0.2054022252559662,
0.7453850507736206,
1.6217381954193115,
... |
func TestLogCollectorPodListError(t *testing.T) {
context := context.Background()
logBuffer := bytes.Buffer{}
tarBuffer := bytes.Buffer{}
supportArchive := tarball{
tarWriter: tar.NewWriter(&tarBuffer),
}
defer supportArchive.tarWriter.Close()
mockedPods := corev1mocks.NewPodInterface(t)
mockedPods.EXPECT().... | [
-0.18171779811382294,
-0.23996500670909882,
0.44289180636405945,
-0.46751993894577026,
0.7794128656387329,
0.6654753684997559,
-0.5874943733215332,
-0.4334261417388916,
0.1520984172821045,
-0.1274588257074356,
-0.6896259188652039,
-0.5690025091171265,
-0.0101851187646389,
0.291524618864059... |
func (t *Template) GetSubject(name string) (string, error) {
var buf bytes.Buffer
var data = map[string]string{
"name": name,
}
if t.template == nil {
t.template = template.New("subject")
t.template.Parse(t.Subject)
}
var err = t.template.Execute(&buf, data)
return buf.String(), err
} | [
-0.0006992770358920097,
0.49004313349723816,
0.6368674635887146,
-0.1901167929172516,
-1.1269137859344482,
-0.6554673314094543,
0.042884789407253265,
-0.8626417517662048,
-0.681147575378418,
-0.02115653082728386,
-0.8049713373184204,
-0.09570182114839554,
-0.20064856112003326,
-0.412101387... |
func Repeat(char string, count int) string {
var result string = ""
for i := 0; i < count; i++ {
result += char
}
return result
} | [
-0.1054362803697586,
-0.0019007265800610185,
0.48223525285720825,
-0.3164514899253845,
-0.36073097586631775,
-0.06812994927167892,
-0.07646633684635162,
-0.6571545600891113,
-1.446353554725647,
-0.0666801705956459,
-0.4125131666660309,
0.20898941159248352,
-0.593110203742981,
-1.5379247665... |
func queryEscape(value string) string {
return url.QueryEscape(value)
} | [
-0.3368716239929199,
0.7109219431877136,
0.20268867909908295,
0.38056859374046326,
-0.35926786065101624,
-0.3662455976009369,
-1.1050777435302734,
-1.0573593378067017,
0.2566147744655609,
0.3865135610103607,
0.07524396479129791,
-0.020104655995965004,
0.09385982900857925,
-0.23264230787754... |
func (client *Client) GetArmsConsoleUrl(request *GetArmsConsoleUrlRequest) (response *GetArmsConsoleUrlResponse, err error) {
response = CreateGetArmsConsoleUrlResponse()
err = client.DoAction(request, response)
return
} | [
-0.027030881494283676,
0.1595928966999054,
0.6437205076217651,
0.13166074454784393,
0.8001558184623718,
-0.22480663657188416,
0.08540550619363785,
-0.6329484581947327,
-0.7148874998092651,
0.3883897066116333,
-0.2142273485660553,
0.8343818783760071,
0.46723073720932007,
-0.8064696788787842... |
func (client *Client) GetArmsConsoleUrlWithChan(request *GetArmsConsoleUrlRequest) (<-chan *GetArmsConsoleUrlResponse, <-chan error) {
responseChan := make(chan *GetArmsConsoleUrlResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
respo... | [
-0.09804905205965042,
-0.5002384781837463,
0.6492632627487183,
-0.29125872254371643,
0.7415134906768799,
0.1711098998785019,
0.0028934625443071127,
-1.1513733863830566,
-0.3968137800693512,
0.1451583206653595,
0.2186976969242096,
0.899269163608551,
0.4826842248439789,
-0.17797274887561798,... |
func (client *Client) GetArmsConsoleUrlWithCallback(request *GetArmsConsoleUrlRequest, callback func(response *GetArmsConsoleUrlResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *GetArmsConsoleUrlResponse
var err error
defer close(result)
response,... | [
0.2752908170223236,
0.0039685009978711605,
0.727286159992218,
-0.02793661132454872,
0.6438016891479492,
-0.21099215745925903,
0.03933500871062279,
-1.0846459865570068,
-0.09250307828187943,
0.17880025506019592,
0.26787447929382324,
-0.10811910778284073,
0.8894894123077393,
-0.3398060500621... |
func CreateGetArmsConsoleUrlRequest() (request *GetArmsConsoleUrlRequest) {
request = &GetArmsConsoleUrlRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("ARMS", "2019-08-08", "GetArmsConsoleUrl", "arms", "openAPI")
request.Method = requests.GET
return
} | [
0.2782200872898102,
-0.4291495382785797,
0.3164094388484955,
-0.29219603538513184,
1.0012620687484741,
0.1365104466676712,
-0.5400317311286926,
-0.7939620018005371,
-0.7719155550003052,
-0.37063291668891907,
0.2396899312734604,
0.9526850581169128,
0.3407667279243469,
0.13485409319400787,
... |
func CreateGetArmsConsoleUrlResponse() (response *GetArmsConsoleUrlResponse) {
response = &GetArmsConsoleUrlResponse{
BaseResponse: &responses.BaseResponse{},
}
return
} | [
0.39410892128944397,
-1.0301445722579956,
0.2647469937801361,
-0.22167380154132843,
1.063053011894226,
-0.07850140333175659,
0.08758392184972763,
-1.1502140760421753,
-0.18840140104293823,
-0.043376751244068146,
-0.3606574535369873,
-0.5332194566726685,
0.05150604620575905,
-0.062773518264... |
func (p *Poet) Sanitize() {
// for now do nothing...
} | [
0.043298013508319855,
-0.22830909490585327,
0.2772282660007477,
0.0714639350771904,
0.5388391017913818,
0.037910256534814835,
0.6280325055122375,
-0.06097814440727234,
-0.34081438183784485,
-0.7961031198501587,
-0.013151939027011395,
0.3568817973136902,
-1.4937026500701904,
0.1980741769075... |
func (p *Poet) CheckRequiredFields(params PoetValidationParams) error {
// we already know that the Id field is valid
// designer must be provided AND match the given validation parameter
if p.Designer == nil || p.Designer.Id != params.DesignerId {
return fmt.Errorf("Invalid poet designer provided")
}
// ensur... | [
-0.6923398971557617,
0.08449101448059082,
0.42406803369522095,
-0.47218847274780273,
-0.6125490665435791,
0.41064557433128357,
0.05881904438138008,
-0.20338039100170135,
-0.17510315775871277,
0.26106593012809753,
-0.3183770179748535,
0.11077861487865448,
-1.288194179534912,
0.8384689092636... |
func (p *Poet) Create(db *sql.DB) error {
var (
err error
)
// assume id is already assigned
// set birthday
p.BirthDate = time.Now().Truncate(time.Millisecond)
// prepare statement if not already done so.
if poetCreateStmt == nil {
// create statement
stmt := `INSERT INTO poets (
... | [
-0.5220221877098083,
0.17434196174144745,
0.5430035591125488,
0.062061406672000885,
0.05083026736974716,
0.533097505569458,
0.5037258267402649,
-0.14637431502342224,
-0.7872416973114014,
0.012776724994182587,
-0.06155179440975189,
-0.6601576209068298,
-0.48665890097618103,
0.85331493616104... |
func (p *Poet) Delete(db *sql.DB) error {
var (
poems int
err error
)
// assume that we delete the poet directory within the caller scope
if countPoetPoemsStmt == nil {
stmt := `SELECT COUNT(*) FROM poems p WHERE p.author = $1`
countPoetPoemsStmt, err = db.Prepare(stmt)
if err != nil {
return err
... | [
0.004045953042805195,
0.2614872455596924,
0.7135392427444458,
-0.11096008121967316,
-0.028370508924126625,
0.07557983696460724,
0.6321765780448914,
1.008671760559082,
0.03789912164211273,
0.07875474542379379,
0.4875872731208801,
-0.3107750713825226,
-0.12068498879671097,
0.5640270709991455... |
func (p *Poet) setupExecutionSandbox() (*xaqt.Context, xaqt.Code, error) {
var (
ctx *xaqt.Context
code xaqt.Code
err error
)
if p.ExecContext == nil {
return nil, code, fmt.Errorf("developer error! exec context not set for poet %s", p.Id)
}
// setup execution context
ctx, err = xaqt.NewContext(
xaq... | [
-0.26887303590774536,
-0.44889435172080994,
0.7750561833381653,
-0.47870656847953796,
0.3030634820461273,
-0.02282797172665596,
0.5235831141471863,
-0.3621579706668854,
0.43173179030418396,
-0.29099181294441223,
0.2714845836162567,
0.10689996182918549,
0.1256140172481537,
0.534161150455474... |
func CheckIfJobAlive(reqID string) bool {
ans, err := GetJob(reqID)
if err != nil {
return false
}
req := ans.ReqTime
ttl := ans.TTL
if req.Add(time.Duration(ttl)*time.Second).After(time.Now()) == true {
return true
}
return false
} | [
-0.007766708731651306,
-0.5073466897010803,
0.9818837642669678,
0.5223709344863892,
-0.8493772149085999,
0.13195055723190308,
-1.478765606880188,
-0.05863079056143761,
-0.5831449627876282,
0.4729040265083313,
0.17818979918956757,
0.2331244796514511,
-0.14054502546787262,
0.77833491563797,
... |
func GetSolution(src, dst string) ([]string, error) {
ans, err := cache.GetString("SOLUTION:" + src + ":" + dst)
if err != nil {
return nil, fmt.Errorf("solution not found: %v", err)
}
return strings.Split(ans, "|"), nil
} | [
-1.01263427734375,
0.13452771306037903,
0.7038263082504272,
0.513512134552002,
0.4356169104576111,
-0.783015251159668,
-0.6930620670318604,
-0.30718308687210083,
-0.6825902462005615,
0.8838222026824951,
-0.8215649127960205,
0.28217992186546326,
0.4535536468029022,
0.5442864298820496,
0.5... |
func SetSolution(path []string) error {
for i := 0; i < len(path)-1; i++ {
err := cache.SetString("SOLUTION:"+path[i]+":"+path[len(path)-1], strings.Join(path[i:], "|"))
if err != nil {
return err
}
}
return nil
} | [
-1.0958266258239746,
-0.30901798605918884,
0.5859915018081665,
0.44082337617874146,
0.4461255371570587,
-0.20680220425128937,
0.18762432038784027,
-0.4448234736919403,
-0.8483437299728394,
0.7014333009719849,
-0.9468424320220947,
-0.5838209390640259,
0.4457972049713135,
0.9261776208877563,... |
func SetJobState(reqID string, state string) error {
j, err := GetJob(reqID)
if err != nil {
return err
}
j.State = state
j.Latency = time.Now()
return SetJob(j)
} | [
-0.023788176476955414,
-0.2983350455760956,
0.5011669397354126,
0.35839927196502686,
-0.23005208373069763,
0.38932687044143677,
-1.2181278467178345,
0.2459486573934555,
0.028720278292894363,
0.06603242456912994,
-0.485818475484848,
0.9407694339752197,
-0.6115363240242004,
0.681852400302887... |
func CheckIfJobSolved(reqID string) bool {
j, err := GetJob(reqID)
if err != nil {
return false
}
if j.State == "SOLVED" || j.State == "SOLVED_FROM_CACHE" {
return true
}
return false
} | [
-0.42665162682533264,
0.09258074313402176,
0.432577908039093,
0.6881380677223206,
0.10215315967798233,
-0.17657539248466492,
-0.5094783902168274,
-0.3966169059276581,
0.253225713968277,
-0.5967318415641785,
-0.234110489487648,
0.026344671845436096,
-0.2455461472272873,
1.1558009386062622,
... |
func BubbleSort(sequence []int) {
for upperIndex := len(sequence) - 1; upperIndex > 0; upperIndex-- {
for runningIndex := 0; runningIndex < upperIndex; runningIndex++ {
if sequence[runningIndex] > sequence[runningIndex+1] {
Swap(sequence, runningIndex)
}
}
}
} | [
-1.4731898307800293,
-0.4185664653778076,
0.7100337743759155,
-0.48872533440589905,
-0.7952157258987427,
0.40342891216278076,
1.2507469654083252,
-0.063217394053936,
0.13881972432136536,
0.11479398608207703,
-0.7932167649269104,
1.2093861103057861,
-1.4236644506454468,
0.3425627648830414,
... |
func Swap(sequence []int, swapAt int) {
temp := sequence[swapAt]
sequence[swapAt] = sequence[swapAt+1]
sequence[swapAt+1] = temp
} | [
-2.3366124629974365,
-0.5448871850967407,
0.41182878613471985,
-0.8651708960533142,
-0.7616207003593445,
0.18356618285179138,
-0.19763903319835663,
0.5950369238853455,
0.4517911374568939,
-0.03672471269965172,
-1.1667475700378418,
0.3367559015750885,
0.5087457299232483,
-0.2732246816158294... |
func AskForInput() (string, error) {
fmt.Println("\nEnter a sequence of integers, divided by spaces.")
fmt.Print(">> ")
scanner := bufio.NewScanner(os.Stdin)
scanner.Scan()
fmt.Println()
return scanner.Text(), scanner.Err()
} | [
-0.0383860245347023,
0.32554924488067627,
0.5273192524909973,
-0.28513771295547485,
-0.9518482089042664,
0.3790195882320404,
0.8229901194572449,
-0.2753322124481201,
-0.3386354148387909,
-0.5051748752593994,
-0.029516616836190224,
0.3116835355758667,
-0.3616560995578766,
0.3280979096889496... |
func ParseInput(inputLine string) ([]int, error) {
sizeLimit := 10
parsedSequence := make([]int, 0, sizeLimit)
splitLine := strings.Fields(inputLine)
for i, v := range splitLine {
if i == sizeLimit {
fmt.Printf("(!) Sequence size is limited to %d, last %d element(s) are ignored.\n\n",
sizeLimit, len(spli... | [
-0.507500946521759,
-0.17817296087741852,
0.9299769997596741,
-0.25606855750083923,
-0.3458414673805237,
-0.025645583868026733,
0.48544713854789734,
0.9272926449775696,
0.2855684757232666,
-0.3689090311527252,
-0.7883098721504211,
0.07032223045825958,
-0.6760863065719604,
-0.17259535193443... |
func (b *Block) SetDelay() {
b.Delay = time.Duration(int64(math.Round(b.Delay.Seconds()*(1.0+math.Sqrt(5.0))/2))%3600) * time.Second
} | [
0.8705048561096191,
0.019646907225251198,
0.4711209535598755,
0.9466680884361267,
-0.5331474542617798,
0.2702145576477051,
0.40570205450057983,
-0.37601983547210693,
-0.4978489875793457,
-0.6069594621658325,
-0.8601555228233337,
0.45445525646209717,
-0.17412690818309784,
0.9689821004867554... |
func (b *Block) ResetDelay() {
b.Delay = time.Duration(1) * time.Second
} | [
1.0411593914031982,
0.16828374564647675,
0.5457369089126587,
1.309302568435669,
0.1606813371181488,
0.021736064925789833,
0.5597878098487854,
0.36644595861434937,
-0.5060047507286072,
-0.5351004004478455,
-0.6239035129547119,
0.7510245442390442,
-0.5955883860588074,
0.5328600406646729,
0... |
func (b *Block) SetLastAttempted() {
b.LastAttempted = time.Now().UTC()
} | [
-0.054872773587703705,
-0.7103220820426941,
0.6621149778366089,
-1.5427943468093872,
0.03679489344358444,
0.21571220457553864,
0.5881467461585999,
0.0008822903037071228,
-0.5198383331298828,
0.7737336754798889,
-0.8270308375358582,
0.18212029337882996,
-0.21140117943286896,
0.4060927331447... |
func (b *Block) CanAttempt() bool {
return time.Now().UTC().After(b.LastAttempted.Add(b.Delay))
} | [
0.0894407257437706,
-0.15009894967079163,
0.6341664791107178,
-0.2575976848602295,
-1.2888597249984741,
0.398039311170578,
0.6370945572853088,
0.5697358846664429,
-0.8960018754005432,
0.805009663105011,
0.05697246268391609,
0.3398357331752777,
-0.39326196908950806,
0.6632503271102905,
-0... |
func New(startingWith uint64) *BlockProcessorQueue {
return &BlockProcessorQueue{
Blocks: make(map[uint64]*Block),
StartedWith: startingWith,
TotalInserted: 0,
LatestBlock: 0,
Total: 0,
PutChan: make(chan Request, 128),
CanPublishC... | [
-0.4660840928554535,
-0.8480567336082458,
0.41879814863204956,
-0.4291495680809021,
-0.8038696646690369,
-0.7561299800872803,
-0.0681755468249321,
-0.4137330651283264,
-0.491171270608902,
0.392204612493515,
-0.16642753779888153,
0.5338522791862488,
-0.44837990403175354,
1.0058568716049194,... |
func (b *BlockProcessorQueue) Put(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.PutChan <- req
return <-resp
} | [
-1.218216896057129,
0.980016827583313,
0.664490282535553,
-0.9396646618843079,
-0.16350872814655304,
0.036921873688697815,
0.2816687226295471,
-0.45163533091545105,
-0.07834349572658539,
0.5868356823921204,
-0.9193437695503235,
0.05779939517378807,
-1.6189746856689453,
0.5334720611572266,
... |
func (b *BlockProcessorQueue) CanPublish(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.CanPublishChan <- req
return <-resp
} | [
-0.3537874221801758,
-0.4603296220302582,
0.5241634845733643,
0.32054898142814636,
-1.068763017654419,
-0.16969509422779083,
0.1031118705868721,
0.5634746551513672,
-0.1973744034767151,
0.17710454761981964,
-0.1069626659154892,
0.34665951132774353,
-0.998329222202301,
1.2853350639343262,
... |
func (b *BlockProcessorQueue) Published(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.PublishedChan <- req
return <-resp
} | [
-0.7406725287437439,
0.18248939514160156,
0.6931532621383667,
0.14729797840118408,
-0.3804006576538086,
-0.09998539835214615,
-0.1616821438074112,
-0.1446608155965805,
-0.016419487074017525,
-0.5253357887268066,
-1.0115509033203125,
0.28443068265914917,
-0.6305684447288513,
1.0689213275909... |
func (b *BlockProcessorQueue) Inserted(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.InsertedChan <- req
return <-resp
} | [
-0.5147435069084167,
0.8951376080513,
0.772151529788971,
-0.6625844240188599,
0.39015993475914,
-0.05494401603937149,
0.12710097432136536,
-0.13971589505672455,
0.08531394600868225,
-0.15687966346740723,
-1.277722716331482,
0.03552958369255066,
-1.2711111307144165,
0.9629284739494324,
0.... |
func (b *BlockProcessorQueue) UnconfirmedFailed(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.UnconfirmedFailedChan <- req
return <-resp
} | [
-0.7545099854469299,
0.5048263669013977,
0.5133679509162903,
-0.5825487375259399,
-0.22085252404212952,
-0.6926326751708984,
-0.014171828515827656,
-0.19725696742534637,
-0.26274412870407104,
-0.7841746211051941,
-0.5491436123847961,
0.3582111895084381,
-0.1686181128025055,
1.0533355474472... |
func (b *BlockProcessorQueue) UnconfirmedDone(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.UnconfirmedDoneChan <- req
return <-resp
} | [
-0.4689519703388214,
0.611003577709198,
0.6640551686286926,
0.07719734311103821,
0.23958109319210052,
-0.31366801261901855,
-0.0013127392157912254,
-0.31788870692253113,
-0.9324232339859009,
-0.46949923038482666,
-0.30324721336364746,
0.1185552105307579,
-0.28486260771751404,
1.66552376747... |
func (b *BlockProcessorQueue) ConfirmedFailed(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.ConfirmedFailedChan <- req
return <-resp
} | [
-0.8134139776229858,
0.440032958984375,
0.5105145573616028,
0.24104635417461395,
-0.049965180456638336,
-0.35025647282600403,
0.0328783318400383,
-0.6504345536231995,
0.3129620850086212,
-0.3248259425163269,
-0.908938467502594,
0.14446371793746948,
-0.8476729989051819,
1.2760686874389648,
... |
func (b *BlockProcessorQueue) ConfirmedDone(block uint64) bool {
resp := make(chan bool)
req := Request{
BlockNumber: block,
ResponseChan: resp,
}
b.ConfirmedDoneChan <- req
return <-resp
} | [
-0.48556751012802124,
0.7117218375205994,
0.7604535222053528,
0.8498740196228027,
0.4369608461856842,
0.016890529543161392,
-0.11127231270074844,
-0.7854249477386475,
-0.2614859938621521,
-0.06087234243750572,
-0.6604703068733215,
-0.2143501341342926,
-0.865991473197937,
1.553053617477417,... |
func (b *BlockProcessorQueue) Stat() StatResponse {
resp := make(chan StatResponse)
req := Stat{ResponseChan: resp}
b.StatChan <- req
return <-resp
} | [
-0.30535563826560974,
-0.7121523022651672,
0.4382149577140808,
-0.7048051953315735,
0.6265698075294495,
-1.149552583694458,
0.26356613636016846,
-1.035892367362976,
0.411787748336792,
-0.38663768768310547,
-0.4707425832748413,
0.47436052560806274,
-0.8608236312866211,
1.2510467767715454,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.