text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (a *User) Equals(b *User) bool { return a.Id == b.Id && a.GUID == b.GUID && a.HashedSecret == b.HashedSecret && a.OrcId == b.OrcId }
[ -0.05983757972717285, -1.1115182638168335, 0.37932807207107544, 0.1522897332906723, 0.8020010590553284, 0.2411150336265564, -0.39227235317230225, -0.5642977952957153, -0.004979535471647978, -0.5835879445075989, -1.0090301036834717, 0.8677177429199219, -0.3302854895591736, -0.54948371648788...
func NewUserWithSecret(secret string) (u User, err error) { // Compute hash for salted secret. hash, err := bcrypt.GenerateFromPassword([]byte(secret), bcrypt.DefaultCost) if err != nil { err = fmt.Errorf("Could not compute salted password hash. %s", err) return } // Create fresh, unused GUID, assuming that ...
[ 0.8351258635520935, -0.18834683299064636, 0.33409011363983154, 0.02799260802567005, -0.2498549073934555, -0.26530787348747253, -0.7347577810287476, -1.013738989830017, 0.40529942512512207, -0.1530250608921051, -1.2585400342941284, -0.416751503944397, 0.28984108567237854, 0.2652167379856109...
func IsTheSameObject(obj, compared corev1.ObjectReference) bool { return obj.APIVersion == compared.APIVersion && obj.Kind == compared.Kind && obj.Name == compared.Name && obj.Namespace == compared.Namespace }
[ -0.783579409122467, -1.4310855865478516, 0.7367479205131531, -0.4365093410015106, 0.33927348256111145, 0.6297750473022461, -0.2920345067977905, -1.053592562675476, 0.9229347109794617, 0.52218097448349, -0.8902300000190735, 1.0839884281158447, -0.6414504647254944, -0.22603638470172882, -0...
func IsTheSameObjectReference(obj, compared *corev1.ObjectReference) bool { if (obj == nil && compared != nil) || (obj != nil && compared == nil) { return false } return (obj == nil && compared == nil) || (obj != nil && IsTheSameObject(*obj, *compared)) }
[ -0.7805973887443542, -0.675179660320282, 0.7774654030799866, 0.07297787070274353, 0.37993595004081726, -0.17535030841827393, 0.22033779323101044, -0.3868865966796875, 0.9950904846191406, 0.6320216059684753, -0.31419163942337036, 0.4593830406665802, -0.7312959432601929, 0.5234895944595337, ...
func GetObjectReferenceFromObject(obj metav1.Object, opts ...ObjectRefOptionsFunc) (ref corev1.ObjectReference) { ref.Name = obj.GetName() for _, o := range opts { o(obj, &ref) } return }
[ -0.25234338641166687, -0.09541162848472595, 0.4814830720424652, 0.1164068952202797, 0.13428053259849548, -0.2346811294555664, 0.0580589659512043, -0.643678605556488, 0.370004802942276, 0.34435927867889404, -0.44948920607566833, 0.8504353761672974, 0.39650726318359375, -0.4353293478488922, ...
func GetNamespacedNameFromRef(ref *corev1.ObjectReference) (named types.NamespacedName) { if ref != nil { named.Name = ref.Name named.Namespace = ref.Namespace } return }
[ 0.7532494068145752, -0.4798925220966339, 0.41895514726638794, -0.633381724357605, -0.8852896690368652, 0.5853972434997559, -0.5034563541412354, -0.8055547475814819, 1.3876593112945557, 0.25719591975212097, 0.16755682229995728, 0.4886053204536438, -0.09444934129714966, 1.6370353698730469, ...
func (gb *Gameboy) ExecuteNextOpcode() int { opcode := gb.popPC() gb.thisCpuTicks = OpcodeCycles[opcode] * 4 gb.mainInst[opcode]() return gb.thisCpuTicks }
[ -0.548620343208313, 0.22300636768341064, 0.6478744149208069, 0.3334744870662689, -0.6141602396965027, -0.5655428171157837, 0.4967609941959381, -0.39201608300209045, -0.6262832283973694, 0.9269624352455139, -0.04447610676288605, -0.5024126172065735, -1.284292221069336, -0.07409434765577316,...
func (gb *Gameboy) popPC() byte { opcode := gb.Memory.Read(gb.CPU.PC) gb.CPU.PC++ return opcode }
[ 0.6027867794036865, 0.2059585452079773, 0.8812418580055237, 0.002682092599570751, -0.8953652381896973, 0.42245370149612427, 0.436377614736557, -0.872657299041748, -0.2546616792678833, 1.2414754629135132, 0.6267555952072144, -0.6076247692108154, -1.3646129369735718, -1.0632582902908325, 0...
func (gb *Gameboy) popPC16() uint16 { b1 := uint16(gb.popPC()) b2 := uint16(gb.popPC()) return b2<<8 | b1 }
[ 0.7539921402931213, 0.03462111949920654, 0.6778138279914856, -0.35069558024406433, -0.38307979702949524, 0.5416033864021301, -0.3093417286872864, -1.065015196800232, -0.5270971655845642, 1.0550158023834229, -0.0735490545630455, -0.39250659942626953, -1.5331624746322632, -0.411865770816803,...
func (gb *Gameboy) mainInstructions() [0x100]func() { // TODO: possibly faster if we derefernce // each register and gb methods in this scope // ret gets returned ret := [0x100]func(){ 0x06: func() { // LD B, n gb.CPU.BC.SetHi(gb.popPC()) }, 0x0E: func() { // LD C, n gb.CPU.BC.SetLo(gb.popPC()) ...
[ -0.0693124309182167, 0.3936738669872284, 1.0578211545944214, 0.2660481631755829, -0.3021552264690399, 0.17812703549861908, 0.9314106106758118, -0.26107826828956604, -0.07295005768537521, -0.00858047604560852, -0.3270052671432495, -0.839282751083374, -0.5207909345626831, 0.48348468542099, ...
func NewTriggerAndScopeBasedConditions()(*TriggerAndScopeBasedConditions) { m := &TriggerAndScopeBasedConditions{ WorkflowExecutionConditions: *NewWorkflowExecutionConditions(), } odataTypeValue := "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions" m.SetOdataType(&odataTypeValu...
[ -0.21245059370994568, -0.45558759570121765, -0.17179308831691742, 0.24869127571582794, 0.0610845722258091, -0.818426251411438, 0.31593066453933716, -0.34023088216781616, -0.00098230445291847, 0.16560201346874237, -0.6224601864814758, 0.1925273984670639, -0.43147674202919006, 0.914945244789...
func CreateTriggerAndScopeBasedConditionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewTriggerAndScopeBasedConditions(), nil }
[ 0.6107227206230164, -0.3921166658401489, 0.29646968841552734, -0.1106448546051979, -0.4880940020084381, -0.19554831087589264, 0.4910661280155182, 0.10965307056903839, 0.126581609249115, -0.4507260322570801, -0.2480451613664627, -0.06774821877479553, 0.2413947433233261, 0.7091711759567261, ...
func (m *TriggerAndScopeBasedConditions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := m.WorkflowExecutionConditions.GetFieldDeserializers() res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be14522...
[ 0.4943779706954956, 0.18061351776123047, 0.3344598412513733, -0.6090793013572693, -0.040217529982328415, -0.6734012365341187, 0.6494882106781006, -0.07765067368745804, -0.9136615991592407, -0.5514956116676331, -0.5643348693847656, 0.27284857630729675, -0.9545278549194336, 0.248600021004676...
func (m *TriggerAndScopeBasedConditions) GetScope()(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.SubjectSetable) { val, err := m.GetBackingStore().Get("scope") if err != nil { panic(err) } if val != nil { return val.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76...
[ 0.19994761049747467, 0.3012496531009674, 0.3341868221759796, 0.18458141386508942, 0.5459205508232117, -0.7031141519546509, 0.7037746906280518, -0.6005806922912598, 0.25450414419174194, -0.4419293701648712, 0.4427127242088318, 0.27651914954185486, -0.6727864146232605, -0.597724437713623, ...
func (m *TriggerAndScopeBasedConditions) GetTrigger()(WorkflowExecutionTriggerable) { val, err := m.GetBackingStore().Get("trigger") if err != nil { panic(err) } if val != nil { return val.(WorkflowExecutionTriggerable) } return nil }
[ 0.4984588027000427, 0.49176737666130066, 0.17695140838623047, 1.5914510488510132, 0.9668704867362976, -0.7763022780418396, 0.7337029576301575, -0.06194785609841347, -0.23462596535682678, -0.23077411949634552, 0.21117056906223297, -0.2607048451900482, -0.5901456475257874, -0.124662823975086...
func (m *TriggerAndScopeBasedConditions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { err := m.WorkflowExecutionConditions.Serialize(writer) if err != nil { return err } { err = writer.WriteObjectValue("scope", m.GetScop...
[ -0.12866118550300598, -0.32961419224739075, 0.17226237058639526, -0.1093563586473465, 0.557532012462616, -1.0731574296951294, 1.3085395097732544, -0.0718839168548584, -0.3103433847427368, 0.41238537430763245, -0.2730063498020172, -0.12322236597537994, -0.3613336682319641, 0.510112464427948...
func (m *TriggerAndScopeBasedConditions) SetScope(value iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.SubjectSetable)() { err := m.GetBackingStore().Set("scope", value) if err != nil { panic(err) } }
[ -0.28622546792030334, 0.5578200817108154, 0.19756928086280823, 0.1413002908229828, 0.12585464119911194, -0.5443194508552551, 0.7532019019126892, -0.3999805450439453, -0.2527519464492798, -0.13169875741004944, -0.24777662754058838, -0.164071187376976, -0.36236774921417236, 0.115616396069526...
func (m *TriggerAndScopeBasedConditions) SetTrigger(value WorkflowExecutionTriggerable)() { err := m.GetBackingStore().Set("trigger", value) if err != nil { panic(err) } }
[ -0.00044528403668664396, 0.8947657346725464, -0.044571928679943085, 1.707520842552185, 0.6650359630584717, -0.2882133722305298, 0.732605516910553, 0.3091195523738861, -0.6789934635162354, -0.03268680348992348, -0.6787557005882263, -0.9097626209259033, -0.2960594594478607, 0.412687152624130...
func (m *Mux) staticRoute(rw http.ResponseWriter, req *http.Request) bool { for _, s := range m.Routes[static] { if len(req.URL.Path) >= s.Size { if req.URL.Path[:s.Size] == s.Path { s.Handler.ServeHTTP(rw, req) return true } } } return false }
[ -0.7483745217323303, 0.20107689499855042, 0.6403080821037292, 0.7525501847267151, -0.07614080607891083, 0.40703779458999634, -0.10543017089366913, 0.1974848210811615, -0.5026497840881348, 0.36288121342658997, 0.05063476040959358, -0.4859349727630615, -0.32827872037887573, 0.715852081775665...
func (m *Mux) HandleNotFound(rw http.ResponseWriter, req *http.Request) { if m.notFound != nil { m.notFound.ServeHTTP(rw, req) } else { http.NotFound(rw, req) } }
[ -0.14784954488277435, -0.19420570135116577, 0.41815340518951416, 0.5749149322509766, 0.8126327991485596, 0.4281042218208313, 0.262935608625412, -0.22076350450515747, 0.3643259108066559, -0.6294548511505127, 0.6692108511924744, -0.03760537877678871, -0.7974072694778442, 0.6240286231040955, ...
func (m *Mux) validate(rw http.ResponseWriter, req *http.Request) bool { plen := len(req.URL.Path) if plen > 1 && req.URL.Path[plen-1:] == "/" { cleanURL(&req.URL.Path) rw.Header().Set("Location", req.URL.Path) rw.WriteHeader(http.StatusFound) } // Retry to find a route that match return m.parse(rw, req) }
[ -0.232771635055542, -0.009478752501308918, 0.7653736472129822, 0.45102250576019287, 0.06534508615732193, 0.19461768865585327, -0.10116679966449738, 0.11733369529247284, 0.17878668010234833, -0.5551994442939758, 1.0649614334106445, -0.5519424676895142, -0.627606213092804, 0.2278904914855957...
func GetValue(req *http.Request, key string) string { vars.RLock() value := vars.v[req][key] vars.RUnlock() return value }
[ -0.9488853812217712, -0.17774011194705963, 0.38680532574653625, 0.8919901847839355, 0.006600494030863047, -0.43277281522750854, -0.3969472050666809, -1.2481815814971924, -0.011704452335834503, 0.9294249415397644, 1.2325745820999146, 0.6299337148666382, -0.7012151479721069, 0.24304969608783...
func GetAllValues(req *http.Request) map[string]string { vars.RLock() values := vars.v[req] vars.RUnlock() return values }
[ -1.1182246208190918, -0.4501790404319763, 0.4637307822704315, 1.0377740859985352, -0.33658260107040405, -0.01737862452864647, -0.6322667002677917, -0.2499222457408905, -0.13596484065055847, -0.7017657160758972, 0.22250911593437195, 0.37381577491760254, -0.1082959771156311, 1.46117687225341...
func (m *Mux) GetRequestRoute(req *http.Request) string { cleanURL(&req.URL.Path) for _, r := range m.Routes[req.Method] { if r.Atts != 0 { if r.Atts&SUB != 0 { if len(req.URL.Path) >= r.Size { if req.URL.Path[:r.Size] == r.Path { return r.Path } } } if r.Match(req) { return r.P...
[ -1.0173749923706055, -0.1005648598074913, 1.0042351484298706, 0.656836986541748, -0.2821206748485565, 0.37852299213409424, -0.10582225769758224, -0.41024667024612427, -0.5622134208679199, -0.13874340057373047, 1.390527367591858, 0.13950030505657196, -0.620620846748352, 0.8640561699867249, ...
func calculateHash(s string) string { h := sha256.New() h.Write([]byte(s)) hashed := h.Sum(nil) return hex.EncodeToString(hashed) }
[ 0.9611685872077942, -0.6228442192077637, 0.3866969645023346, 0.18296444416046143, -0.6468100547790527, 0.07778868079185486, -0.10193032026290894, 0.9373738169670105, 0.4343307912349701, -0.09342662990093231, -0.9312949776649475, -0.314777672290802, -0.5225501656532288, -0.1540769785642624,...
func calculateBlockHash(block Block) string { record := string(block.Index) + block.Timestamp + string(block.BPM) + block.PrevHash return calculateHash(record) }
[ 0.878055989742279, 0.5119839906692505, 0.7601516842842102, 0.5111083388328552, -0.5247600674629211, -0.23988594114780426, 0.3646294176578522, -0.17759379744529724, -0.3445258140563965, 0.822955310344696, -0.590881884098053, -0.11994676291942596, -1.4479568004608154, -0.02041633240878582, ...
func generateBlock(oldBlock Block, BPM int, address string) (Block, error) { var newBlock Block t := time.Now() newBlock.Index = oldBlock.Index + 1 newBlock.Timestamp = t.String() newBlock.BPM = BPM newBlock.PrevHash = oldBlock.Hash newBlock.Hash = calculateBlockHash(newBlock) newBlock.Validator = address ...
[ -0.1809026002883911, 0.35912322998046875, 0.8856543302536011, 0.3308820128440857, 0.0305075291544199, 0.17893730103969574, -0.3452097475528717, 0.01190161518752575, 0.14903737604618073, -0.3747992515563965, -0.6109375357627869, 0.19793274998664856, -0.7798851132392883, -0.17874300479888916...
func isBlockValid(newBlock, oldBlock Block) bool { if oldBlock.Index+1 != newBlock.Index { return false } if oldBlock.Hash != newBlock.PrevHash { return false } if calculateBlockHash(newBlock) != newBlock.Hash { return false } return true }
[ 0.03275302052497864, -0.2298688143491745, 0.9826197624206543, 1.383754849433899, 0.13454800844192505, 0.47963082790374756, -0.3076882064342499, -0.5605599880218506, -0.1250082105398178, 0.2967755198478699, -0.15316835045814514, 1.005707859992981, -0.7114099860191345, 0.3383868932723999, ...
func enviaBlocos(conn net.Conn, inicio int, fim int){ rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn)) //Caso index fim -1, envia do inicio até o bloco atual if fim == -1 { fim = Blockchain[len(Blockchain)-1].Index } //Verifica possiveis erros de index (caso a blockchain nao esteja exatame...
[ 0.5643124580383301, 0.5058014988899231, 0.8369189500808716, 0.323930025100708, 0.6117907166481018, -0.12027902156114578, 0.7464136481285095, -0.1725997030735016, -1.1476402282714844, 0.4757619798183441, -0.4411207437515259, 0.8753628134727478, -0.6256008148193359, 0.4132843613624573, 1.0...
func enviaBlockchain(conn net.Conn){ //buffer := make([]byte, 4096) //Envia //writer := bufio.NewWriter(conn) //reader := bufio.NewReader(conn) for _, bloco := range Blockchain { //envia o bloco junto com o código de bloco (melhorar depois) fmt.Println("Enviando bloco!") //fmt.Fprintf(conn, "a" + string(cod...
[ 0.35304179787635803, 0.11592786759138107, 1.0367252826690674, 0.38907575607299805, 0.962623655796051, -0.0957217887043953, 0.8960476517677307, 0.08134280890226364, -0.9897907376289368, 0.21645013988018036, -0.8432444334030151, 0.8297531008720398, -0.753905713558197, 0.7343707084655762, 0...
func NewUserLatency(cfg *config.Config, db *sql.DB) *Wrapper { return &Wrapper{ ul: userlatency.NewUserLatency(cfg, db), } }
[ 0.2990253269672394, -0.6879622936248779, 0.35991787910461426, 0.9849456548690796, -1.4763487577438354, -0.1409837156534195, -0.8942240476608276, -0.12147610634565353, 0.1592729687690735, 0.9484025835990906, -1.415542483329773, -0.08947581797838211, 0.40350595116615295, 0.3630679249763489, ...
func (ulw *Wrapper) ResetStatistics() { ulw.ul.ResetStatistics() }
[ 0.09275700896978378, 1.4561575651168823, 0.033558182418346405, 1.1038904190063477, 0.38527193665504456, 0.34242644906044006, 1.1614010334014893, -0.5711970925331116, -0.13733774423599243, -0.2917029857635498, 0.8251663446426392, 1.103172779083252, 0.39525169134140015, 0.32760077714920044, ...
func (ulw *Wrapper) Collect() { ulw.ul.Collect() sort.Sort(byTotalTime(ulw.ul.Results)) }
[ -0.1594633013010025, 0.022976752370595932, 0.47238102555274963, -0.16479389369487762, -0.09683027118444443, 0.632156491279602, 0.38680708408355713, -0.6796181201934814, -0.04289828985929489, 0.06932447105646133, 0.5081709623336792, 0.2010844349861145, 1.3786488771438599, 2.1694588661193848...
func (ulw Wrapper) RowContent() []string { rows := make([]string, 0, len(ulw.ul.Results)) for i := range ulw.ul.Results { rows = append(rows, ulw.content(ulw.ul.Results[i], ulw.ul.Totals)) } return rows }
[ -0.5563329458236694, 0.281099408864975, 0.3683846592903137, -0.3592381477355957, 0.07472539693117142, 0.13991527259349823, 0.09673365950584412, -0.010729066096246243, 0.5410670638084412, 0.37695133686065674, 0.6677625775337219, -0.39941468834877014, 0.24938687682151794, 0.01179307233542203...
func (ulw Wrapper) TotalRowContent() string { return ulw.content(ulw.ul.Totals, ulw.ul.Totals) }
[ 0.21082757413387299, 0.018821697682142258, 0.2591942548751831, -0.30956608057022095, -0.9154407978057861, 0.04867709428071976, 0.35360950231552124, -0.3153930604457855, 0.8023229837417603, 0.5754743814468384, 0.41557392477989197, -0.7932409048080444, 0.5902066230773926, -0.3921350836753845...
func (ulw Wrapper) Len() int { return len(ulw.ul.Results) }
[ -0.47387880086898804, 0.8103712797164917, 0.1736716479063034, -0.2515583634376526, 0.3721674084663391, 0.09081533551216125, 0.8782917857170105, 1.1144328117370605, 0.39245283603668213, -1.4920939207077026, -0.9319405555725098, 0.28840088844299316, 0.6905722618103027, 0.7163602113723755, ...
func (ulw Wrapper) EmptyRowContent() string { var empty userlatency.Row return ulw.content(empty, empty) }
[ 0.384202241897583, 0.3794991970062256, -0.03661421313881874, -0.3425014615058899, -0.46676668524742126, 0.4382834732532501, -0.7006663680076599, -0.6351698040962219, 0.34149909019470215, 0.4804249405860901, 0.3245447874069214, -0.44108283519744873, -0.2150048464536667, -0.1738457828760147,...
func (ulw Wrapper) HaveRelativeStats() bool { return ulw.ul.HaveRelativeStats() }
[ 0.9720079898834229, 0.8409751653671265, 0.5222477316856384, 0.3205556571483612, -0.4315143823623657, 1.1565628051757812, 0.43979060649871826, -0.3426497280597687, -0.04657168686389923, -1.1125894784927368, -0.2998945116996765, -0.6749502420425415, 0.07033728808164597, 0.893398642539978, ...
func (ulw Wrapper) FirstCollectTime() time.Time { return ulw.ul.FirstCollected }
[ 0.5527228116989136, -0.07767236977815628, 0.37357667088508606, 0.07926274091005325, 0.521020770072937, 0.3307952284812927, -0.3784545063972473, -0.721396803855896, 0.5285197496414185, 0.23247605562210083, -0.5267935395240784, -1.0176368951797485, 0.6324136853218079, 1.4773083925247192, -...
func (ulw Wrapper) LastCollectTime() time.Time { return ulw.ul.LastCollected }
[ 0.20472200214862823, -0.2590474784374237, 0.547792375087738, -0.5061944127082825, 0.10673648118972778, 0.6544568538665771, 0.0986829623579979, -0.934528112411499, 1.0588736534118652, 0.5077545046806335, -0.47008612751960754, -1.2123957872390747, 0.22407323122024536, 0.9139069318771362, -...
func (ulw Wrapper) WantRelativeStats() bool { return ulw.ul.WantRelativeStats() }
[ 0.35350388288497925, 1.0035712718963623, 0.3786415755748749, 0.3753543496131897, -1.0367374420166016, 1.281890630722046, 0.05729447305202484, -0.7338665127754211, 0.034844912588596344, -1.6113814115524292, 0.05548272654414177, 0.24536913633346558, -0.20971576869487762, 0.6511694192886353, ...
func (ulw Wrapper) Description() string { var count int for row := range ulw.ul.Results { if ulw.ul.Results[row].Username != "" { count++ } } return fmt.Sprintf("Activity by Username (processlist) %d rows", count) }
[ -0.27825063467025757, 0.47861528396606445, 0.4460064768791199, -0.29155728220939636, -0.1426205188035965, -0.03491624444723129, 0.5602588057518005, 0.47671666741371155, 0.26225292682647705, 0.4758951961994171, 0.45741868019104004, 0.23604340851306915, -0.0698234885931015, 0.601799726486206...
func (ulw Wrapper) Headings() string { return fmt.Sprintf("%-10s %6s|%-10s %6s|%4s %4s|%5s %3s|%3s %3s %3s %3s %3s|%s", "Run Time", "%", "Sleeping", "%", "Conn", "Actv", "Hosts", "DBs", "Sel", "Ins", "Upd", "Del", "Oth", "User") }
[ -1.087078332901001, 0.15710894763469696, 0.5952318906784058, -0.5658612847328186, -0.4711812436580658, 0.5130148530006409, -0.47379571199417114, -0.3409389853477478, 0.46701860427856445, 0.27114608883857727, 0.31153595447540283, 0.6022471785545349, -0.4256298243999481, 0.3216795325279236, ...
func (ulw Wrapper) content(row, totals userlatency.Row) string { return fmt.Sprintf("%10s %6s|%10s %6s|%4s %4s|%5s %3s|%3s %3s %3s %3s %3s|%s", formatSeconds(row.Runtime), lib.FormatPct(lib.Divide(row.Runtime, totals.Runtime)), formatSeconds(row.Sleeptime), lib.FormatPct(lib.Divide(row.Sleeptime, totals.Sleept...
[ -0.007722978480160236, -0.3340127766132355, 0.46279847621917725, -1.005813717842102, -0.5472725629806519, 0.24660831689834595, -0.006746843457221985, -1.223996639251709, 0.035007547587156296, 0.6138715147972107, 0.9599834680557251, -0.47502508759498596, 0.03281519562005997, -0.121287807822...
func formatSeconds(d uint64) string { if d == 0 { return "" } days := d / 86400 hours := (d - days*86400) / 3600 minutes := (d - days*86400 - hours*3600) / 60 seconds := d - days*86400 - hours*3600 - minutes*60 if days > 0 { return fmt.Sprintf("%dd %dh %dm", days, hours, minutes) } if hours > 0 { retur...
[ -0.8035510182380676, 0.8512080311775208, 0.7951568961143494, -0.4323619604110718, -0.7532967329025269, -0.5278924703598022, -0.0654214471578598, -1.4979056119918823, -0.1547665297985077, -0.7221567034721375, 1.2397358417510986, -0.0857025608420372, 0.6630930304527283, 1.2750564813613892, ...
func New(qChan qtypes_qchannel.QChan, cfg *config.Config, name string) (Plugin, error) { p := Plugin{ Plugin: qtypes_plugin.NewNamedPlugin(qChan, cfg, pluginTyp, pluginPkg, name, version), } p.Version = version p.Name = name return p, nil }
[ 0.020218688994646072, -1.1675673723220825, 0.39806419610977173, -0.5464324355125427, -0.8006333112716675, -0.40009868144989014, -0.6044217944145203, -0.5679237842559814, 0.05648608133196831, 0.48038285970687866, -1.9085923433303833, 0.18955568969249725, -0.07399456202983856, 0.183486938476...
func (p *Plugin) Run() { p.Log("notice", fmt.Sprintf("Start %s handler: %sv%s", pluginPkg, p.Name, version)) bg := p.QChan.Data.Join() p.Connect() p.cleanDgraph() for { select { case val := <-bg.Read: switch val.(type) { // TODO: That has to be an interface! case qtypes_messages.Message: qm := val...
[ -0.17490974068641663, -0.620391309261322, 0.7732566595077515, -0.4295852780342102, 0.18667007982730865, -0.40691518783569336, 0.7692294716835022, -0.40126514434814453, -0.2505877614021301, -0.03933652117848396, -0.494098424911499, 0.33022013306617737, -0.6170533299446106, 0.136060550808906...
func NewQuerier(keeper AccountKeeper) sdk.Querier { return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, sdk.Error) { switch path[0] { case QueryAccount: return queryAccount(ctx, req, keeper) case QueryTokenStats: return queryTokenStats(ctx, keeper) default: return nil, sdk.Err...
[ -0.5102894306182861, -0.5134423971176147, 0.315507709980011, 0.5964722633361816, -0.30185580253601074, 0.097324438393116, -0.48091214895248413, -0.9358825087547302, 0.7669119834899902, -1.094556450843811, 0.8885927200317383, 0.6501018404960632, 0.3748064637184143, 0.4367859363555908, -0....
func (r *Robot) GetRepoData() map[string]json.RawMessage { c := r.getContext() t, p, j := getTask(c.currentTask) if j == nil && p == nil { r.Log(Error, "GetRepoData called by non-job/plugin task '%s'", t.name) return nil } if len(c.nsExtension) > 0 { r.Log(Error, "GetRepoData called with namespace extended: ...
[ -0.6448673605918884, -0.019881444051861763, 0.5856191515922546, -0.23386573791503906, -0.1016804426908493, -0.41207069158554077, -0.4392883777618408, -0.9072523713111877, 0.2879246175289154, 0.022526459768414497, -0.6602933406829834, 0.671395480632782, 0.10354859381914139, 0.28254824876785...
func (r *Robot) ExtendNamespace(ext string, histories int) bool { if strings.ContainsRune(ext, ':') { r.Log(Error, "Invalid namespace extension contains ':'") return false } c := r.getContext() if c.stage != primaryTasks { r.Log(Error, "ExtendNamespace called after pipeline end") return false } if len(c.j...
[ 0.4454513490200043, 0.772236704826355, 0.8279293179512024, -0.24088290333747864, -0.654464602470398, 0.4339146912097931, -0.44040346145629883, 0.3026932179927826, 0.991901159286499, 0.08487215638160706, -1.0933802127838135, 0.45239001512527466, -0.25222283601760864, 1.3609999418258667, 0...
func (r *Robot) pipeTask(pflavor pipeAddFlavor, ptype pipeAddType, name string, args ...string) RetVal { c := r.getContext() if c.stage != primaryTasks { task, _, _ := getTask(c.currentTask) r.Log(Error, "request to modify pipeline outside of initial pipeline in task '%s'", task.name) return InvalidStage } t ...
[ -0.46467113494873047, -0.24689312279224396, 0.8901891708374023, -0.12984536588191986, -0.21148693561553955, -0.45785966515541077, 0.35723766684532166, 0.3074910044670105, 0.12160234898328781, 0.5399168729782104, -0.13490711152553558, 0.5015714168548584, -0.7898737192153931, 0.7218892574310...
func (r *Robot) SpawnJob(name string, args ...string) RetVal { return r.pipeTask(flavorSpawn, typeJob, name, args...) }
[ -0.03803767263889313, 0.31301918625831604, 0.3410549461841583, 1.0087862014770508, -0.48064225912094116, 0.09176922589540482, -0.6522924304008484, -0.044065240770578384, -0.47505491971969604, 0.6880356073379517, -0.3753005862236023, -0.2257755547761917, -0.780096709728241, -0.4372744560241...
func (r *Robot) AddTask(name string, args ...string) RetVal { return r.pipeTask(flavorAdd, typeTask, name, args...) }
[ -0.7710729241371155, 0.2752131521701813, 0.4493345022201538, 0.7088460326194763, 0.16817426681518555, -0.15253184735774994, -0.3660559356212616, 0.6008297801017761, -0.4759677052497864, 0.03738029673695564, -0.414354145526886, 0.2167350947856903, -0.20488429069519043, 0.2121194750070572, ...
func (r *Robot) FinalTask(name string, args ...string) RetVal { return r.pipeTask(flavorFinal, typeTask, name, args...) }
[ -0.6218212842941284, -0.18394984304904938, 0.4909374415874481, 0.289445161819458, -0.2954331040382385, -0.3046358823776245, 0.007415988948196173, 0.7632841467857361, -0.43118301033973694, 0.18660400807857513, -0.4483662247657776, 0.15708549320697784, -0.48988524079322815, -0.16181051731109...
func (r *Robot) FailTask(name string, args ...string) RetVal { return r.pipeTask(flavorFail, typeTask, name, args...) }
[ -0.6981917023658752, -0.17811565101146698, 0.38683465123176575, 0.3014291524887085, -0.16648955643177032, -0.45969849824905396, -0.4473828971385956, -0.1774088740348816, -1.2260534763336182, 0.37337005138397217, -0.4241606295108795, 0.11364766955375671, -0.3605019152164459, 0.5796903371810...
func (r *Robot) AddJob(name string, args ...string) RetVal { return r.pipeTask(flavorAdd, typeJob, name, args...) }
[ -0.28032243251800537, 0.43906110525131226, 0.4674978256225586, 1.010823130607605, -0.24878117442131042, 0.1494395136833191, -0.8256223201751709, 0.6147348284721375, -0.3704448640346527, -0.24960088729858398, 0.34318122267723083, -0.2933390736579895, -0.6387578248977661, 0.06776820868253708...
func (r *Robot) AddCommand(plugname, command string) RetVal { return r.pipeTask(flavorAdd, typePlugin, plugname, command) }
[ -0.5949045419692993, -0.6179631948471069, 0.3865529000759125, 0.21469712257385254, 0.5974606871604919, -0.3681279718875885, -0.17224784195423126, 0.34547287225723267, 0.381303071975708, -0.1829412430524826, -0.3384087085723877, 0.5718331933021545, -0.4969024062156677, 0.5072253942489624, ...
func (r *Robot) FinalCommand(plugname, command string) RetVal { return r.pipeTask(flavorFinal, typePlugin, plugname, command) }
[ -0.7089525461196899, -0.8374589085578918, 0.33145973086357117, -0.11132680624723434, 0.34725138545036316, -0.7482733726501465, 0.3705301284790039, 0.6478255391120911, 0.2025764286518097, 0.29847145080566406, -0.2910896837711334, 0.372803658246994, -0.6810050010681152, 0.279645711183548, ...
func (r *Robot) FailCommand(plugname, command string) RetVal { return r.pipeTask(flavorFail, typePlugin, plugname, command) }
[ -0.9244844317436218, -0.799492597579956, 0.2570727467536926, -0.017272397875785828, 0.3057723641395569, -0.6558630466461182, 0.15669965744018555, -0.44209811091423035, -0.48826730251312256, 0.2660529613494873, -0.30184343457221985, 0.39484575390815735, -0.6677192449569702, 0.91924619674682...
func (i *IoToolModel) IsDir(fileAddr string) bool { s, err := os.Stat(fileAddr) if err != nil { // log.Println(err) return false } return s.IsDir() }
[ 0.14148148894309998, -0.39915457367897034, 0.6036132574081421, 0.7958614230155945, -0.17229895293712616, 0.9296560287475586, 1.2211514711380005, 0.30176618695259094, -0.3265868127346039, -0.8727271556854248, 0.030674677342176437, -0.10058367252349854, 0.29768529534339905, 1.042105793952942...
func ScanDir(dir string) []string { files, err := ioutil.ReadDir(dir) if err != nil { log.Printf("read [%s] error, err = %s\n", dir, err) } var fileList []string for _, file := range files { fileList = append(fileList, dir+file.Name()) } return fileList }
[ -0.6460851430892944, -0.6277335286140442, 0.556431770324707, 0.8939840793609619, -1.2559282779693604, 0.5893513560295105, -0.28432872891426086, -0.09923118352890015, 0.7097247242927551, -0.22748567163944244, 0.1924784630537033, 0.2549039125442505, -0.0577874593436718, 1.24799382686615, 0...
func IsGit(dir string) bool { files, err := ioutil.ReadDir(dir) if err != nil { log.Printf("read [%s] error, err = %s\n", dir, err) } for _, file := range files { if file.IsDir() && file.Name() == ".git" { return true } } return false }
[ -0.15195263922214508, 0.0969783142209053, 0.9803109765052795, 0.026335787028074265, -0.04720420017838478, 0.48020923137664795, -0.3302278220653534, 0.5566883683204651, -0.5433774590492249, 0.07435935735702515, 0.37830111384391785, 0.4496380388736725, -0.6848852634429932, 0.8969815373420715...
func GetLanguage(dir string) map[string]uint64 { var langMap = make(map[string]uint64) files, err := ioutil.ReadDir(dir) if err != nil { log.Printf("read [%s] error, err = %s\n", dir, err) } for _, file := range files { if file != nil && !file.IsDir() { var ext = path.Ext(dir + file.Name()) var count, ex...
[ -0.5345718860626221, 0.17368052899837494, 0.8808260560035706, -0.15223199129104614, -0.4389010965824127, -0.5345938801765442, 0.86250901222229, 0.5460752248764038, 0.03395950049161911, 0.28747960925102234, -0.21263784170150757, -0.03866805508732796, 0.14102208614349365, 1.1276437044143677,...
func (g Generator) Generate() error { defaultSchema := "public" if g.DefaultSchema != "" { defaultSchema = g.DefaultSchema } tableFiles, err := listYamlFiles("tables") if err != nil { return err } viewFiles, err := listYamlFiles("views") if err != nil { return err } tableSpecs, err := createTableSpec...
[ -0.04220614954829216, 0.8765209317207336, 0.7812849879264832, 0.5665480494499207, 0.27567005157470703, 0.5127878189086914, 1.2365293502807617, -0.005111107137054205, -0.5564002394676208, -0.750285804271698, -0.6713613867759705, -0.0677284374833107, 0.03194114565849304, 1.2964736223220825, ...
func NewClient(tr Transport) *Client { return &Client{transport: tr} }
[ 0.1409229189157486, -0.10843003541231155, -0.1278444081544876, -0.266454815864563, -1.1155219078063965, 0.5351924896240234, 0.48101508617401123, -0.7948588728904724, -0.07410982996225357, -0.4615544080734253, -0.5323043465614319, 0.44934192299842834, 0.27988582849502563, -1.452333450317382...
func (c *Client) Detect(ctx context.Context, req *Request) (*Response, error) { uid, err := protocol.UUIDFrom(req.UID) if err != nil { return nil, err } sessid, err := protocol.UUIDFrom(req.SessID) if err != nil { return nil, err } nReq := &protocol.Request{ Udid: req.UDID, Uid: ui...
[ -0.49823373556137085, -0.2531934678554535, 0.9979441165924072, 0.5917235612869263, -0.7117992043495178, -0.5526750087738037, -0.3066657781600952, -1.001245141029358, 0.8154735565185547, -0.1725550889968872, -0.18002936244010925, 0.2510216236114502, -0.49186038970947266, 0.5139988660812378,...
func UnsafeFastHash() { hashCost = bcrypt.MinCost }
[ 1.5341064929962158, 0.3883498013019562, 0.22633998095989227, 0.18073560297489166, -0.32443347573280334, -0.4936774671077728, -0.18799684941768646, -0.03796249255537987, -0.9211511611938477, 0.33449026942253113, -0.7166721224784851, 0.5030794143676758, -0.18532918393611908, -0.1807350516319...
func Hash(str string) ([]byte, error) { // generate hash from password hash, err := HashBytes([]byte(str)) if err != nil { return nil, xo.W(err) } return hash, nil }
[ 0.5946304798126221, 0.1143326610326767, 0.47755882143974304, 0.6483878493309021, -0.7050829529762268, 1.1181596517562866, -0.23083722591400146, 0.430293470621109, 0.3330141603946686, 0.23291301727294922, -0.8336644172668457, 1.2905443906784058, -0.41668832302093506, -0.2631482183933258, ...
func HashBytes(bytes []byte) ([]byte, error) { buf, err := bcrypt.GenerateFromPassword(bytes, hashCost) return buf, xo.W(err) }
[ 0.6503831744194031, 1.4614086151123047, 0.43102964758872986, 0.3472938537597656, 0.00432978942990303, -0.19715169072151184, -0.5384065508842468, 0.3552172780036926, 0.47402429580688477, 0.8555968999862671, -0.8694056272506714, 0.08383365720510483, -1.1682852506637573, -0.3451911211013794, ...
func MustHash(str string) []byte { // hash string hash, err := Hash(str) if err != nil { panic(err.Error()) } return hash }
[ 0.8264402747154236, -0.28350019454956055, 0.4583822786808014, 1.3675479888916016, -0.4616505801677704, 1.4186060428619385, -0.9386866688728333, -0.849602997303009, 0.24811549484729767, 0.44169092178344727, -0.48242679238319397, 1.1872546672821045, -0.2958816587924957, -0.5229602456092834, ...
func MustHashBytes(bytes []byte) []byte { // hash bytes hash, err := HashBytes(bytes) if err != nil { panic(err.Error()) } return hash }
[ 0.3638134002685547, 0.2150249481201172, 0.47343218326568604, 0.6872611045837402, -0.025271296501159668, 1.3039971590042114, -1.0258301496505737, -0.22577884793281555, 0.6320803761482239, 0.572881281375885, -0.3527531027793884, 0.21073465049266815, -0.7607554197311401, 0.5793763995170593, ...
func Compare(hash []byte, str string) error { return CompareBytes(hash, []byte(str)) }
[ 0.9809224605560303, -0.81883704662323, 0.24621182680130005, 0.8199257254600525, -0.6356939077377319, 0.5938637852668762, -0.9877796769142151, -0.5492205023765564, -0.6785128712654114, 0.11929531395435333, -0.007725078146904707, 0.46140748262405396, -0.9618089199066162, 0.4402518570423126, ...
func CompareBytes(hash, bytes []byte) error { return xo.W(bcrypt.CompareHashAndPassword(hash, bytes)) }
[ 1.1956602334976196, -0.015699641779065132, 0.4487915635108948, 0.550233006477356, 0.42934277653694153, -0.09820556640625, -0.6328001618385315, 0.45521557331085205, -0.09137768298387527, 0.3334781229496002, -0.4664716124534607, -0.0003885385231114924, -1.2459168434143066, 0.6513738036155701...
func (m *VnicFcInterruptSettings) UnmarshalJSON(raw []byte) error { // AO0 var dataAO0 struct { Mode *string `json:"Mode,omitempty"` } if err := swag.ReadJSON(raw, &dataAO0); err != nil { return err } m.Mode = dataAO0.Mode return nil }
[ -0.37159380316734314, 0.6665242314338684, 0.17337839305400848, -1.0798406600952148, 0.06913184374570847, -1.1925091743469238, 0.2312382161617279, -0.37005001306533813, -0.7339737415313721, 1.1033873558044434, -0.10072002559900284, -1.1686094999313354, -0.8059846758842468, -0.52658557891845...
func (m VnicFcInterruptSettings) MarshalJSON() ([]byte, error) { _parts := make([][]byte, 0, 1) var dataAO0 struct { Mode *string `json:"Mode,omitempty"` } dataAO0.Mode = m.Mode jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0) if errAO0 != nil { return nil, errAO0 } _parts = append(_parts, jsonDataAO0) r...
[ 0.003924728371202946, 0.2912895679473877, 0.10080192983150482, -0.08685958385467529, 0.4824739992618561, -1.2889292240142822, -0.29578325152397156, -0.44571661949157715, -0.6133970618247986, 0.7976056337356567, -0.3425002098083496, -0.3594116270542145, -1.147107720375061, -0.22244335711002...
func (m *VnicFcInterruptSettings) Validate(formats strfmt.Registry) error { var res []error if err := m.validateMode(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
[ -0.004947761073708534, 0.7427119612693787, 0.02591024525463581, -0.01028492022305727, 0.9156479239463806, -1.2467987537384033, 0.032029036432504654, -0.9448938369750977, -1.1038414239883423, 0.5951108336448669, 0.40131157636642456, -1.3001350164413452, -1.700168490409851, -0.36348953843116...
func KeyContextChecks( keyContext map[string]string, secretData map[string]interface{}, ) error { _, customData := keyContext[CustomSecretData] _, publicData := keyContext[PublicSecretData] if customData && publicData { return &ErrInvalidKeyContext{ Reason: "both CustomSecretData and PublicSecretData flags c...
[ 0.1278698742389679, -0.43371108174324036, 0.7213855981826782, -0.07365972548723221, -0.2243611067533493, 1.2618530988693237, -0.9724727272987366, -0.22020487487316132, -0.2754261791706085, 0.03736647218465805, 0.35504528880119324, 0.6359483003616333, -0.7920674085617065, 0.4020837843418121...
func (s *Store) CreateTRBRequestAttendee(ctx context.Context, attendee *models.TRBRequestAttendee) (*models.TRBRequestAttendee, error) { attendee.ID = uuid.New() stmt, err := s.db.PrepareNamed(` INSERT INTO trb_request_attendees ( id, eua_user_id, trb_request_id, role, component, created_by, mo...
[ -0.3511962890625, -0.9646446108818054, 0.5782263278961182, -0.3396802544593811, -0.013713815249502659, 0.5838253498077393, -0.11057841777801514, -0.18195754289627075, -0.5941334366798401, 0.3030894696712494, -0.19723425805568695, -0.3444717526435852, -0.21829569339752197, -0.64140439033508...
func (s *Store) UpdateTRBRequestAttendee(ctx context.Context, attendee *models.TRBRequestAttendee) (*models.TRBRequestAttendee, error) { // return attendee, nil stmt, err := s.db.PrepareNamed(` UPDATE trb_request_attendees SET role = :role, component = :component, modified_by = :modified_by, modified_at ...
[ -1.0001204013824463, -1.5867769718170166, 0.4556719958782196, -0.7007365822792053, -0.7150818109512329, 0.54638671875, -0.0743851289153099, -0.10568994283676147, -0.6054891347885132, 0.9478079676628113, 0.17520952224731445, 0.20359352231025696, -0.1997210681438446, -0.763964831829071, 0....
func (s *Store) GetTRBRequestAttendeesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestAttendee, error) { results := []*models.TRBRequestAttendee{} err := s.db.Select(&results, `SELECT * FROM trb_request_attendees WHERE trb_request_id=$1`, trbRequestID) if err != nil && !errors.Is(e...
[ -0.13403388857841492, -0.8863603472709656, 0.008898523636162281, -0.6126109957695007, 0.16123421490192413, 0.3764928877353668, -0.5327025055885315, -0.2639943063259125, -0.380165696144104, 1.2610632181167603, 0.22564354538917542, 0.4751427471637726, -0.41957932710647583, 0.0590328238904476...
func (s *Store) DeleteTRBRequestAttendee(ctx context.Context, id uuid.UUID) (*models.TRBRequestAttendee, error) { stmt, err := s.db.PrepareNamed(` DELETE FROM trb_request_attendees WHERE id = :id RETURNING *;`) if err != nil { appcontext.ZLogger(ctx).Error( fmt.Sprintf("Failed to update TRB request attende...
[ -0.34762200713157654, -1.0371595621109009, 0.45533591508865356, -0.39693495631217957, -0.6601269841194153, 0.3605310320854187, -0.22747473418712616, 0.04775238037109375, -0.40748828649520874, 0.5682124495506287, 0.4243331551551819, 0.08802518993616104, -0.49484729766845703, -0.483987301588...
func (s *Store) GetAttendeeComponentByEUA(ctx context.Context, euaID string, trbRequestID uuid.UUID) (*string, error) { attendee := models.TRBRequestAttendee{} stmt, err := s.db.PrepareNamed(` SELECT * FROM trb_request_attendees WHERE eua_user_id = :eua_user_id AND trb_request_id = :trb_request_id; `) if e...
[ -0.12972310185432434, -1.1691720485687256, 0.6787590384483337, -1.026431918144226, -0.3275075852870941, 0.10253577679395676, 0.302481472492218, -0.040118612349033356, 0.13351576030254364, 0.7541055083274841, 0.971064031124115, 0.1066771000623703, 0.46967223286628723, -0.029759908095002174,...
func Normalize(lives, configs []*unstructured.Unstructured, diffConfig DiffConfig) (*NormalizationResult, error) { result, err := preDiffNormalize(lives, configs, diffConfig) if err != nil { return nil, err } diffNormalizer, err := newDiffNormalizer(diffConfig.Ignores(), diffConfig.Overrides()) if err != nil { ...
[ -0.2232876718044281, 0.4173223078250885, 0.8740569949150085, 0.5033277273178101, 0.5649141073226929, 0.11905589699745178, 0.42759543657302856, 0.2434181571006775, 0.22760272026062012, 0.19113391637802124, 0.2436417192220688, -0.5449937582015991, -0.49558985233306885, 0.9068115949630737, ...
func newDiffNormalizer(ignore []v1alpha1.ResourceIgnoreDifferences, overrides map[string]v1alpha1.ResourceOverride) (diff.Normalizer, error) { ignoreNormalizer, err := normalizers.NewIgnoreNormalizer(ignore, overrides) if err != nil { return nil, err } knownTypesNorm, err := normalizers.NewKnownTypesNormalizer(ov...
[ -0.9612103700637817, -0.6979108452796936, 0.6484453082084656, 0.27363595366477966, -0.8311262726783752, -0.006091178860515356, 0.6397227048873901, -0.1015036404132843, 0.6796411871910095, 0.04133385419845581, -0.6124844551086426, -0.16885672509670258, -0.8284872770309448, 1.173052191734314...
func (n *composableNormalizer) Normalize(un *unstructured.Unstructured) error { for i := range n.normalizers { if err := n.normalizers[i].Normalize(un); err != nil { return err } } return nil }
[ -0.9593406915664673, 0.4027346074581146, 0.36139553785324097, 0.09006425738334656, 0.8922103047370911, 0.36515292525291443, 0.4595714509487152, 0.2900855541229248, 0.12028628587722778, -0.3423405587673187, -0.48932555317878723, -0.5947421193122864, -1.3739930391311646, 1.1238912343978882, ...
func decompress(cd []byte, tracklen int) (dat []byte, err error) { for { if len(cd) == 0 { break } runLength := int(cd[0]) cd = cd[1:] dat = append(dat, cd[:runLength]...) cd = cd[runLength:] if len(cd) == 0 { break } runLength = int(cd[0]) repeated := cd[1] cd = cd[2:] for i := runLeng...
[ -0.28053784370422363, 0.9501859545707703, 0.8129526376724243, -0.9856753349304199, -0.8259656429290771, -0.4609176218509674, 0.027849797159433365, -0.7011027932167053, -0.5829680562019348, -0.5954806208610535, -0.9632036089897156, -0.06253992021083832, -1.210507869720459, -0.19988165795803...
func CapacityToString(cap byte) string { switch cap { case 0: return "unknown" case 1: return "360K" case 2: return "1.2M" case 3: return "720K" case 4: return "1.4M" case 5: return "160K" case 6: return "180K" case 7: return "320K" default: panic("invalid capacity") } }
[ -0.9437299370765686, -1.3760374784469604, 0.6601155400276184, 0.11972369253635406, -0.5776258707046509, 0.32036319375038147, 0.0877925306558609, -0.17551355063915253, 0.04108374938368797, 0.9149123430252075, -0.276002436876297, -0.41637125611305237, 0.3780653476715088, -0.19332756102085114...
func LoadFile(r io.Reader) (*File, error) { file := &File{} err := readHeader(r, &file.Header) if err != nil { return nil, err } log.Printf("header: %s", CapacityToString(file.Header.DiskCapacity)) log.Printf("\ttrack length: %d", file.Header.Geometry.TrackLength()) for { var dat Data dat, err = readNext...
[ 0.876318633556366, 0.26982733607292175, 0.6242471933364868, -0.6377730965614319, -0.6543009281158447, 0.5591363310813904, -0.0501515232026577, -0.6639147400856018, -1.258407711982727, -0.5093373656272888, 0.5734648704528809, -0.36734649538993835, -0.15335461497306824, 0.2889891266822815, ...
func (f *File) Assemble() ([]byte, error) { buffer := make([]byte, f.Header.Geometry.DiskSize) for _, data := range f.Data { offset, err := f.Header.Geometry.TrackOffset(data.Head, data.Cylinder) if err != nil { return nil, err } copy(buffer[offset:], data.Data) } return buffer, nil }
[ -0.27047404646873474, -1.3593381643295288, 0.6182819604873657, -0.7555105090141296, 0.006888830568641424, 0.6026085019111633, -0.3885555863380432, -0.7514921426773071, -1.7743144035339355, -0.36159950494766235, 0.13680502772331238, -0.05618768185377121, -0.0986858606338501, -0.177449181675...
func (f *File) UpdateChecksum() error { image, err := f.Assemble() if err != nil { return err } f.Header.Checksum = checksum(image) binary.LittleEndian.PutUint32(f.Header.Raw[8:12], f.Header.Checksum) return nil }
[ -0.41981279850006104, -1.2013282775878906, 0.6484017372131348, -0.3490646779537201, 0.5892213582992554, 0.245393306016922, -0.11869515478610992, 0.36777636408805847, -0.7478411197662354, -0.18676334619522095, -0.26040342450141907, 0.3420565724372864, 0.14071671664714813, 0.5759807229042053...
func checksum(data []byte) uint32 { var cksum uint32 for i := 0; i < len(data); i++ { cksum += uint32(data[i]) * uint32(i) } return cksum }
[ 0.24250690639019012, 0.4911814033985138, 0.5766602754592896, 0.30459755659103394, 0.22953367233276367, 0.4310319125652313, 0.3045596778392792, 0.010171042755246162, 0.6900535821914673, -0.10248565673828125, -0.15877492725849152, -0.4378495514392853, -0.6055173277854919, 0.27838850021362305...
func NewScheduleJobCommand(p *config.KfParams) *cobra.Command { cmd := &cobra.Command{ Use: "schedule-job JOB_NAME SCHEDULE", Short: "Schedule the Job for execution on a cron schedule.", Example: `kf schedule-job my-job "* * * * *"`, Args: cobra.ExactArgs(2), Long: `The s...
[ 0.30351343750953674, -0.7136635184288025, 0.5431586503982544, 0.28675875067710876, -0.097267746925354, -0.3332878649234772, -0.16753371059894562, 0.37847471237182617, -0.49534380435943604, 0.353984534740448, 0.0057737757451832294, 0.7328258752822876, -0.607397735118866, -0.2077163755893707...
func NewDynamoDBManager(awsManager common.AWSManager, client interface{}) (common.ResourceDetection, error) { if client == nil { client = dynamodb.New(awsManager.GetSession()) } dynamoDBClient, ok := client.(DynamoDBClientescreptor) if !ok { return nil, errors.New("invalid dynamoDB client") } return &Dynam...
[ -0.5968761444091797, -0.00918204803019762, 0.3840840756893158, -0.28863000869750977, -0.6138157248497009, -0.1424541473388672, -0.49042683839797974, 0.3226279020309448, 0.3421098291873932, -0.2252497524023056, -0.521235466003418, 0.5362998247146606, -0.6023609042167664, 1.4259982109069824,...
func (dd *DynamoDBManager) Detect(metrics []config.MetricConfig) (interface{}, error) { log.WithFields(log.Fields{ "region": dd.awsManager.GetRegion(), "resource": "dynamoDB", }).Info("starting to analyze resource") dd.awsManager.GetCollector().CollectStart(dd.Name) detectedTables := []DetectedAWSDynamoDB{...
[ -0.5467735528945923, 0.04119071364402771, 1.0113228559494019, 1.1813664436340332, -0.03244366496801376, 0.4914417862892151, 0.08673087507486343, -0.19053296744823456, -0.9899840354919434, 0.45693451166152954, 0.24406208097934723, -0.20509527623653412, 0.3166804313659668, 1.3688212633132935...
func (dd *DynamoDBManager) getPricingWriteFilterInput() pricing.GetProductsInput { input := pricing.GetProductsInput{ ServiceCode: awsClient.String(dd.servicePricingCode), Filters: []*pricing.Filter{ { Type: awsClient.String("TERM_MATCH"), Field: awsClient.String("termType"), Value: awsClient.Stri...
[ -1.3169832229614258, 0.24213990569114685, 0.7055666446685791, -0.462561696767807, -0.38807904720306396, 0.09008929133415222, 0.46837708353996277, 0.0527772419154644, -0.05785008519887924, -0.2895101308822632, 0.55915766954422, 0.9982838034629822, -0.5679395794868469, -0.7555094957351685, ...
func (dd *DynamoDBManager) getPricingReadFilterInput() pricing.GetProductsInput { input := pricing.GetProductsInput{ ServiceCode: &dd.servicePricingCode, Filters: []*pricing.Filter{ { Type: awsClient.String("TERM_MATCH"), Field: awsClient.String("termType"), Value: awsClient.String("Reserved"), ...
[ -0.9506796002388, 0.24563585221767426, 0.7329812049865723, -0.5150659680366516, -0.7578041553497314, 0.5033050179481506, 0.2024274319410324, -0.24210140109062195, 0.06783376634120941, -0.3999708294868469, 0.927061915397644, 0.9604257941246033, -0.2933638095855713, -0.9354590773582458, 0....
func (dd *DynamoDBManager) describeTables(exclusiveStartTableName *string, tables []*dynamodb.TableDescription) ([]*dynamodb.TableDescription, error) { input := &dynamodb.ListTablesInput{ ExclusiveStartTableName: exclusiveStartTableName, } resp, err := dd.client.ListTables(input) if err != nil { log.WithField...
[ -0.8022940754890442, 0.8988364338874817, 0.7710780501365662, 0.7034924626350403, -0.5247694849967957, 0.1364157646894455, -0.21825802326202393, 0.3231531083583832, 0.4058862626552582, 0.0831250473856926, 0.3531920611858368, 0.4033256471157074, -0.5000010132789612, 1.5714795589447021, -0....
func (s *CallerIDsService) AddCallerID(params AddCallerIDParams) (*AddCallerIDReturn, *structure.VError, error) { req, err := s.client.NewRequest("POST", "AddCallerID", params) if err != nil { return nil, nil, err } response := &AddCallerIDReturn{} verr, err := s.client.MakeResponse(req, response) if verr != ni...
[ -1.5324938297271729, -0.007304261904209852, 0.628368616104126, 0.11213517934083939, -0.18556219339370728, 0.734596312046051, -0.2257477045059204, -0.6434054374694824, 0.8205974102020264, -0.26229017972946167, -0.4934263229370117, 0.8371332287788391, -1.5510821342468262, 0.7621093988418579,...
func (s *CallerIDsService) ActivateCallerID(params ActivateCallerIDParams) (*ActivateCallerIDReturn, *structure.VError, error) { req, err := s.client.NewRequest("POST", "ActivateCallerID", params) if err != nil { return nil, nil, err } response := &ActivateCallerIDReturn{} verr, err := s.client.MakeResponse(req,...
[ -1.527772307395935, -0.56552654504776, 0.4939030408859253, 0.030929813161492348, 0.11522871255874634, 0.01944916881620884, -0.17443227767944336, -0.26816892623901367, 0.7335425615310669, 0.16335873305797577, -0.7328543066978455, 1.6825127601623535, -1.2193386554718018, 0.38185548782348633,...
func (s *CallerIDsService) DelCallerID(params DelCallerIDParams) (*DelCallerIDReturn, *structure.VError, error) { req, err := s.client.NewRequest("POST", "DelCallerID", params) if err != nil { return nil, nil, err } response := &DelCallerIDReturn{} verr, err := s.client.MakeResponse(req, response) if verr != ni...
[ -1.3576383590698242, -0.2300650030374527, 0.5345319509506226, -0.007151748985052109, -0.35535791516304016, 0.33024832606315613, -0.22261583805084229, -0.24511472880840302, 0.8488474488258362, -0.006973420735448599, -0.4071424901485443, 1.3570805788040161, -1.3475596904754639, 0.93615490198...