text stringlengths 3.08k 10.4k |
|---|
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2017 Datadog, Inc.
// +build kubelet
package kubelet
import (
"encoding/json"
"errors"
"fmt"
"... |
// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package main
import (
"bytes"
"crypto/sha1"
"encoding/hex"
"fmt"
"net"
"strconv"
"strings"
"time"
)
var (
username = "12345"
)
const (
IP = "172.16.58.3"
Port = "2811"
Algorithm = " (DUCO-S1) "
MinerVersion = "1.0.0"
RigIdentifier = "12345-duino-miner"
)
type IMasterServerClient interface {
I... |
package cmd
import (
"encoding/json"
"f1-cli/util"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
ui "github.com/gizak/termui/v3"
"github.com/gizak/termui/v3/widgets"
"github.com/spf13/cobra"
)
type table_data struct {
name string
circuitName string
round string
location string
date ... |
package main
import (
"fmt"
"log"
"os"
"os/exec"
"runtime"
"strings"
"testing"
"time"
"github.com/datawire/ambassador/pkg/dtest"
"github.com/datawire/ambassador/pkg/dtest/testprocess"
"github.com/stretchr/testify/require"
)
var kubeconfig string
func TestMain(m *testing.M) {
testprocess.Dispatch()
kub... |
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
"os"
"strings"
"time"
"github.com/fatih/color"
jsonC "github.com/nwidger/jsoncolor"
"github.com/pborman/getopt"
)
var (
head = "HEAD"
httpMethod *string
postBody *string
f... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"entgo.io/ent/dialect/sql"
"github.com/minskylab/meta-core/ent/provider"
uuid "github.com/satori/go.uuid"
)
// Provider is the model entity for the Provider schema.
type Provider struct {
config `json:"-"`
// ID of the ent.... |
package gui
import (
"context"
"fmt"
"math"
"time"
"github.com/andlabs/ui"
log "github.com/sirupsen/logrus"
)
const barUpdateInterval = time.Millisecond * 100
const labelUpdateInterval = time.Second * 1
const titleUpdateInterval = time.Millisecond * 500
// ProgressFunc should be set to a function which report... |
package cli
import (
"fmt"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/cosmos/cosmos-sdk/client/context"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/... |
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
package eth
import (
"encoding/json"
"errors"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
)
var _ = (*rpcBlockMarshaling)(nil)
// MarshalJSON marsha... |
/*
Copyright (c) 2021 TriggerMesh Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
package gossip
import (
"github.com/Fantom-foundation/lachesis-base/common/bigendian"
"github.com/Fantom-foundation/lachesis-base/hash"
"github.com/Fantom-foundation/lachesis-base/inter/idx"
"github.com/Fantom-foundation/lachesis-base/inter/pos"
"github.com/Fantom-foundation/lachesis-base/kvdb"
"github.com/ether... |
package main
import (
"flag"
"fmt"
"log"
"os"
"sort"
"time"
"github.com/kiteco/kiteco/kite-go/segment-analysis/internal/tracks"
chart "github.com/wcharczuk/go-chart"
)
var (
maxWaitTime float64
cutoff = 3 * time.Second
aboveCutoff = make(map[string][]float64)
sources = map[string]bool{
"request":... |
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"github.com/saltchang/rf-data-calculator/helper"
"github.com/saltchang/rf-data-calculator/models"
"github.com/saltchang/rf-data-calculator/writer"
)
var (
xhaat = 30.0
xfield = 60.0
rf models.RFDATA
)
func main() {
for {
fmt.... |
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
package internal
import (
"context"
"fmt"
"time"
"github.com/gogo/protobuf/proto"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.uber.org/zap"
"go.zenithar.org/pkg/cache"
"go.zenithar.org/pkg/log"
"go.zenithar.org/spotigraph/internal/services"
"go.zenithar.org/spotigraph/pkg/protocol/v1/spotig... |
package repository
import (
"fmt"
"math/rand"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
"google.golang.org/grpc/codes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/git/ob... |
package render
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"
"text/template"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/pkg/errors"
"github.com/strongdm/comply/internal/con... |
package resources
import (
"fmt"
"io/ioutil"
"strings"
"sync"
"github.com/go-gl/gl/v4.1-core/gl"
)
const (
// ShaderSrcDir lists the expected location of shaders
ShaderSrcDir = "assets/shaders/"
windowWidth = 800
windowHeight = 600
)
// shaderManager stores shader programs
type shaderManager struct {
sha... |
package txs
// --------------------------------------------------------
// Parser
//
// Parses structs containing event information into
// unsigned transactions for validators to sign, then
// relays the data packets as transactions on the
// Cosmos Bridge.
// --------------------------------... |
// Copyright (c) 2016, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and ... |
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
package pathtoregexp
import (
"regexp"
"strings"
"strconv"
)
var PATH_REGEXP = regexp.MustCompile(strings.Join([]string{
// Match escaped characters that would otherwise appear in future matches.
// This allows the user to escape special characters that won't transform.
"(\\\\.)",
// Match Express-style... |
// Copyright 2019 The Kubernetes Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... |
package toyhose
import (
"bytes"
"compress/gzip"
"context"
"errors"
"fmt"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/firehose"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/google/... |
package amazon
import (
"bufio"
"bytes"
"compress/gzip"
"encoding/xml"
"fmt"
"net/url"
"path"
"sort"
"github.com/inconshreveable/log15"
"golang.org/x/net/html/charset"
"golang.org/x/xerrors"
"github.com/vulsio/goval-dictionary/fetcher/util"
models "github.com/vulsio/goval-dictionary/models/amazon"
)
//... |
/*
Copyright (c) 2020 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... |
package casecount
import (
"log"
"net/http"
"sync"
"time"
"yet-another-covid-map-api/dateformat"
"yet-another-covid-map-api/utils"
)
const (
confirmedURL = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"
... |
package hickwall
import (
"fmt"
"github.com/oliveagle/hickwall/backends"
"github.com/oliveagle/hickwall/collectors"
"github.com/oliveagle/hickwall/config"
"github.com/oliveagle/hickwall/logging"
"github.com/oliveagle/hickwall/newcore"
"net/http"
_ "net/http/pprof"
)
var (
the_core newcore.PublicationSet... |
package microsvcs
import (
"encoding/json"
"io"
"net"
"net/http"
"net/url"
"strings"
"github.com/gorilla/websocket"
"github.com/grafana/grafana/pkg/infra/log"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/util"
)
var (
DefaultUpgrader = &websocket.Upgrader{
ReadBufferSize: 5... |
package yaml
import (
"encoding/json"
"fmt"
"strings"
)
// YAMLFile represents a parsed yaml scene description file.
type YAMLFile struct {
Items []Item
DefinedItems map[string]*Item
}
// Item represents anything that can be added to the scene.
type Item struct {
Add *string `json:"add,omitempty"`
D... |
// Package schema implements miscellaneous data structures that can be converted to and from blobs.
package schema
import (
"bytes"
"context"
"sort"
"github.com/pkg/errors"
"github.com/bobg/bs"
"github.com/bobg/bs/gc"
)
// NewSet produces a new, empty Set,
// not yet written to a blob store.
func NewSet() *Se... |
package main
import (
"log"
"strings"
"gopkg.in/yaml.v3"
)
func unfoldSchema(schema string) string {
/// The following block unfolds what is called "beginning already included" in the documentation.md.
/// It autofills the fields $id, $schema, title and type at the beginning of the schema file.
lines := strin... |
package gorgonia
import (
"fmt"
"github.com/chewxy/gorgonia/tensor"
tf32 "github.com/chewxy/gorgonia/tensor/f32"
tf64 "github.com/chewxy/gorgonia/tensor/f64"
ti "github.com/chewxy/gorgonia/tensor/i"
"github.com/chewxy/gorgonia/tensor/types"
)
// Value represents a value that Gorgonia accepts
type Value interfa... |
package main
import (
"encoding/json"
"flag"
"io/ioutil"
"log"
"math"
"os"
"os/signal"
"syscall"
"time"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/imdario/mergo"
"github.com/W-Floyd/ha-mqtt-iot/hadiscovery"
"github.com/W-Floyd/ha-mqtt-iot/iotconfig"
)
var debugLog = log.New(os.Stdout, "DEBU... |
// Code generated by go-swagger; DO NOT EDIT.
package wars
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-... |
package cmd
import (
"bufio"
"fmt"
"io"
"os"
"path/filepath"
"go.charczuk.com/sdk/cli"
"go.charczuk.com/sdk/slant"
"go.charczuk.com/project/blogctl/pkg/config"
"go.charczuk.com/project/blogctl/pkg/constants"
"go.charczuk.com/project/blogctl/pkg/engine"
)
// Init returns the init command.
func Init() *cli.... |
package web
// provides a way of controlling/reading the sensors over the web
import (
"bytes"
"encoding/json"
"fmt"
"github.com/cj123/robot/initio" // our robot commands
"log"
"net/http"
"strconv"
"strings"
)
var (
collisionAvoidance *bool
motor *initio.Motors
sonarSensor *initio.S... |
// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2017 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope tha... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v2
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new participant in a conversation.... |
package host
import (
"os"
"sort"
"strconv"
"time"
"github.com/ElricleNecro/TOD/commands"
"github.com/ElricleNecro/TOD/formatter"
)
type Hosts struct {
Hosts []*Host
}
// This function dispatches the commands on some hosts
func (hosts *Hosts) Dispatcher(
commands []commands.Command,
nhosts_max int,
first ... |
package catalog
import (
"net/url"
"path/filepath"
"strings"
)
// OnlineResource describes a resource (pdf, document, video, website, etc)
// online that is used as reference material for a series or message
type OnlineResource struct {
// URL of the resource, required
URL string `json:"url"`
// name of the res... |
package commands
import (
"encoding/base64"
"encoding/json"
"fmt"
"log"
"os"
"strconv"
"time"
"github.com/go-redis/redis"
"go.uber.org/atomic"
"github.com/QiNiuQVMSolutionTeam/Redis-Transmission/lib"
)
type Dumper struct {
Host string
Password string
Client *redis.Client
Path str... |
package engine
// GameObject represented a sprite and its properties
type GameObject struct {
CurrentState string
States GameObjectStates
Position Vector
Mass float64
Velocity Vector
Direction int
IsFlipped bool
IsControllable bool
IsFloor bool
IsInteractive bool
IsHidden bool
Level *Level
DynamicData Dyn... |
package kubernetes
import (
"sort"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/cache"
"github.com/solo-io/supergloo/api/custom/kubepod"
v1 "github.com/solo-io/supergloo/pkg/api/v1"
kubev1 "k8s.io/api/core/v1"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/res... |
package subscriber
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/schollz/progressbar/v3"
"go.uber.org/ratelimit"
"lightning/publisher"
"log"
"net/http"
"os"
"strings"
"sync"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"... |
package cluster
import (
"errors"
"fmt"
"strings"
"sync"
"time"
"google.golang.org/grpc"
"golang.org/x/net/context"
"github.com/NetSys/quilt/db"
"github.com/NetSys/quilt/minion/pb"
log "github.com/Sirupsen/logrus"
)
type client interface {
setMinion(pb.MinionConfig) error
getMinion() (pb.MinionConfig,... |
/*
* Minio Cloud Storage, (C) 2016, 2017 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this fi... |
package minirest
import (
"log"
"net/http"
"reflect"
"strings"
"github.com/julienschmidt/httprouter"
)
// Minirest is singleton for Minirest framework
type Minirest struct {
// Set to true for returning gzip encoded response globally
Gzip bool
services map[string]Service
controllers map[string]Con... |
package oracle_test
import (
"testing"
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/mock"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/xar-network/xar-network/x/oracle"
"github.com/xar-network/xar-network/x/oracle/internal/types"
"github.com/tendermint/ten... |
// +build !windows
package meterpreter
import (
"bytes"
"crypto/sha256"
"crypto/tls"
"encoding/binary"
"errors"
"io/ioutil"
"math/rand"
"net"
"net/http"
"syscall"
"time"
"unsafe"
)
// Start creates a new meterpreter connection with the given transport type
func Start(transport, address string) error {
s... |
// Copyright 2021 spaGO Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package lamb
import (
mat "github.com/nlpodyssey/spago/pkg/mat32"
"github.com/nlpodyssey/spago/pkg/ml/nn"
"github.com/nlpodyssey/spago/pkg/ml/optimizers/gd"
... |
package main
import (
"fmt"
"log"
"math/rand"
"strings"
"time"
"github.com/boltdb/bolt"
"github.com/gin-gonic/gin"
)
const defaultAlphabet = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ1234567890_:!?+-"
var db *bolt.DB
type Val struct {
Value string `json:"url"`
Mode int `json:"mode"`
}
type A... |
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/infracost/infracost/internal/config"
"github.com/infracost/infracost/internal/ui"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func addRootDeprecatedFlags(cmd *cobra.Command) {
cmd.Flags().String("tfjson", "... |
package cached_mysql
import (
"context"
"encoding/json"
"os"
"runtime"
"testing"
"time"
"github.com/fleetdm/fleet/v4/server/datastore/redis"
"github.com/fleetdm/fleet/v4/server/fleet"
"github.com/fleetdm/fleet/v4/server/mock"
"github.com/fleetdm/fleet/v4/server/ptr"
redigo "github.com/gomodule/redigo/redis... |
package main
import (
"context"
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"strings"
"time"
"github.com/evanj/concurrentlimit/sleepymemory"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/durationpb"
)
const g... |
package elasticsearch
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
esauth "github.com/ONSdigital/dp-elasticsearch/v2/awsauth"
dphttp "github.com/ONSdigital/dp-net/http"
"github.com/ONSdigital/log.go/v2/log"
)
// ServiceName elasticsearch
const (
ServiceName = "... |
package mont_arith
import (
"encoding/binary"
"math/big"
)
/*
Methods for converting between Go big-int (64bit little-endian limbs, big-endian limb ordering)
and the bigint representation expected here: 64bit little-endian limbs, little-endian ordered
*/
func LEBytesToInt(v []byte) *big.Int {
result := new(big.Int... |
package main
import (
"fmt"
"math/rand"
"strings"
"time"
"github.com/giantswarm/apiextensions/pkg/clientset/versioned"
"github.com/giantswarm/certs"
"github.com/giantswarm/microerror"
"github.com/giantswarm/microkit/command"
microserver "github.com/giantswarm/microkit/server"
"github.com/giantswarm/microlog... |
package mqtt
import (
"bufio"
"container/list"
b64 "encoding/base64"
"encoding/json"
"log"
"net"
"strings"
"github.com/google/uuid"
"github.com/mitchellh/mapstructure"
MQTT "github.com/eclipse/paho.mqtt.golang"
)
const MQ_TCP_URL = "127.0.0.1:5687"
type ConnectParams struct {
HostURL string
ClientID s... |
package main
import (
"errors"
"fmt"
"log"
"os/exec"
"strings"
"github.com/gammazero/workerpool"
bolt "go.etcd.io/bbolt"
)
type TransferTask struct {
Bucket string
Path string // file path relative to Bucket root dir
AbsPath string // absolute file path on local disk
}
// diffResult is path to the dif... |
package calendar
import (
"encoding/json"
"fmt"
"io/ioutil"
"math"
"strings"
)
type Calendar struct {
CurrentDay int
CurrentSeason *Season
Seasons []*Season `json:"seasons"`
}
func NewCalendar(pathToCalendar string, day int, seasonName string) (*Calendar, error) {
calendar, err := loadCalendar(path... |
/*
* Copyright NetFoundry, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... |
package generator
import (
"errors"
"github.com/mitchellh/mapstructure"
"github.com/quicky-dev/generator/support/ubuntu"
"github.com/quicky-dev/generator/util"
"strings"
)
type UBUNTU_GENERATOR struct {
AvailablePackages SupportedPackages
genericPackages map[string]category
}
// supportedmacPkgs gets us the... |
package goapns
import (
"bytes"
"crypto/tls"
"net/http"
"net/url"
"encoding/json"
"fmt"
"golang.org/x/net/http2"
"os"
"sync"
)
//Connection stores properties that are necessary to perform a request to Apples servers.
type Connection struct {
//HTTPClient the HTTP client that is used. It is configured wi... |
package transaction
import (
"container/list"
"errors"
"log"
"sync"
"github.com/golang/protobuf/proto"
"github.com/google/uuid"
"github.com/gopricy/mao-bft/pb"
)
// #############################################################
// Define Wire System
// ##########################################################... |
package main
import (
"context"
"errors"
"flag"
"fmt"
"io"
"log"
"time"
"os"
"github.com/practicalgo/code/appendix-b/pkgcli/cmd"
"github.com/practicalgo/code/appendix-b/pkgcli/config"
"github.com/practicalgo/code/appendix-b/pkgcli/telemetry"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
uberconfig "go... |
package shareami
import (
"log"
"os"
"github.com/aws/aws-sdk-go/service/ec2"
clog "github.com/proffer/common/clogger"
awscommon "github.com/proffer/resources/aws/common"
"gopkg.in/yaml.v2"
)
var (
clogger = clog.New(os.Stdout, "aws-shareami | ", log.Lmsgprefix)
)
// RawSrcAmiInfo represents raw source ami in... |
package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
"strings"
)
const MASK = "mask"
const MEM = "mem"
const EQUALS = " = "
const X = "X"
const ONE = "1"
const ZERO = "0"
func main() {
partOneAnswer := partOneDay14()
fmt.Println(partOneAnswer)
partTwoAnswer := partTwoDay14()
fmt.Println(partTwoAnswer)
... |
package serverplugin
import (
"context"
"fmt"
"github.com/halokid/ColorfulRabbit"
"github.com/halokid/rpcx-plus/share"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/uber/jaeger-client-go"
"github.com/uber/jaeger-client-go/config"
"io"
"time"
logs... |
package main
import (
"concurrency-9/server"
"concurrency-9/tsp"
"fmt"
"log"
"net/http"
"os"
"sort"
"strings"
)
// getIndices is responsible to parse through the form response given by form.html to
// find the user queried locations. The parsed data will consist of locations which
// in turn will be converted... |
package coredb
import (
"database/sql/driver"
"fmt"
sq "github.com/Masterminds/squirrel"
"github.com/genjidb/genji"
"reflect"
"sort"
"strings"
)
func (c *CoreDB) Query(stmt string, args ...interface{}) (*QueryResult, error) {
res, err := c.store.Query(stmt, args...)
if err != nil {
return nil, err
}
retu... |
//go:build e2e
// +build e2e
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
package epgc
import (
"database/sql"
"log"
"strconv"
"strings"
"time"
"github.com/lib/pq"
)
func s2n(val string) sql.NullString {
var s2n sql.NullString
if val == "" {
s2n.Valid = false
} else {
s2n.Valid = true
s2n.String = val
}
return s2n
}
// func d2n(val time.Time) pq.NullTime {
// var d2n pq... |
package main
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/pem"
"io"
"math/big"
"testing"
"time"
"github.com/letsencrypt/boulder/test"
)
func TestGenerateCRLTimeBounds(t *testing.T) {
_, err := generateCRL(nil, nil, time.Time... |
// telegram bot for capturing image with ImageSnap
package main
import (
"fmt"
"log"
"os"
"os/exec"
"strings"
"sync"
"time"
bot "github.com/meinside/telegram-bot-go"
"github.com/meinside/telegram-bot-imagesnap/conf"
"github.com/meinside/telegram-bot-imagesnap/helper"
)
type status int16
const (
statusWa... |
// Copyright (c) <NAME> <<EMAIL>>. All rights reserved. Use
// of this source code is governed by the MIT license that can be found in
// the LICENSE file.
package main
import (
"context"
"fmt"
"io"
"log"
"math/rand"
"net"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/bluele/gcache"
gflags "gi... |
// Copyright 2012 Google, Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree.
// arpscan implements ARP scanning of all interfaces' local networks using
// gopacket and its subpackages. This example show... |
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package math
import "math/bits"
func zero(x uint64) uint64 {
if x == 0 {
return 1
}
return 0
// branchless:
// return ((x>>1 | x&1) - 1) >> 63
}
func ... |
// Code generated DO NOT EDIT
package obex_agent
import (
"sync"
"github.com/muka/go-bluetooth/bluez"
"github.com/muka/go-bluetooth/util"
"github.com/muka/go-bluetooth/props"
"github.com/godbus/dbus"
)
var AgentManager1Interface = "org.bluez.obex.AgentManager1"
// NewAgentManager1 create a new ins... |
package e2e
import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"text/template"
"time"
"github.com/Checkmarx/kics/e2e/testcases"
"github.com/Checkmarx/kics/e2e/utils"
"github.com/stretchr/testify/require"
)
func Test_E2E_CLI(t *testing.T) {
kicsPath := utils.GetKICSBinaryPath("")
scanStartTime := tim... |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"go/token"
"go/types"
"github.com/polaris1119/tools/cmd/guru/serial"
"github.com/polaris1119/tools/go/callgraph"
"github.com... |
package utils
import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"math/rand"
"net"
"net/http"
"time"
"github.com/rancher/types/apis/management.cattle.io/v3"
"github.com/rancher/types/config/dialer"
"github.com/pkg/errors"
)
const (
sslv23 = "SSLv23"
tlsv1 = "TLSv1"
tlsv1_1 = "TLS... |
/*
Copyright 2021 The OpenYurt Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... |
package ssrpanel
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/v2fly/v2ray-core/v4/common/errors"
"github.com/v2fly/v2ray-core/v4/common/platform"
"github.com/v2fly/v2ray-core/v4/common/protocol"
"github.com/v2fly/v2ray-core/v4/infra/conf"
json_reader "gith... |
package ta
import (
"math"
"sync"
"go.oneofone.dev/ta/decimal"
)
const (
sqrt2Pi Decimal = 2.506628274631000241612355239340104162693023681640625
mE Decimal = math.E
)
var (
factCache *[100]*[2]Decimal
optionsOnce sync.Once
)
/*
function stdNormCDF(x)
{
var probability = 0;
// avoid divergence in the ... |
package noop
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the ... |
// Copyright 2015 The Tcell Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use file except in compliance with the License.
// You may obtain a copy of the license at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package structural
import (
"context"
"github.com/inconshreveable/log15"
"golang.org/x/sync/errgroup"
"github.com/sourcegraph/sourcegraph/internal/api"
"github.com/sourcegraph/sourcegraph/internal/database"
"github.com/sourcegraph/sourcegraph/internal/search"
"github.com/sourcegraph/sourcegraph/internal/searc... |
/*
* Copyright 2015 The Kythe Authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
package gocv
func (c MatType) String() string {
switch c {
case MatTypeCV8U:
return "CV8U"
case MatTypeCV8UC2:
return "CV8UC2"
case MatTypeCV8UC3:
return "CV8UC3"
case MatTypeCV8UC4:
return "CV8UC4"
case MatTypeCV16U:
return "CV16U"
case MatTypeCV16UC2:
return "CV16UC2"
case MatTypeCV16UC3:
retur... |
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !haxe
package lzw
import (
"bytes"
"io"
"io/ioutil"
"runtime"
"strconv"
"strings"
"testing"
)
type lzwTest struct {
desc string
raw ... |
// Copyright 2020 The PipeCD Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
/*
Copyright 2019 HAProxy Technologies
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
package iso20022
// Account between an investor(s) and a fund manager or a fund. The account can contain holdings in any investment fund or investment fund class managed (or distributed) by the fund manager, within the same fund family.
type InvestmentAccount34 struct {
// Unique and unambiguous identification for t... |
package polyapi
import (
"encoding/json"
"errors"
"fmt"
simplejson "github.com/bitly/go-simplejson"
"github.com/yellbuy/go-ec-openapi/common"
)
// Token
type AccessToken struct {
// 授权SessionKey
SessionKey string `json:"sessionkey"`
// 刷新SessionKey(当过期时)所需RefreshToken
RefreshToken string `js... |
package jira
import (
"context"
"fmt"
"net/url"
)
// GroupService handles Groups for the Jira instance / API.
//
// Jira API docs: https://docs.atlassian.com/jira/REST/server/#api/2/group
type GroupService struct {
client *Client
}
// groupMembersResult is only a small wrapper around the Group* methods
// to be ... |
/*
Copyright 2019 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
// Copyright 2012-present <NAME>. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package elastic
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/pzduniak/elastic/uritemplates"
)
/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.