text
stringlengths
11
6.3k
embedding
listlengths
768
768
func (o *CurrentChartDataMinutely) Update(exec boil.Executor, columns boil.Columns) (int64, error) { currTime := time.Now().In(boil.GetLocation()) o.UpdatedAt = currTime var err error if err = o.doBeforeUpdateHooks(exec); err != nil { return 0, err } key := makeCacheKey(columns, nil) currentChartDataMinutely...
[ -1.3289616107940674, -0.348911315202713, 0.6006848216056824, -0.5818654298782349, -0.6172560453414917, -0.33645638823509216, 0.289931058883667, -0.5328691005706787, -0.07307508587837219, 0.3329348862171173, -0.5555020570755005, 0.9943786263465881, -0.22844521701335907, 0.04820311442017555,...
func (q currentChartDataMinutelyQuery) UpdateAll(exec boil.Executor, cols M) (int64, error) { queries.SetUpdate(q.Query, cols) result, err := q.Query.Exec(exec) if err != nil { return 0, errors.Wrap(err, "models: unable to update all for current_chart_data_minutely") } rowsAff, err := result.RowsAffected() if...
[ -0.27278098464012146, -0.5995709300041199, 0.7246542572975159, 0.11679217219352722, -0.4552784860134125, -0.3013702929019928, -0.27172359824180603, -0.20511695742607117, -0.2836459279060364, 0.2272077202796936, -0.016407879069447517, 0.6013364195823669, -0.09850730001926422, 0.284961700439...
func (o CurrentChartDataMinutelySlice) UpdateAll(exec boil.Executor, cols M) (int64, error) { ln := int64(len(o)) if ln == 0 { return 0, nil } if len(cols) == 0 { return 0, errors.New("models: update all requires at least one column argument") } colNames := make([]string, len(cols)) args := make([]interfac...
[ -0.6506596803665161, -0.4499035179615021, 1.1073994636535645, 0.15575352311134338, -0.3712821304798126, -0.5739175081253052, 0.023881079629063606, -0.12259157001972198, -0.4445783793926239, 0.47354209423065186, -0.3705187439918518, 0.5946986675262451, -0.15863272547721863, 0.24729508161544...
func (o *CurrentChartDataMinutely) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error { if o == nil { return errors.New("models: no current_chart_data_minutely provided for upsert") } currTime := time.Now().In(boil.GetLocation()) if o.Crea...
[ -0.7402557134628296, -0.25737953186035156, 0.750278651714325, -0.46953272819519043, -0.049376584589481354, -0.48944777250289917, 0.06232341378927231, -0.44361886382102966, -0.5486330389976501, 0.12201328575611115, -0.7160754799842834, 0.11136551201343536, -0.43389129638671875, -0.032083258...
func (o *CurrentChartDataMinutely) Delete(exec boil.Executor) (int64, error) { if o == nil { return 0, errors.New("models: no CurrentChartDataMinutely provided for delete") } if err := o.doBeforeDeleteHooks(exec); err != nil { return 0, err } args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf...
[ -0.11915752291679382, 0.027079207822680473, 0.7542918920516968, -0.33683156967163086, -0.0345064252614975, -0.8538471460342407, 0.5460112690925598, -0.26115623116493225, 0.013253975659608841, 0.4144912362098694, 0.04163479059934616, 0.45927125215530396, -0.4658396244049072, 0.1598931998014...
func (q currentChartDataMinutelyQuery) DeleteAll(exec boil.Executor) (int64, error) { if q.Query == nil { return 0, errors.New("models: no currentChartDataMinutelyQuery provided for delete all") } queries.SetDelete(q.Query) result, err := q.Query.Exec(exec) if err != nil { return 0, errors.Wrap(err, "models:...
[ 0.1371489018201828, -0.42792266607284546, 0.6816005706787109, -0.42284896969795227, -0.2590176463127136, -0.3127254843711853, -0.08602310717105865, -0.1797303706407547, 0.24011974036693573, -0.3111408054828644, 0.36538615822792053, 0.7887000441551208, 0.11796274781227112, 1.094544529914856...
func (o CurrentChartDataMinutelySlice) DeleteAll(exec boil.Executor) (int64, error) { if o == nil { return 0, errors.New("models: no CurrentChartDataMinutely slice provided for delete all") } if len(o) == 0 { return 0, nil } if len(currentChartDataMinutelyBeforeDeleteHooks) != 0 { for _, obj := range o { ...
[ -0.23429545760154724, -0.48737192153930664, 0.9570634961128235, 0.009886403568089008, -0.13464900851249695, -0.5564736127853394, 0.3893537223339081, -0.14191240072250366, -0.05179430916905403, 0.26696163415908813, 0.1397935003042221, 0.511734664440155, 0.09662307053804398, 0.83380484580993...
func (o *CurrentChartDataMinutely) Reload(exec boil.Executor) error { ret, err := FindCurrentChartDataMinutely(exec, o.ID) if err != nil { return err } *o = *ret return nil }
[ -0.14765210449695587, 0.33847397565841675, 0.5550702810287476, 0.22778335213661194, 0.19891804456710815, -0.18681418895721436, 0.8093744516372681, -0.7466729283332825, -0.4334316849708557, -0.2279530018568039, 0.009156493470072746, 1.1703836917877197, -0.08602602034807205, -0.5513764619827...
func (o *CurrentChartDataMinutelySlice) ReloadAll(exec boil.Executor) error { if o == nil || len(*o) == 0 { return nil } slice := CurrentChartDataMinutelySlice{} var args []interface{} for _, obj := range *o { pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), currentChartDataMinute...
[ -0.3442331552505493, -0.04727485403418541, 0.8077225089073181, 0.4466623365879059, -0.39715346693992615, -0.3728771209716797, -0.1620272994041443, -0.6422311663627625, -0.26033490896224976, 0.3600163757801056, -0.4209935665130615, 0.7251818776130676, -0.03169774264097214, 0.699155449867248...
func CurrentChartDataMinutelyExists(exec boil.Executor, iD int) (bool, error) { var exists bool sql := "select exists(select 1 from \"current_chart_data_minutely\" where \"id\"=$1 limit 1)" if boil.DebugMode { fmt.Fprintln(boil.DebugWriter, sql) fmt.Fprintln(boil.DebugWriter, iD) } row := exec.QueryRow(sql, ...
[ -0.879096508026123, -0.6935989260673523, 0.7680022120475769, -1.0214283466339111, 0.3259972035884857, -0.1561676561832428, -0.4512748420238495, -0.5052619576454163, -0.1930915117263794, 0.05463462695479393, -0.4968366026878357, 0.32467952370643616, -0.3766941726207733, -0.09685761481523514...
func (m *LinksFull) Validate(formats strfmt.Registry) error { return nil }
[ 0.6774172782897949, 0.2783302962779999, 0.2521269619464874, -0.3254491984844208, 0.7257164716720581, 0.15663780272006989, 0.5275999903678894, 0.7108286619186401, -0.16624882817268372, -0.950944185256958, -0.06976287811994553, 0.49641600251197815, -0.5355085730552673, 0.7563123106956482, ...
func New() *NestedParties { var m NestedParties return &m }
[ 0.5147004127502441, -1.3188507556915283, 0.05417736619710922, -0.8524680733680725, -0.1708924025297165, 0.3092983365058899, -0.5563499331474304, 0.08285821974277496, -1.1148371696472168, -1.0699496269226074, -0.23173627257347107, 0.8188360333442688, -0.8473808765411377, -0.1298533231019973...
func NewNoNestedPartyIDs() *NoNestedPartyIDs { var m NoNestedPartyIDs return &m }
[ -0.6376473903656006, -1.1033164262771606, 0.08436144143342972, -0.9233741760253906, -0.6380952000617981, -0.0684821680188179, -0.7979477047920227, -0.22520853579044342, -0.9771571159362793, -0.11404596269130707, -0.840937077999115, 1.0908704996109009, -1.4435508251190186, 0.421724826097488...
func NewNoNestedPartySubIDs() *NoNestedPartySubIDs { var m NoNestedPartySubIDs return &m }
[ -0.12184353172779083, -0.4447542726993561, 0.2534893751144409, -0.35967665910720825, -0.4439008831977844, 0.3820343315601349, -0.6418468356132507, -0.5392031073570251, -1.1133430004119873, -1.168828010559082, -0.49765756726264954, 0.4785463809967041, -1.2274153232574463, 0.2474276572465896...
func waitQtumRCBalance(t *testing.T, ctx context.Context, token *erc20.Erc20, before *big.Int, target int64) { ctx, cancel := context.WithTimeout(ctx, 60*time.Second) defer cancel() err := wait.PollUntil(1*time.Second, func() (bool, error) { after, err := token.BalanceOf(nil, devnet.QtumClientMinerAddress) if ...
[ 0.21952857077121735, -0.29566827416419983, 0.8727664947509766, -1.8921786546707153, 0.2524549067020416, 0.34639638662338257, -0.3896838426589966, -1.2332799434661865, 0.22173535823822021, -0.6173974871635437, 0.04262993112206459, 0.08235065639019012, -0.22181133925914764, -0.23047725856304...
func NewRouter(s *Service, routes Routes, middleware ...mux.MiddlewareFunc) *mux.Router { router := mux.NewRouter().StrictSlash(true) for _, route := range routes { var handler http.Handler handler = route.ServiceHandler(s) for _, mw := range middleware { handler = mw(handler) } handler = Logger(handler,...
[ 0.010265551507472992, -0.21117888391017914, 0.31481021642684937, 0.38255685567855835, -1.3799854516983032, 0.07985997945070267, -0.5725338459014893, 0.5300930142402649, 0.2560396194458008, -0.41453418135643005, 0.46613577008247375, 0.60336834192276, 0.3287369906902313, 0.557255744934082, ...
func (c *Client) GetStats() (*Tasks, error) { qp := map[string]string{ "skip": "0", "take": "0", } resp, err := c.DoGetRequest("tasks", qp) if err != nil { return nil, err } tasks := Tasks{} err = json.NewDecoder(resp.Body).Decode(&tasks) if err != nil { return nil, err } return &tasks, nil }
[ -0.11773619055747986, 1.0443300008773804, 0.49254241585731506, -0.21802718937397003, 0.19160740077495575, -0.17305752635002136, -0.07756368070840836, -0.9861695766448975, 0.3568210005760193, -0.3650107979774475, -0.49097198247909546, 0.8821991682052612, -0.3893045485019684, 0.1377294808626...
func (c *Client) GetAll() (*[]Task, error) { qp := map[string]string{ "skip": "0", "take": "2147483647", } resp, err := c.DoGetRequest("tasks", qp) if err != nil { return nil, err } tasks := Tasks{} err = json.NewDecoder(resp.Body).Decode(&tasks) if err != nil { return nil, err } return &tasks.Items...
[ 0.4050212502479553, 0.5300736427307129, 0.8968929052352905, 0.8099464178085327, 0.6989846229553223, 0.646052896976471, -0.3808574378490448, -0.0563957542181015, -0.09776641428470612, 0.15765315294265747, -1.0555423498153687, 0.9462201595306396, -0.3326893448829651, 0.6981655359268188, 0....
func (c *Client) GetFiltered(qp map[string]string) ([]Task, error) { resp, err := c.DoGetRequest("tasks", qp) if err != nil { return nil, err } tasks := Tasks{} err = json.NewDecoder(resp.Body).Decode(&tasks) if err != nil { return nil, err } return tasks.Items, nil }
[ 0.17658764123916626, 0.44476935267448425, 0.7980940937995911, 0.21673473715782166, 0.0038344673812389374, 0.0769069492816925, -0.1215466782450676, -0.954136073589325, -0.19299106299877167, 0.370278000831604, -1.2893579006195068, 1.2225298881530762, -0.26084035634994507, 0.38469579815864563...
func (c *Client) GetByID(ID string) (*Task, error) { qp := map[string]string{} resp, err := c.DoGetRequest("tasks"+ID, qp) if err != nil { return nil, err } task := Task{} err = json.NewDecoder(resp.Body).Decode(&task) if err != nil { return nil, err } return &task, nil }
[ 0.37994882464408875, 0.45070168375968933, 0.46346405148506165, -0.38498514890670776, 0.010495970025658607, -0.029608191922307014, -0.08677242696285248, -0.7915013432502747, 0.001059061149135232, 0.29096874594688416, -1.4012609720230103, 1.4438034296035767, -0.49874547123908997, -0.08930931...
func (a *JWTAuth) AuthMiddleware() gin.HandlerFunc { return func(c *gin.Context) { // just handle the simplest case, authorization is not provided. h := c.GetHeader("Authorization") if h == "" { c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"message": "empty header was sent", "code": "unauthorized"...
[ 0.24348559975624084, -0.27707526087760925, 0.6808044910430908, 0.7966101765632629, -0.5199987888336182, -0.25435471534729004, -0.12394635379314423, 0.06892147660255432, 1.0904974937438965, 0.07477278262376785, 0.5242067575454712, 0.8939223289489746, 0.04084242880344391, 0.5382088422775269,...
func GenerateSecretKey(n int) ([]byte, error) { key := make([]byte, n) if _, err := rand.Read(key); err != nil { return nil, err } return key, nil }
[ -0.890082061290741, 0.916814923286438, 0.4633382558822632, 0.32566431164741516, 0.7144363522529602, 0.2290426343679428, -0.7997843623161316, -0.2137187421321869, 0.42042750120162964, 0.013966010883450508, -1.5992801189422607, -0.0005878456286154687, -0.39692017436027527, 1.053623080253601,...
func NoebsCors(headers []string) func(c *gin.Context) { cors := strings.Join(headers, ",") return func(c *gin.Context) { if c.Request.Method != "OPTIONS" { c.Header("Access-Control-Allow-Origin", cors) c.Next() } else { c.Header("Access-Control-Allow-Origin", cors) c.Header("Access-Control-Allow-Metho...
[ -0.4883195161819458, -0.3518676161766052, 1.1041072607040405, -0.5627362728118896, -0.19705811142921448, 0.1817818135023117, -0.033995550125837326, -1.1493624448776245, -0.0639321357011795, 0.40296414494514465, 0.8418598771095276, -0.6145827174186707, 0.11030162125825882, -0.04658655822277...
func WithDatabase(db string) Option { return func(opt *options) { opt.database = db } }
[ 0.15916228294372559, 0.0607006661593914, 0.23625338077545166, -0.014238734729588032, 0.11402378231287003, 0.13974231481552124, 0.1868228018283844, -0.2748468518257141, 0.907128632068634, 0.17555655539035797, -0.5797151923179626, -1.0270733833312988, -0.22971253097057343, 0.5049271583557129...
func WithNoDelay(noDelay bool) Option { return func(opt *options) { opt.noDelay = noDelay } }
[ 1.1076650619506836, 0.1952914297580719, 0.4173933267593384, -0.587213933467865, -1.236187219619751, 0.30410104990005493, -0.16689647734165192, -0.6456946134567261, 0.7460137605667114, -0.4106399416923523, -0.36390912532806396, -0.52460116147995, -0.007625924423336983, 0.6924424767494202, ...
func WithAltHosts(altHosts string) Option { return func(opt *options) { opt.altHosts = altHosts } }
[ 0.005811538081616163, -0.024988701567053795, 0.4641769528388977, -0.23138612508773804, -0.2398160696029663, 0.7360910177230835, -0.7657129764556885, -0.5524592399597168, 0.793155312538147, 0.3525683879852295, 0.027561651542782784, 0.08366099745035172, 0.40932539105415344, 0.754012405872345...
func WithBlockSize(blockSize int) Option { return func(opt *options) { opt.blockSize = blockSize } }
[ 0.5162471532821655, 0.49316155910491943, 0.6602967977523804, 0.42846131324768066, -0.4742045998573303, -0.53599613904953, 0.38598397374153137, -0.8071098327636719, 0.8102806806564331, 0.38852861523628235, -0.4023784399032593, -0.4296589493751526, -0.11668696254491806, 0.04140489175915718, ...
func WithPoolSize(poolSize int) Option { return func(opt *options) { opt.poolSize = poolSize } }
[ 0.38448771834373474, 0.08846466988325119, 0.5441821217536926, -0.39531293511390686, -0.7226102352142334, -0.13978147506713867, 0.8203698396682739, -0.47584930062294006, 1.0611488819122314, -0.04752180352807045, -0.7026656270027161, -0.22483447194099426, 0.44360265135765076, -0.182895347476...
func slidingPuzzle(board [][]int) int { }
[ -0.45243024826049805, 1.1682331562042236, 0.5019459128379822, 0.9891452789306641, -1.131248950958252, -0.3886893391609192, 1.9921095371246338, 0.9131754636764526, -0.08761729300022125, 0.36281684041023254, -0.44958770275115967, -0.7473816871643066, -1.0144555568695068, -0.15359605848789215...
func (kv *RaftKV) Kill() { kv.rf.Kill() close(kv.kvraftShutdownChannel) }
[ 0.21067501604557037, -0.257703572511673, 0.2649390399456024, 1.1403383016586304, 0.5178677439689636, 0.4182371199131012, -0.1927933543920517, 0.1445240080356598, -0.42348355054855347, 0.5198026895523071, 0.380929172039032, -0.3242180347442627, -0.4584781229496002, 0.5420836210250854, -0....
func StartKVServer(servers []*labrpc.ClientEnd, me int, persister *raft.Persister, maxraftstate int) *RaftKV { // call gob.Register on structures you want // Go's RPC library to marshall/unmarshall. gob.Register(Op{}) kv := new(RaftKV) kv.me = me kv.maxraftstate = maxraftstate kv.applyCh = make(chan raft.Apply...
[ 0.535627007484436, 0.37694069743156433, 0.8479838967323303, 0.25905266404151917, -0.17211849987506866, -0.5010240077972412, 0.06386557221412659, 0.045940056443214417, 0.4226821959018707, -0.2166345715522766, -0.014898736961185932, 0.21073104441165924, -0.45632296800613403, 0.84411376714706...
func VertialBarSeparator() TableOption { return func(opts *options) { opts.separator = " │ " } }
[ 0.336763858795166, -0.23095187544822693, 0.3350001275539398, 0.4171590209007263, -0.6934037208557129, 0.477707177400589, -0.013825804926455021, -0.10035514086484909, -0.15805184841156006, 0.310652494430542, 0.1266670674085617, -0.9006558060646057, -0.4511584937572479, 0.2592814564704895, ...
func CustomSeparator(separator string) TableOption { return func(opts *options) { opts.separator = separator } }
[ -0.33501026034355164, -0.022853631526231766, 0.4670218527317047, 0.05951136723160744, -1.2466504573822021, -0.47608065605163574, -0.6892783641815186, 0.35343268513679504, 0.6694344282150269, -0.20059090852737427, -0.2157864272594452, -0.2638445496559143, -0.12633773684501648, 0.41698157787...
func DesiredWidth(width int) TableOption { return func(opts *options) { opts.desiredRowWidth = width } }
[ 0.1918552815914154, 0.7695952653884888, 0.45040163397789, 0.9153966903686523, 0.07490704208612442, -0.19346722960472107, 0.5910359621047974, 0.1608341932296753, 0.6485835313796997, -1.1360127925872803, 0.05384427309036255, -0.18172791600227356, -0.3061869442462921, 0.4193018674850464, -0...
func AlignRight(cols ...int) TableOption { return func(opts *options) { for _, col := range cols { if col < 0 || col >= len(opts.columnAlignment) { opts.errors = append(opts.errors, &ColumnIndexIsOutOfBoundsError{col}) } else { opts.columnAlignment[col] = Right } } } }
[ -0.5153141021728516, 0.04858013987541199, 0.5761870741844177, 0.7710871696472168, -0.4736575186252594, 0.4320555329322815, 0.27546370029449463, -0.45248863101005554, -0.5390993356704712, 0.06567981094121933, 0.18935959041118622, -0.20457307994365692, 0.05945204198360443, 0.1297660171985626...
func AlignCenter(cols ...int) TableOption { return func(opts *options) { for _, col := range cols { if col < 0 || col >= len(opts.columnAlignment) { opts.errors = append(opts.errors, &ColumnIndexIsOutOfBoundsError{col}) } else { opts.columnAlignment[col] = Center } } } }
[ -0.17056609690189362, -0.5274999141693115, 0.5821769833564758, 0.5744955539703369, -0.19132447242736816, 0.4545494318008423, 0.4618525505065918, 0.3648127019405365, 0.04311712458729744, 0.45604774355888367, 0.4206277132034302, -0.3457787036895752, 0.12685813009738922, 0.23638632893562317, ...
func OmitLinefeedAtTableEnd() TableOption { return func(opts *options) { opts.omitLinefeedAtEnd = true } }
[ 0.7140743136405945, -0.28794795274734497, 0.5874457359313965, 0.2630356550216675, -0.47512951493263245, 1.0029042959213257, -0.28644928336143494, 0.28422829508781433, -0.8551673889160156, 0.1996142864227295, -0.35974404215812683, -0.45554524660110474, -0.8452394604682922, 0.509846627712249...
func LimitRows(limit int) TableOption { return func(opts *options) { opts.rowLimit = limit } }
[ 0.5285248160362244, 1.1439464092254639, 0.4637862741947174, -0.15802110731601715, -0.32509663701057434, -0.008392428047955036, -0.19549494981765747, 0.654184877872467, 1.005768895149231, -0.19417615234851837, 0.4255731403827667, 0.05929068103432655, -0.4736636281013489, -0.2578396797180176...
func Table(table [][]string, tableOptions ...TableOption) (string, error) { maxs, err := lookupMaxLengthPerColumn(table) if err != nil { return "", err } cols := len(maxs) options := defaultOptions(cols) for _, userOption := range tableOptions { userOption(&options) } if len(options.errors) > 0 { retur...
[ 0.6046322584152222, 0.3829501271247864, 0.9943157434463501, 0.566220760345459, -0.5318357348442078, -0.45561957359313965, 0.3232315182685852, -0.7536360621452332, 0.2735610902309418, 0.48273760080337524, 0.3372412323951721, -0.5544333457946777, 0.3114160895347595, -0.17762534320354462, -...
func (u data) findPendingApplication(email string) (application Application, err error) { record := u.db.Preload("ChangeHistory", func(db *gorm.DB) *gorm.DB { return db.Order("change_history.id ASC") }).Preload("ChangeHistory.Nodes").Preload("ChangeHistory.Images").Where("username = ? and current_status = 0", Norma...
[ -0.09739778190851212, -0.10034690052270889, 0.5280519127845764, -0.308413565158844, -0.39675477147102356, 0.04403749480843544, 0.4695536494255066, -0.5364630818367004, -0.2598145306110382, 0.9911926984786987, 0.5682581663131714, 0.003011916298419237, -0.433937132358551, 1.3217836618423462,...
func (u data) getAllWhitelists() ([]Application, error) { var applications []Application record := u.db.Unscoped().Find(&applications) if record.RecordNotFound() { return nil, errCannotLoadWhitelists } if errs := record.GetErrors(); len(errs) > 0 { for err := range errs { log.Error("Error while fetching app...
[ -0.25291600823402405, -0.2642625868320465, 0.7118926048278809, 0.3181357979774475, 0.24742454290390015, 0.38486337661743164, -0.37704747915267944, -0.6856729984283447, 0.7088735103607178, 0.3494642674922943, 0.35330930352211, 1.4380751848220825, -0.5935657024383545, 1.8771165609359741, -...
func (store *Store) GetEvents(sessionID string) ([]*models.Event, error) { events, err := store.connection.XRange(sessionID, "-", "+").Result() if err != nil { return nil, err } deserializedEvents := make([]*models.Event, len(events)) for i, event := range events { deserializedEvents[i] = models.DeserializeRe...
[ -0.23190198838710785, 0.09092406928539276, 0.5123497843742371, -0.20154505968093872, 0.1926332414150238, -0.7950966954231262, -0.5101359486579895, -0.38354113698005676, 1.617067575454712, -0.08104778826236725, -0.4860173165798187, 0.4542006552219391, -0.49407142400741577, 0.310690432786941...
func (store *Store) AppendEvent(sessionID string, event *models.Event) error { return store.connection.XAdd(event.SerializeRedisStream()).Err() }
[ 0.46114787459373474, 0.23307324945926666, 0.3188384473323822, -0.08435027301311493, 0.294925332069397, 0.14055874943733215, -1.052743673324585, 0.48134008049964905, 1.5893566608428955, -0.5275259017944336, -0.3510805666446686, 0.267983078956604, -0.1917887032032013, 0.5109051465988159, 0...
func (r repository) Product(productId string) (*model.Product, error) { filter := bson.M{ "product_id": productId, "price": bson.M{ "$exists": true, }, } ctx, _ := context.WithTimeout(context.Background(), 1*time.Second) result := r.collection.FindOne(ctx, filter) if result.Err() != nil { if result.E...
[ -0.4801805317401886, 0.3038094937801361, 0.44325655698776245, 0.4339050352573395, 0.8426426649093628, 0.6405618786811829, 0.6777346730232239, -1.1356737613677979, 0.5013840794563293, 0.5243636965751648, 0.3462914824485779, -0.13879193365573883, -0.6785207986831665, 0.5881662964820862, -0...
func (symlink *Symlink) Availible() bool { return paths.Exists(symlink.Source) }
[ -0.009105178527534008, 0.1085735559463501, 0.24045322835445404, -0.9698354005813599, -0.12642502784729004, -0.5516246557235718, 0.3484379053115845, 1.4886444807052612, -0.5886297821998596, 1.133166790008545, -0.7309039235115051, 0.21268899738788605, -0.041820622980594635, 0.738126993179321...
func (symlink *Symlink) LinkDomainToProxyIfNotLinked() { if !symlink.domain.PathExists() { log.Printf("[domain: %s] domain path did not exist, linking to source", symlink.domain.Name) os.Symlink(symlink.Proxy, symlink.domain.Path) return } if paths.Exists(symlink.domain.TemporaryFlag()) { log.Printf("[domain...
[ -0.021808182820677757, 0.09066224843263626, 0.517742395401001, -1.4168468713760376, 0.5344411134719849, 0.1317608654499054, 0.8136470317840576, 0.7139593362808228, 1.0224103927612305, -0.7680920362472534, -0.04834785684943199, 0.024423999711871147, 0.22846774756908417, 0.8057678937911987, ...
func (symlink *Symlink) UnlinkDomainFromProxyIfLinked() { if paths.IsSymlink(symlink.domain.Path) { log.Printf("[domain: %s] symlink source went away, removing symlink", symlink.domain.Name) os.Remove(symlink.domain.Path) } }
[ 0.6446493268013, 0.06934134662151337, 0.19229833781719208, -1.5560636520385742, 0.18870677053928375, -0.6260337233543396, 1.1782695055007935, 1.3059850931167603, 0.9562616348266602, -1.0421299934387207, 0.39916446805000305, 0.7836952209472656, -0.31471529603004456, 0.7438235878944397, -0...
func (*ListGroupsRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ListGroupsRequest_OneofMarshaler, _ListGroupsRequest_OneofUnmarshaler, _ListGroupsRequest_OneofSiz...
[ -1.2440241575241089, 0.9652431607246399, 0.603150486946106, -0.4524925947189331, -0.1279149353504181, -1.3087188005447388, -0.15315768122673035, -1.6272344589233398, 0.670035183429718, -1.0267541408538818, 0.09158480167388916, 0.31230753660202026, -0.32585659623146057, 1.0217719078063965, ...
func (q *Queue) Push(data int) { q.data = append(q.data, data) q.length++ }
[ -0.21630007028579712, 0.8903497457504272, 0.1329347789287567, -1.2632120847702026, -0.4692224860191345, 0.32171595096588135, -0.974061131477356, -1.0547685623168945, 0.1343589425086975, -0.408066987991333, -1.3792610168457031, 1.4061272144317627, -0.3684672713279724, 0.7021405696868896, ...
func (q *Queue) Shift() { q.data = q.data[:len(q.data)-1] q.length-- }
[ -0.28035688400268555, -0.43180182576179504, 0.5226175785064697, -0.41506245732307434, 0.07298201322555542, 1.4567219018936157, -1.280599594116211, -0.3263062536716461, 0.26184287667274475, -0.7492855191230774, -0.5732603669166565, 1.2185540199279785, -0.7188614010810852, 0.6139334440231323...
func NewQueue() Queue { var empty []int return Queue{empty, len(empty)} }
[ -0.606309711933136, -0.7663220167160034, 0.4145648777484894, 0.3703474998474121, 0.058691881597042084, -0.379316121339798, -0.17382007837295532, 0.29526203870773315, 0.08066481351852417, -0.7933364510536194, -0.6490374803543091, 0.8734502792358398, -0.012880804017186165, 0.8112547397613525...
func (in *CF1454B) Run() { t := in.NextInt() //fmt.Println("t : " , t) for ; t > 0; t-- { n := in.NextInt() //fmt.Println("n : " , n) count := make(map[int]int) time := make(map[int]int) for i := 0; n > 0; n-- { value := in.NextInt() //fmt.Println("value : " , value) c, ok := count[value] if !o...
[ -1.257136583328247, 0.2258770614862442, 0.7395296692848206, -0.04604879021644592, 0.3659624755382538, -0.17611560225486755, 1.2275253534317017, 0.16754525899887085, -1.0359413623809814, 0.15346886217594147, -0.7401569485664368, -0.28087589144706726, -0.5948472023010254, 1.3638854026794434,...
func (s *customizeRdsStore) Set(id string, value string) { err := s.redisClient.Set(id, value, time.Minute*10).Err() if err != nil { panic(err) } }
[ -0.2542300820350647, 1.0229461193084717, 0.06144488602876663, -0.8444830775260925, -0.16126012802124023, -0.31494924426078796, -1.0682871341705322, 0.06451236456632614, 0.06178487464785576, 0.2515293061733246, -0.7174707055091858, 0.8583752512931824, -0.22710540890693665, -0.10180640220642...
func (s *customizeRdsStore) Get(id string, clear bool) (value string) { val, err := s.redisClient.Get(id).Result() if err != nil { // TODO 这里区分不存在还是出错 return "" } if clear { err := s.redisClient.Del(id).Err() if err != nil { panic(err) } } return val }
[ -0.7316346764564514, 1.531715750694275, 0.6364902853965759, -0.5724818110466003, -1.2927950620651245, -0.5060083270072937, -0.942894697189331, -0.3822673261165619, 0.6917043328285217, 0.5794649124145508, 0.05406280606985092, 0.8121243715286255, -0.05616593360900879, -0.10329935699701309, ...
func NewMockRandomGenerator(ctrl *gomock.Controller) *MockRandomGenerator { mock := &MockRandomGenerator{ctrl: ctrl} mock.recorder = &MockRandomGeneratorMockRecorder{mock} return mock }
[ -0.3755328059196472, 0.19886213541030884, 0.24628841876983643, 0.20860452950000763, -1.4062455892562866, -0.0821089893579483, 0.5555331110954285, 0.2248544543981552, 0.5759223103523254, -0.3089386522769928, -0.40218818187713623, -0.785506010055542, -0.8546815514564514, 1.644212245941162, ...
func (m *MockRandomGenerator) EXPECT() *MockRandomGeneratorMockRecorder { return m.recorder }
[ -0.36753562092781067, 0.2064773440361023, 0.39675191044807434, -0.2940484285354614, -0.07060397416353226, 0.3934710621833801, 0.4019617438316345, 0.34864044189453125, 0.14324355125427246, -0.585991621017456, 0.683314323425293, 0.5381362438201904, -0.9773870706558228, 0.7898919582366943, ...
func (m *MockRandomGenerator) Do(length int) string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Do", length) ret0, _ := ret[0].(string) return ret0 }
[ -0.4355321526527405, 0.30917662382125854, 0.2530907690525055, 0.14851149916648865, 0.5843099355697632, 0.7025229334831238, 0.31685811281204224, -0.8714762926101685, -0.7780042290687561, -0.06450610607862473, -0.7178983688354492, -0.3578188121318817, -0.5408128499984741, 0.7202281951904297,...
func (mr *MockRandomGeneratorMockRecorder) Do(length interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockRandomGenerator)(nil).Do), length) }
[ -0.1774725317955017, 1.1597620248794556, 0.17949295043945312, -0.12629170715808868, 0.03476213291287422, 0.8472797274589539, -0.4330475628376007, -1.5375491380691528, 0.2411772608757019, 0.47967809438705444, -0.051150787621736526, 0.45917075872421265, -0.5579022765159607, 1.271283984184265...
func buildFilterData(columns []ColumnSchema, index int, filters []Filters) []Filters { filters = append(filters, Filters{ Id: columns[index].Field, Label: columns[index].Name, Type: columns[index].Type, Input: buildInput(columns[index].Type, columns[index].Values), Values: buildValues(columns[index].Values),...
[ -1.3808438777923584, -0.26080816984176636, 0.5186327695846558, -0.09562835842370987, 0.24861039221286774, -0.023329755291342735, -0.6068889498710632, -0.19570893049240112, -0.09145036339759827, -0.10791727900505066, -0.7453362345695496, 0.7680804133415222, 0.14260149002075195, -0.602688729...
func buildGridColumnsData(columns []ColumnSchema ,index int, cols []interface{})[]interface{}{ cols = append(cols, ColumnDefinition{ Text: columns[index].Name, DataIndex: columns[index].Field, Width : 120, Sortable:true, DataType: columns[index].Type, }) return cols; }
[ -0.9211341142654419, -0.15175826847553253, 0.40180304646492004, -0.6896483898162842, 1.053684115409851, 0.4910069704055786, -0.6316043734550476, -0.48731768131256104, -0.03432249277830124, -0.07070918381214142, -0.9355525374412537, 0.6131875514984131, 0.03763825446367264, -0.61693930625915...
func rabbitConnector(uri string) { var rabbitErr *amqp.Error var rabbitConn *amqp.Connection go func() { for { rabbitErr = <-rabbitCloseError if rabbitErr != nil { core.SendMessage("Connecting to RabbitMQ") rabbitConn = connectToRabbitMQ(uri) rabbitCloseError = make(chan *amqp.Error) ...
[ -0.5515556931495667, -0.6512853503227234, 0.7850257754325867, -0.41339486837387085, -0.22760914266109467, -0.034627515822649, -0.23153921961784363, -0.032670874148607254, -0.5414713621139526, 0.05616743117570877, 0.16668982803821564, 0.294251948595047, -0.8198575973510742, 0.05166727676987...
func connectToRabbitMQ(uri string) *amqp.Connection { for { conn, err := amqp.Dial(uri) if err == nil { return conn } core.CheckError(err) core.SendMessage("Trying to reconnect to RabbitMQ") time.Sleep(500 * time.Millisecond) } }
[ -0.5884872078895569, -1.0274217128753662, 0.5163431763648987, -0.11846866458654404, 0.2875083088874817, -0.1998567283153534, -0.39927566051483154, -0.8738826513290405, -0.39624014496803284, 0.8301859498023987, 0.5496596097946167, 0.453775554895401, -0.8052417635917664, -0.4168540835380554,...
func NewMethods(ss map[string]MethodFactoryFunc, logger *zap.SugaredLogger) *methods { return &methods{ ss: ss, logger: logger, } }
[ 0.38627591729164124, -0.08733360469341278, 0.10411328822374344, 0.5958750247955322, -0.7875120639801025, -0.889315128326416, -0.2434309422969818, -0.5526096820831299, 0.28339773416519165, -1.0863851308822632, 0.4150089919567108, 0.4317947328090668, 0.1764233112335205, 0.5076433420181274, ...
func (a *methods) GetByKey(w http.ResponseWriter, r *http.Request) { getterKey := r.URL.Query().Get(ParamGetterKey) if getterKey == "" { a.writeErrorResponse(w, http.StatusBadRequest, errors.New("cannot find getter key: empty")) return } actionType := r.URL.Query().Get(ParamMethodKey) if _, ok := a.ss[actionT...
[ -1.3248549699783325, -0.06078548729419708, 0.997408926486969, -0.04174170270562172, -0.1414019912481308, -0.7337093949317932, 0.41269800066947937, -0.7962691187858582, -0.005021487828344107, 1.1001888513565063, -0.3727757930755615, 1.0224666595458984, -0.5526442527770996, 0.928906977176666...
func (s *Scanner) Scan() (*Token, error) { t, err := s.scan() if err != nil { s.prevToken = nil return nil, err } // handle comma insertion s.insertComma(t) if t.Class == nl { // newlines are for internal use only. skip them return s.Scan() } s.prevToken = t return t, err }
[ -0.49250343441963196, 0.006940968334674835, 0.5881561636924744, 0.09462931752204895, -0.8002631664276123, -0.8831355571746826, 0.290457159280777, 0.40120062232017517, -0.07429160922765732, -0.890129566192627, 0.18824553489685059, -0.3484625518321991, -0.35940757393836975, 0.243941187858581...
func (s *Scanner) next() rune { s.prevLine = s.line s.prevColumn = s.column ch, _, err := s.r.ReadRune() if err == io.EOF { return eof } if err != nil { panic(err) } // handle prohibited characters if ch == '\t' || ch == '\r' { s.err = s.prohibitedCharacter(ch) return eof } // update position info...
[ 0.31718775629997253, -0.33571526408195496, 0.597646951675415, 0.2577316462993622, -1.3102467060089111, -0.11242391914129257, -0.14954891800880432, -0.2331378310918808, -0.7098378539085388, -0.6867971420288086, 0.8508435487747192, 0.07895760238170624, 0.417391836643219, -0.5084142088890076,...
func (d *deprecatedTemplate) prune() { for key, blocker := range d.Blockers { for name, job := range blocker.Jobs { if !job.current { delete(d.Blockers[key].Jobs, name) } } if len(blocker.Jobs) == 0 { delete(d.Blockers, key) } } if len(d.Blockers) == 0 { d.Blockers = nil } if d.UnknownBlock...
[ -0.2928871214389801, 0.03599068522453308, 0.7658922672271729, 0.11292455345392227, -0.032148007303476334, -0.9769260287284851, -0.6643720865249634, 0.11331243067979813, -0.6454974412918091, 0.8126116394996643, -0.32456883788108826, -0.2046745866537094, -0.9841043949127197, 0.79855358600616...
func rowExist(user models.ClientUser) bool { query := "Select exists(select 1 from user where username = '" + user.Username + "' AND password = '" + user.Password + "');" var exist bool err := Db.QueryRow(query).Scan(&exist) if err != nil { fmt.Println("rowExist : ", err) return false } if exist { ...
[ -0.11395415663719177, -0.040740128606557846, 0.765125036239624, 0.2238883376121521, 0.8380135893821716, 0.7800883054733276, -0.01830572448670864, 0.6432732343673706, -0.6649312973022461, 1.0919930934906006, 0.34927424788475037, -0.5025811791419983, -0.23709054291248322, 0.673519492149353, ...
func (field *Field) FormatString(margin, pending, size int) (str string) { option := field.Name switch field.FieldType { case OPTION: // --KEY TYPE option = fmt.Sprintf("%*v--%v %v", pending, "", field.Name, field.TypeHint) option = strings.TrimRight(option, " \t\n") // -SHORT TYPE, --KEY TYPE if field.S...
[ -0.029720749706029892, -0.3076707124710083, 0.6123164892196655, -0.9805758595466614, 0.03867022320628166, -0.037378501147031784, -0.08848433941602707, -0.6212469935417175, -0.9878807067871094, 0.037546493113040924, 0.9756080508232117, 0.0647440105676651, 0.12238500267267227, 0.521530330181...
func (field *Field) SetValue(parser *ArgParse, args ...string) (size int, err error) { size = 1 // the basic setter if size, err = field.setValue(field.Value, args...); err != nil { return } if fn := GetCallback(parser.Value, field.Callback); fn != nil { log.Debug("try execute %v", field.Callback) // trigge...
[ -0.23015578091144562, 0.8295297026634216, 0.8922632932662964, 0.28232643008232117, 0.1892746239900589, -0.6932435035705566, 0.49864983558654785, -0.11601375788450241, -0.44881975650787354, 0.4387524724006653, -0.40191566944122314, -0.09726244956254959, -0.8271875381469727, 1.00228989124298...
func (field *Field) setValue(value reflect.Value, args ...string) (size int, err error) { log.Debug("try set value %[1]T (%#v)", value.Interface(), args) switch value.Interface().(type) { case bool: // toggle the boolean value.SetBool(!value.Interface().(bool)) case int, int8, int16, int32, int64, uint, uint8,...
[ -0.9716013669967651, 0.7852686643600464, 0.9510841965675354, -0.35279303789138794, 0.5013136863708496, -0.18706956505775452, 0.3004033863544464, -0.8002018332481384, -0.5013709664344788, 0.628152072429657, 0.12192977964878082, 0.4912812411785126, -0.5672898888587952, 0.5192046761512756, ...
func WidecharSize(widechar string) (siz int) { for _, s := range widechar { siz++ if len(string(s)) > 1 { // detect wide-char siz++ } } return }
[ -0.7783850431442261, -0.473981648683548, 0.5010127425193787, -0.10250391066074371, -0.6135740876197815, -0.7054947018623352, 0.5437070727348328, 0.08651353418827057, 0.8591902852058411, -0.3623409867286682, -1.0673527717590332, -0.09424977749586105, -1.1350916624069214, 0.1620010882616043,...
func Migrate(db *gorm.DB) { db.AutoMigrate(&User{}) fmt.Println("Auto migration has been completed") }
[ -0.5023181438446045, 0.3626519441604614, 0.38137301802635193, 1.9300388097763062, 0.22304145991802216, 0.6540055871009827, 0.2155115306377411, -0.1847272366285324, -0.8312526941299438, -0.05344759672880173, -0.7750707864761353, 0.06390545517206192, -0.3006991744041443, 0.8775562644004822, ...
func NewMockedRepository() *MockedRepository { return &MockedRepository{} }
[ -0.8006141185760498, -0.36181962490081787, 0.12872664630413055, -0.20647861063480377, -0.3567500412464142, -1.0856817960739136, 0.5559607744216919, -0.005105169955641031, 0.8547457456588745, -0.6774140000343323, -0.9890642762184143, -0.0006884251488372684, -0.29138535261154175, 0.741392672...
func New(metainfo *Client, encStore *encryption.Store) *DB { return &DB{ metainfo: metainfo, encStore: encStore, } }
[ 0.35043710470199585, -0.06113473325967789, -0.012701417319476604, 0.4198070466518402, -0.6448644399642944, 0.3734867572784424, -0.7798465490341187, 0.5386365652084351, -0.2320488840341568, 0.07991895824670792, -0.05476799234747887, 0.36212158203125, -0.003041938180103898, 0.249302878975868...
func (db *DB) CreateBucket(ctx context.Context, bucketName string) (newBucket storj.Bucket, err error) { defer mon.Task()(&ctx)(&err) if bucketName == "" { return storj.Bucket{}, storj.ErrNoBucket.New("") } newBucket, err = db.metainfo.CreateBucket(ctx, CreateBucketParams{ Name: []byte(bucketName), }) retur...
[ -0.39308983087539673, 0.5587074160575867, 0.49445727467536926, 0.31961965560913086, 0.3045773208141327, 0.009158458560705185, 0.22543345391750336, -0.626244306564331, -0.04330136254429817, -0.36474257707595825, 0.20539730787277222, 0.0985535979270935, -0.5038917064666748, 0.267628818750381...
func (db *DB) GetBucket(ctx context.Context, bucketName string) (bucket storj.Bucket, err error) { defer mon.Task()(&ctx)(&err) if bucketName == "" { return storj.Bucket{}, storj.ErrNoBucket.New("") } bucket, err = db.metainfo.GetBucket(ctx, GetBucketParams{ Name: []byte(bucketName), }) return bucket, storj...
[ -0.6351331472396851, 0.7543767094612122, 0.43153059482574463, 0.7676378488540649, 0.20335008203983307, -0.6120288968086243, 0.46856895089149475, -0.6562384963035583, 0.16551779210567474, -0.32913291454315186, 0.42792415618896484, 0.9284257888793945, -0.22434593737125397, -0.056317560374736...
func topframe(g *G, thread Thread) (Stackframe, error) { var frames []Stackframe var err error if g == nil { if thread.Blocked() { return Stackframe{}, ThreadBlockedError{} } frames, err = ThreadStacktrace(thread, 0) } else { frames, err = g.Stacktrace(0) } if err != nil { return Stackframe{}, err ...
[ 0.3041720688343048, 0.46429213881492615, 0.7854892611503601, 0.7530443072319031, -0.24689966440200806, -1.0311952829360962, 0.31397688388824463, -0.6305418610572815, 0.2589774429798126, 0.7362967729568481, 0.7444400787353516, 0.10305964946746826, -0.7483466863632202, 0.6568862199783325, ...
func next(dbp Process, stepInto bool) error { selg := dbp.SelectedGoroutine() curthread := dbp.CurrentThread() topframe, err := topframe(selg, curthread) if err != nil { return err } success := false defer func() { if !success { dbp.ClearInternalBreakpoints() } }() csource := filepath.Ext(topframe.C...
[ -0.20515745878219604, -0.08717280626296997, 0.8345571756362915, 0.42857012152671814, -0.457574725151062, 0.10075268894433975, 0.03746838495135307, -0.1371975690126419, -0.3152630031108856, -0.00022947276011109352, -0.053455132991075516, 0.03716207295656204, -0.6082782745361328, 1.336046099...
func setInternalBreakpoints(dbp Process, curpc uint64, pcs []uint64, kind BreakpointKind, cond ast.Expr) error { for i := range pcs { if pcs[i] == curpc || pcs[i] == curpc-1 { continue } if _, err := dbp.SetBreakpoint(pcs[i], kind, cond); err != nil { if _, ok := err.(BreakpointExistsError); !ok { dbp....
[ -0.7336669564247131, -0.4316416084766388, 0.5622859597206116, 0.14838624000549316, 0.20914383232593536, 0.6050262451171875, -0.24316145479679108, -0.31426340341567993, -0.8822355270385742, 0.6943904757499695, 0.3129938244819641, 0.5801130533218384, -1.467650294303894, 0.8587433695793152, ...
func GetG(thread Thread) (g *G, err error) { gaddr, err := getGVariable(thread) if err != nil { return nil, err } g, err = gaddr.parseG() if err == nil { g.Thread = thread if loc, err := thread.Location(); err == nil { g.CurrentLoc = *loc } } return }
[ -0.31354573369026184, 0.30758658051490784, 0.4084513783454895, -0.25236976146698, -0.026636971160769463, 0.31143370270729065, 0.3717971444129944, 0.026578938588500023, -0.4431593120098114, 0.23870988190174103, -0.10534927994012833, 1.1662142276763916, -0.21130450069904327, 0.01882227137684...
func ThreadScope(thread Thread) (*EvalScope, error) { locations, err := ThreadStacktrace(thread, 0) if err != nil { return nil, err } if len(locations) < 1 { return nil, errors.New("could not decode first frame") } return &EvalScope{locations[0].Current.PC, locations[0].CFA, thread, nil, thread.BinInfo()}, ni...
[ 0.003967508673667908, -0.6326119899749756, 0.4900732636451721, -0.6161220073699951, -0.2624034583568573, -0.9856556057929993, 0.13132792711257935, -0.9875626564025879, 0.26631173491477966, 0.6236297488212585, 0.04362073540687561, 0.3600701093673706, -0.967894434928894, 0.33470606803894043,...
func GoroutineScope(thread Thread) (*EvalScope, error) { locations, err := ThreadStacktrace(thread, 0) if err != nil { return nil, err } if len(locations) < 1 { return nil, errors.New("could not decode first frame") } gvar, err := getGVariable(thread) if err != nil { return nil, err } return &EvalScope{l...
[ -0.3168847858905792, -0.16393977403640747, 0.5349581837654114, -0.8469122648239136, 0.1902337223291397, -0.6720716953277588, 0.4811756908893585, -1.2381283044815063, -0.3008301854133606, 0.9920481443405151, -0.13509464263916016, 0.34021493792533875, -1.2633496522903442, 0.4217306673526764,...
func onNextGoroutine(thread Thread, breakpoints map[uint64]*Breakpoint) (bool, error) { var bp *Breakpoint for i := range breakpoints { if breakpoints[i].Internal() { bp = breakpoints[i] break } } if bp == nil { return false, nil } if bp.Kind == NextDeferBreakpoint { // we just want to check the con...
[ 0.21444807946681976, 0.010938399471342564, 0.5752415060997009, 0.5553386807441711, 0.3515036404132843, 0.09036707133054733, -0.5981155633926392, -0.5109072923660278, -1.0175930261611938, 0.5684376358985901, -0.26297369599342346, -0.10580745339393616, -1.2180249691009521, 1.1359577178955078...
func (idMap *IdentityMap) CheckIdentity(id string, login map[string]string) error { for name, pattern := range *idMap { if !pattern.MatchString(id) { continue } login[name] = id login["type"] = "account" login["verifyCode"] = "" return nil } return ErrIdentity }
[ -1.4422948360443115, -0.6650011539459229, 0.4857770800590515, 0.5977445840835571, 1.1798828840255737, 0.3313893973827362, -0.07101643085479736, 0.4188244640827179, 0.5936351418495178, 0.6977499723434448, -0.7098416686058044, -0.5011035203933716, -1.0661672353744507, 0.5249467492103577, 0...
func (idMap *IdentityMap) AddPattern(name string, pattern *regexp.Regexp) error { if _, exist := (*idMap)[name]; exist { return fmt.Errorf("named[%s] pattern already exists", name) } (*idMap)[name] = pattern return nil }
[ -1.1256145238876343, 0.07100704312324524, 0.48234257102012634, -0.18440990149974823, 0.30491670966148376, 0.8650129437446594, -0.6209844350814819, 0.22968153655529022, 0.7632827758789062, -0.040331315249204636, -1.3084774017333984, -0.42873117327690125, -0.8516241908073425, 0.1349878162145...
func NewIdentityMap() IdentityMap { mp := make(IdentityMap) mp["email"] = regexp.MustCompile(`[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*`) mp["mobile"] = regexp.MustCompile(`(\+?[0-9]{2,3})?[0-9-]{6,13}`) return mp }
[ -0.7000750303268433, -1.5586189031600952, 0.44533175230026245, 0.023470846936106682, -0.35705363750457764, 0.5334811210632324, 0.4072997272014618, 0.24990160763263702, 0.8876453042030334, -0.2651137709617615, -0.9632353782653809, -0.25183993577957153, -0.4465218186378479, 0.023904159665107...
func StartAddDataForProjects() { var projects []Project data, err := ioutil.ReadFile("../dump_data/projects.json") checkErr(err) err = json.Unmarshal(data, &projects) checkErr(err) fmt.Println("data extracted from file") fmt.Println("# Inserting values") var lastInsertID int for _, value := range projects { ...
[ -0.587308943271637, 0.6320449709892273, 0.5698518753051758, -0.44123077392578125, 0.46373242139816284, 1.0868215560913086, 0.26365429162979126, -0.03312063217163086, -0.8351181745529175, -0.0313858687877655, -0.21931636333465576, -0.3048359751701355, -0.40008190274238586, 0.332863062620162...
func LoadAllProjects() ([]ProjectPrint, error) { row, err := DB.Query("SELECT id,name,created_by FROM projects") var projects []ProjectPrint checkErr(err) for row.Next() { var u ProjectPrint row.Scan(&u.ID, &u.Name, &u.CreatedBy) u.Issues = GetAllIssuesByID(u.ID) u.Owner = GetUserByID(u.CreatedBy) project...
[ 0.0276124756783247, -0.039962805807590485, 0.41115114092826843, 0.6168491840362549, -0.3253004252910614, 0.15731880068778992, -1.0799403190612793, -0.47776588797569275, 0.5221700072288513, -0.3140436112880707, 0.06329098343849182, 0.2131422609090805, -0.7524760365486145, 0.2183549702167511...
func GetProjectsByID(id int) *[]ProjectPrint { row, err := DB.Query("SELECT id,name,created_by FROM users WHERE created_by = $1", id) checkErr(err) var projects []ProjectPrint for row.Next() { var u ProjectPrint row.Scan(&u.ID, &u.Name, &u.CreatedBy) projects = append(projects, u) } defer row.Close() retur...
[ -0.027177564799785614, 0.35398152470588684, 0.2887166440486908, 0.1226675808429718, -0.1392367035150528, -0.05817861109972, 0.041193921118974686, -1.0240778923034668, 0.24473145604133606, 0.14184553921222687, -0.3385816514492035, 0.27937301993370056, -0.5412448644638062, 0.3752370476722717...
func GetProjectByID(id int) *ProjectPrint { row, err := DB.Query("SELECT id,name FROM users WHERE id = $1", id) checkErr(err) var u ProjectPrint for row.Next() { row.Scan(&u.ID, &u.Name) } u.Issues = GetAllIssuesByID(u.ID) u.Owner = GetUserByID(u.CreatedBy) fmt.Println(u) defer row.Close() return &u }
[ 0.1618792861700058, 0.006086972542107105, 0.21205425262451172, -0.21189866960048676, -0.5685842037200928, -0.11319594085216522, -0.292168527841568, -0.8575649857521057, 0.35658133029937744, -0.16995735466480255, 0.1768009513616562, 0.049294766038656235, -0.60124272108078, -0.30823698639869...
func CreateProject(userID int, name string) (*ProjectPrint, error) { var lastInsertID int err := DB.QueryRow("INSERT INTO projects(name,created_by) VALUES($1,$2) returning id;", name, userID).Scan(&lastInsertID) if err != nil { return nil, err } fmt.Println("last inserted id =", lastInsertID) project := Projec...
[ 0.48252052068710327, -0.12355563044548035, 0.3418790400028229, 0.16548094153404236, -0.28015124797821045, 0.2964444160461426, -0.6772423982620239, -0.6886597275733948, -0.05719127878546715, 0.10675380378961563, 0.44485777616500854, -0.5857726335525513, -1.336637258529663, -0.62294793128967...
func UpdateProject(name string, id int) (*ProjectPrint, error) { _, err := DB.Query("UPDATE projects SET name = $1 WHERE id = $2", name, id) if err != nil { return nil, err } row, err := DB.Query("SELECT id,name,created_by FROM project WHERE id = $1", id) checkErr(err) var u ProjectPrint for row.Next() { ro...
[ -0.4277123808860779, -0.47443798184394836, 0.29601937532424927, 0.015316179022192955, -0.7376524806022644, -0.07624074816703796, -0.9962915182113647, -0.636293351650238, -0.16096383333206177, 0.48862361907958984, 0.09007302671670914, 0.12884478271007538, -0.7411428689956665, -0.75262552499...
func DeleteProject(id int) ([]ProjectPrint, error) { _, err := DB.Query("DELETE FROM projects WHERE id = $1", id) if err != nil { return nil, err } return LoadAllProjects() }
[ -0.32238394021987915, 0.8983936309814453, 0.3234846591949463, 0.6096490025520325, 0.3283916115760803, -0.26753106713294983, -0.7301666140556335, -0.31484317779541016, 0.7204955220222473, 0.34105271100997925, 0.17105351388454437, -0.14447544515132904, -1.070726990699768, 0.5995856523513794,...
func MethodReplace(www http.ResponseWriter, req *http.Request) (methodOut string) { methodOut = req.Method if db_flag["MethodReplace"] { fmt.Printf("Check __method__ AT: %s\n", godebug.LF()) } found_method, method := GetVar("__method__", www, req) if found_method && req.Method == "GET" { if db_flag["MethodRepl...
[ -0.6838817000389099, 0.0059365564957261086, 0.9690485596656799, -0.3136531710624695, 0.47656989097595215, -0.5814743638038635, -0.008488570339977741, 0.29094740748405457, 0.06460778415203094, 0.30801206827163696, 1.0386594533920288, 0.009978246875107288, -0.6186746954917908, 1.236178994178...
func HandleStatus(www http.ResponseWriter, req *http.Request) { if isTLS { www.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains") } www.Header().Set("Content-Type", "application/json; charset=utf-8") www.WriteHeader(http.StatusOK) // 200 fmt.Fprintf(www, `{"status":"success"}`) ret...
[ -0.16911907494068146, -0.2589489221572876, 0.691125214099884, 0.17654414474964142, -0.3120102882385254, 0.9897588491439819, -0.05590587854385376, 0.6632054448127747, 0.13208970427513123, 0.25495898723602295, -0.147903710603714, 0.07626860588788986, 0.5750604271888733, 0.45130544900894165, ...
func ValidUser(un, pw string) bool { // xyzzy - TODO At this point you really shoudl check v.s. the d.b. return true }
[ -0.056259144097566605, -0.267123281955719, 0.6655403971672058, 1.4420762062072754, -0.8986395001411438, 1.3717820644378662, 0.4023776352405548, 0.9462757706642151, 0.7779061794281006, -1.7334957122802734, -0.013039651326835155, -0.5494769811630249, -0.3744021952152252, 0.3040018677711487, ...
func HandleExitServer(www http.ResponseWriter, req *http.Request) { if !IsAuthKeyValid(www, req) { return } if isTLS { www.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains") } www.Header().Set("Content-Type", "application/json; charset=utf-8") www.WriteHeader(http.StatusOK) // ...
[ -1.3963481187820435, -0.0026512998156249523, 0.6401013135910034, 0.24370969831943512, 0.311562716960907, 0.09501467645168304, 0.303884357213974, 0.15866775810718536, -0.14930233359336853, 0.803276538848877, 0.26241204142570496, 0.07939041405916214, -0.19353337585926056, 1.0254161357879639,...
func NewDoor(name string, isLocked bool, isOpen bool, description string, action func(cell *Cell, command parser.Parsed, inventory ...*Item) string) *Door { return &Door{ Name: name, IsLocked: isLocked, IsOpen: isOpen, Description: description, Perfo...
[ 0.04535025730729103, -1.1709316968917847, 0.381504088640213, 1.4890761375427246, -0.5041641592979431, 0.05518480762839317, -0.1483459621667862, -0.3417445421218872, -0.11314219236373901, 0.0745004415512085, 0.23413507640361786, 0.8850504159927368, -0.8424006700515747, 0.16481037437915802, ...
func (vs Vars) Regress(vD *Var) ([]float64, error) { xM := vs.RegressionMatrix() yV := mat64.NewVector(len(vD.Data), vD.Data) var bV mat64.Vector err := bV.SolveVec(xM, yV) if err != nil { return nil, err } sol := make([]float64, len(vs)+1) mat64.Col(sol, 0, &bV) return sol, nil }
[ -0.5001901388168335, 0.40070074796676636, 0.528861403465271, -0.06850558519363403, 0.7668099403381348, -0.7366571426391602, -0.12195588648319244, -0.9324913620948792, 0.03535260260105133, -0.3536624610424042, -0.2762223482131958, 1.1455516815185547, -0.2020626962184906, 0.3978717625141144,...