• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang flag.Float64Var函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中flag.Float64Var函数的典型用法代码示例。如果您正苦于以下问题:Golang Float64Var函数的具体用法?Golang Float64Var怎么用?Golang Float64Var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Float64Var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: init

func init() {
	flag.IntVar(&qsConfig.PoolSize, "queryserver-config-pool-size", DefaultQsConfig.PoolSize, "query server connection pool size, connection pool is used by regular queries (non streaming, not in a transaction)")
	flag.IntVar(&qsConfig.StreamPoolSize, "queryserver-config-stream-pool-size", DefaultQsConfig.StreamPoolSize, "query server stream pool size, stream pool is used by stream queries: queries that return results to client in a streaming fashion")
	flag.IntVar(&qsConfig.TransactionCap, "queryserver-config-transaction-cap", DefaultQsConfig.TransactionCap, "query server transaction cap is the maximum number of transactions allowed to happen at any given point of a time for a single vttablet. E.g. by setting transaction cap to 100, there are at most 100 transactions will be processed by a vttablet and the 101th transaction will be blocked (and fail if it cannot get connection within specified timeout)")
	flag.Float64Var(&qsConfig.TransactionTimeout, "queryserver-config-transaction-timeout", DefaultQsConfig.TransactionTimeout, "query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value")
	flag.IntVar(&qsConfig.MaxResultSize, "queryserver-config-max-result-size", DefaultQsConfig.MaxResultSize, "query server max result size, maximum number of rows allowed to return from vttablet for non-streaming queries.")
	flag.IntVar(&qsConfig.MaxDMLRows, "queryserver-config-max-dml-rows", DefaultQsConfig.MaxDMLRows, "query server max dml rows per statement, maximum number of rows allowed to return at a time for an upadte or delete with either 1) an equality where clauses on primary keys, or 2) a subselect statement. For update and delete statements in above two categories, vttablet will split the original query into multiple small queries based on this configuration value. ")
	flag.IntVar(&qsConfig.StreamBufferSize, "queryserver-config-stream-buffer-size", DefaultQsConfig.StreamBufferSize, "query server stream buffer size, the maximum number of bytes sent from vttablet for each stream call.")
	flag.IntVar(&qsConfig.QueryCacheSize, "queryserver-config-query-cache-size", DefaultQsConfig.QueryCacheSize, "query server query cache size, maximum number of queries to be cached. vttablet analyzes every incoming query and generate a query plan, these plans are being cached in a lru cache. This config controls the capacity of the lru cache.")
	flag.Float64Var(&qsConfig.SchemaReloadTime, "queryserver-config-schema-reload-time", DefaultQsConfig.SchemaReloadTime, "query server schema reload time, how often vttablet reloads schemas from underlying MySQL instance in seconds. vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time.")
	flag.Float64Var(&qsConfig.QueryTimeout, "queryserver-config-query-timeout", DefaultQsConfig.QueryTimeout, "query server query timeout (in seconds), this is the query timeout in vttablet side. If a query takes more than this timeout, it will be killed.")
	flag.Float64Var(&qsConfig.TxPoolTimeout, "queryserver-config-txpool-timeout", DefaultQsConfig.TxPoolTimeout, "query server transaction pool timeout, it is how long vttablet waits if tx pool is full")
	flag.Float64Var(&qsConfig.IdleTimeout, "queryserver-config-idle-timeout", DefaultQsConfig.IdleTimeout, "query server idle timeout (in seconds), vttablet manages various mysql connection pools. This config means if a connection has not been used in given idle timeout, this connection will be removed from pool. This effectively manages number of connection objects and optimize the pool performance.")
	flag.BoolVar(&qsConfig.StrictMode, "queryserver-config-strict-mode", DefaultQsConfig.StrictMode, "allow only predictable DMLs and enforces MySQL's STRICT_TRANS_TABLES")
	// tableacl related configurations.
	flag.BoolVar(&qsConfig.StrictTableAcl, "queryserver-config-strict-table-acl", DefaultQsConfig.StrictTableAcl, "only allow queries that pass table acl checks")
	flag.BoolVar(&qsConfig.EnableTableAclDryRun, "queryserver-config-enable-table-acl-dry-run", DefaultQsConfig.EnableTableAclDryRun, "If this flag is enabled, tabletserver will emit monitoring metrics and let the request pass regardless of table acl check results")
	flag.StringVar(&qsConfig.TableAclExemptACL, "queryserver-config-acl-exempt-acl", DefaultQsConfig.TableAclExemptACL, "an acl that exempt from table acl checking (this acl is free to access any vitess tables).")
	flag.BoolVar(&qsConfig.TerseErrors, "queryserver-config-terse-errors", DefaultQsConfig.TerseErrors, "prevent bind vars from escaping in returned errors")
	flag.BoolVar(&qsConfig.EnablePublishStats, "queryserver-config-enable-publish-stats", DefaultQsConfig.EnablePublishStats, "set this flag to true makes queryservice publish monitoring stats")
	flag.StringVar(&qsConfig.StatsPrefix, "stats-prefix", DefaultQsConfig.StatsPrefix, "prefix for variable names exported via expvar")
	flag.StringVar(&qsConfig.DebugURLPrefix, "debug-url-prefix", DefaultQsConfig.DebugURLPrefix, "debug url prefix, vttablet will report various system debug pages and this config controls the prefix of these debug urls")
	flag.StringVar(&qsConfig.PoolNamePrefix, "pool-name-prefix", DefaultQsConfig.PoolNamePrefix, "pool name prefix, vttablet has several pools and each of them has a name. This config specifies the prefix of these pool names")
	flag.BoolVar(&qsConfig.EnableAutoCommit, "enable-autocommit", DefaultQsConfig.EnableAutoCommit, "if the flag is on, a DML outsides a transaction will be auto committed.")
}
开发者ID:dumbunny,项目名称:vitess,代码行数:25,代码来源:config.go


示例2: main

func main() {
	var (
		in     string
		out    string
		force  bool
		xScale float64
		yScale float64
	)
	flag.StringVar(&in, "i", "", "path to input text file. If unspecified or "+
		"set to '-', stdin is used")
	flag.StringVar(&out, "o", "", "path to output SVG file. If unspecified or "+
		"set to '-', stdout is used")
	flag.BoolVar(&force, "f", false, "overwrite existing output file")
	flag.Float64Var(&xScale, "x", asciiart.XScale,
		"number of pixels to scale each unit on the x-axis to")
	flag.Float64Var(&yScale, "y", asciiart.YScale,
		"number of pixels to scale each unit on the y-axis to")
	flag.Parse()
	if flag.NArg() != 0 {
		usage()
	}
	// work around defer not working after os.Exit()
	if err := aa2svgMain(out, in, force, xScale, yScale); err != nil {
		fatal(err)
	}
}
开发者ID:frankbraun,项目名称:asciiart,代码行数:26,代码来源:aa2svg.go


示例3: initFlags

func initFlags() {
	flag.BoolVar(&flagTest, "test", false, "Don't change any orders. Just output.")
	flag.StringVar(&flagExchange, "exchange", "bitstamp", "Exchange to connect to.")
	flag.StringVar(&flagApiKey, "api_key", "", "Bitstamp API key")
	flag.StringVar(&flagApiSecret, "api_secret", "", "Bitstamp API secret")
	flag.StringVar(&flagClientId, "client_id", "", "Bitstamp client ID")
	flag.Float64Var(
		&flagSpread, "spread", 2.0, "Percentage distance between buy/sell price")
	flag.Float64Var(
		&flagBtcRatio, "btc_ratio", 0.5, "Ratio of capital that should be BTC")
	flag.BoolVar(
		&flagFeeRound, "fee_round", false,
		"Round order size up such that the fee is an integer number of cents.")
	flag.Float64Var(
		&flagOffsetUsd, "offset_usd", 0,
		"Offset the USD balance before determining which orders to make.")
	flag.Float64Var(
		&flagOffsetBtc, "offset_btc", 0,
		"Offset the BTC balance before determining which orders to make.")
	flag.Float64Var(
		&flagMinAmount, "min_amount", 0,
		"Minimum amount of BTC to buy/sell")
	flag.BoolVar(
		&flagFeeAlwaysUsd, "fee_always_usd", false,
		"Whether the fee is always paid from USD. "+
			"Otherwise it's paid from BTC if BTC are bought.")
	flag.Parse()

	if flagApiKey == "" || flagApiSecret == "" {
		fmt.Printf("--api_key and --api_secret must be specified\n")
		os.Exit(1)
	}
}
开发者ID:dskloet,项目名称:bitcoin,代码行数:33,代码来源:flags.go


示例4: init

func init() {
	flag.StringVar(&in, "in", "", "file name of a BAM file to be processed.")
	flag.StringVar(&format, "format", "svg", "specifies the output format of the example: eps, jpg, jpeg, pdf, png, svg, and tiff.")
	flag.Var(&highlight, "highlight", "comma separated set of chromosome names to highlight.")
	flag.StringVar(&palname, "palette", "Set1", "specify the palette name for highlighting.")
	flag.Float64Var(&maxTrace, "tracemax", 0, "set the maximum value for the outer trace if not zero.")
	flag.Float64Var(&maxCounts, "countmax", 0, "set the maximum value for the inner trace if not zero.")
	help := flag.Bool("help", false, "output this usage message.")
	flag.Parse()
	if *help {
		flag.Usage()
		os.Exit(0)
	}
	if in == "" {
		flag.Usage()
		os.Exit(1)
	}
	for _, s := range []string{"eps", "jpg", "jpeg", "pdf", "png", "svg", "tiff"} {
		if format == s {
			return
		}
	}
	flag.Usage()
	os.Exit(1)
}
开发者ID:henmt,项目名称:2015,代码行数:25,代码来源:render-heat.go


示例5: init

func init() {
	flag.StringVar(&in, "in", "", "BAM file to be processed.")
	flag.StringVar(&annot, "annot", "", "file name of a GFF file containing annotations.")
	flag.Float64Var(&thresh, "thresh", 1, "log score threshold for inclusion of feature.")
	flag.Var(&classes, "class", "comma separated set of annotation classes to analyse.")
	flag.BoolVar(&pretty, "pretty", true, "outfile JSON data indented.")
	flag.IntVar(&minLength, "min", 20, "minimum length read considered.")
	flag.IntVar(&maxLength, "max", 35, "maximum length read considered.")
	flag.IntVar(&minId, "minid", 90, "minimum percentage identity for mapped bases.")
	flag.IntVar(&minQ, "minQ", 20, "minimum per-base sequence quality.")
	flag.Float64Var(&minAvQ, "minAvQ", 30, "minimum average per-base sequence quality.")
	flag.IntVar(&mapQ, "mapQ", 0, "minimum mapping quality [0, 255).")
	flag.IntVar(&binLength, "bin", 1e7, "bin length.")
	help := flag.Bool("help", false, "output this usage message.")
	flag.Parse()
	mapQb = byte(mapQ)
	if *help {
		flag.Usage()
		os.Exit(0)
	}
	if in == "" || !annotOK(annot, classes) || mapQ < 0 || mapQ > 254 {
		flag.Usage()
		os.Exit(1)
	}
}
开发者ID:henmt,项目名称:2015,代码行数:25,代码来源:trans-diff.go


示例6: init

func init() {
	//assign flags
	flag.IntVar(&size, "size", 1000, "usage: -size 1000")
	flag.IntVar(&length, "length", 100000, "usage: -length 1000")
	flag.IntVar(&etime, "time", 1000, "usage: -time 1000")
	flag.IntVar(&sampleSize, "samplesize", 100, "usage: -samplesize 1000")
	flag.IntVar(&stepSize, "stepsize", 1000, "usage: -stepsize 1000")
	flag.IntVar(&maxL, "maxl", 1000, "usage: -maxl 1000")
	flag.IntVar(&fragment, "fragment", 1000, "usage: -fragment 1000")
	flag.Float64Var(&mutationRate, "mutation", 1, "usage: -mutation 1e-8")
	flag.Float64Var(&transferRate, "transfer", 0, "usage: -transfer 1e-9")
	flag.StringVar(&prex, "prex", "default", "usage: -prex default")
	flag.StringVar(&dir, "out", "out", "usage: -dir out")

	// parse flags
	flag.Parse()
	log.SetPrefix(prex + ":")

	// get start time
	tnow = time.Now()
	log.Printf("Begin at %v\n", tnow.Format("Mon Jan 2 15:04:05"))

	// init population
	pop = fwd.NewSeqPopulation(size, length, fragment, mutationRate, transferRate)
	//log.Println("Population: ", pop)
	log.Println("Population initialized.")

	// determine how many cpus that we can use
	ncpu := runtime.NumCPU()
	runtime.GOMAXPROCS(ncpu)
	log.Println("Number of CPU used: ", ncpu)
}
开发者ID:mingzhi,项目名称:gomain,代码行数:32,代码来源:fwd_main.go


示例7: handleUpdate

func handleUpdate() error {
	var api string
	flag.StringVar(&api, "api", "", "Binding host:port for http/artifact server. Optional if SM_API env is set.")
	flag.StringVar(&statsd.Config.ProducerProperties, "producer.properties", "", "Producer.properties file name.")
	flag.StringVar(&statsd.Config.Topic, "topic", "", "Topic to produce data to.")
	flag.StringVar(&statsd.Config.Transform, "transform", "", "Transofmation to apply to each metric. none|avro|proto")
	flag.StringVar(&statsd.Config.SchemaRegistryUrl, "schema.registry.url", "", "Avro Schema Registry url for transform=avro")
	flag.Float64Var(&statsd.Config.Cpus, "cpu", 0.1, "CPUs per task")
	flag.Float64Var(&statsd.Config.Mem, "mem", 64, "Mem per task")

	flag.Parse()

	if err := resolveApi(api); err != nil {
		return err
	}

	request := statsd.NewApiRequest(statsd.Config.Api + "/api/update")
	request.AddParam("producer.properties", statsd.Config.ProducerProperties)
	request.AddParam("topic", statsd.Config.Topic)
	request.AddParam("transform", statsd.Config.Transform)
	request.AddParam("schema.registry.url", statsd.Config.SchemaRegistryUrl)
	request.AddParam("cpu", strconv.FormatFloat(statsd.Config.Cpus, 'E', -1, 64))
	request.AddParam("mem", strconv.FormatFloat(statsd.Config.Mem, 'E', -1, 64))
	response := request.Get()

	fmt.Println(response.Message)

	return nil
}
开发者ID:smorin,项目名称:statsd-mesos-kafka,代码行数:29,代码来源:cli.go


示例8: loadConfig

// Responsible for loading up our config.json && || all the command lines switches. The way this is setup
// will be order specific on the command line. Only exception to this rule is env-vars (see EnvVars()).
//
// E.g.
//
// # address will override config.json if it is defined in config.json.
// mesos-runonce -config=config.json -address=address
//
// # config.json will override address if it is defined in config.json.
// mesos-runonce -address=address -config=config.json
func loadConfig() *Config {
	cfg := new(Config)

	flag.BoolVar(&cfg.Task.Docker.ForcePullImage, "force-pull", false, "Boolean for forcing pull of image before run.")
	flag.Float64Var(&cfg.Task.Docker.Cpus, "cpus", 1.0, "How many CPUs to use.")
	flag.Float64Var(&cfg.Task.Docker.Mem, "mem", 10, "How much memory to use.")
	flag.IntVar(&cfg.TaskCount, "task-count", 1, "Total task count to run.")
	flag.StringVar(&cfg.Runonce.Address, "address", "127.0.0.1", "Address for mesos to callback on.")
	flag.StringVar(&cfg.Runonce.AuthPrincipal, "principal", "", "Mesos authentication principal.")
	flag.StringVar(&cfg.Runonce.AuthProvider, "authentication-provider", sasl.ProviderName, fmt.Sprintf("Authentication provider to use, default is SASL that supports mechanisms: %+v", mech.ListSupported()))
	flag.StringVar(&cfg.Runonce.AuthSecretFile, "secret-file", "", "Mesos authentication secret file.")
	flag.StringVar(&cfg.Runonce.Master, "master", "127.0.0.1:5050", "Master address <ip:port>")
	flag.StringVar(&cfg.Runonce.MesosRunasUser, "user", "root", "Mesos user to run tasks as.")
	flag.StringVar(&cfg.Runonce.MesosRole, "role", "", "Mesos role to run tasks with.")
	flag.StringVar(&cfg.Task.Docker.Cmd, "docker-cmd", "", "Docker command to run.")
	flag.StringVar(&cfg.Task.Docker.EnvString, "env-vars", "", "Docker env vars for the container. E.g. -env-vars='{\"env\":{\"FOO\":\"bar\"}}'")
	flag.StringVar(&cfg.Task.Docker.Image, "docker-image", "", "Docker image to run.")
	flag.StringVar(&cfg.Task.Id, "task-id", "", "Mesos task id to identify the task.")
	flag.StringVar(&cfg.Task.Name, "task-name", "", "Mesos task name to label the task.")
	flag.UintVar(&cfg.Runonce.BindingPort, "port", 0, "Port for address to use for mesos to callback.")
	flag.Var(cfg, "config", "Runonce config of JSON. See spec in config.go for details.")

	flag.Parse()

	return cfg
}
开发者ID:yp-engineering,项目名称:mesos-runonce,代码行数:36,代码来源:config.go


示例9: init

func init() {
	flag.Float64Var(&size, "s", 40, "bubble size")
	flag.Float64Var(&niter, "n", 200, "number of iterations")
	flag.Float64Var(&opacity, "o", 0.5, "opacity")
	flag.Parse()
	rand.Seed(int64(time.Now().Nanosecond()) % int64(1e9))
}
开发者ID:stanim,项目名称:svgof,代码行数:7,代码来源:bubtrail.go


示例10: main

func main() {
	runtime.GOMAXPROCS(2)
	var xmin, ymin, xmax, ymax float64
	var zoomlevel, maptype, max_zoomlevel int
	var filename string

	flag.Float64Var(&xmin, "xmin", 55.397945, "Minimum longitude")
	flag.Float64Var(&xmax, "xmax", 55.402741, "Maximum longitude")
	flag.Float64Var(&ymin, "ymin", 25.291090, "Minimum latitude")
	flag.Float64Var(&ymax, "ymax", 25.292889, "Maximum latitude")
	flag.StringVar(&filename, "filename", "/path/to/file.mbtile", "Output file to generate")
	flag.IntVar(&zoomlevel, "zoomlevel", 19, "Zoom level")
	flag.IntVar(&maptype, "maptype", 0, "0 for Google, 1 for OSM, 2 for mapbox satellite street")
	flag.IntVar(&max_zoomlevel, "max_zoomlevel", MAX_ZOOM_LEVEL, "Maximum zoomlevel to which tiles should be added")
	flag.Parse()

	proj := NewProjection(xmin, ymin, xmax, ymax, zoomlevel, max_zoomlevel)
	tiles := proj.TileList()
	log.Println("Filename: ", filename, " Zoom level ", zoomlevel, "-", max_zoomlevel, "  Number of tiles ", len(tiles))

	db, err := prepareDatabase(filename)
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	err = setupMBTileTables(db)
	if err != nil {
		log.Fatal(err)
	}

	inputPipe := make(chan Tile, len(tiles))
	tilePipe := make(chan Tile, len(tiles))
	outputPipe := make(chan Tile, len(tiles))

	for w := 0; w < 20; w++ {
		go tileFetcher(inputPipe, tilePipe, maptype)
	}

	for w := 0; w < 1; w++ {
		go mbTileWorker(db, tilePipe, outputPipe)
	}

	for _, tile := range tiles {
		inputPipe <- tile
	}

	// Waiting to complete the creation of db.
	for i := 0; i < len(tiles); i++ {
		<-outputPipe
	}

	err = optimizeDatabase(db)
	if err != nil {
		log.Fatal(err)
	}
	log.Println("Generated ", filename)

}
开发者ID:ragsagar,项目名称:mbtilego,代码行数:59,代码来源:mbutil.go


示例11: PhaseMain

func PhaseMain() {
	var a, b float64
	flag.Float64Var(&a, "a", 0.1, "para for logistic map")
	flag.Float64Var(&b, "b", 0.3, "para for logistic map")
	flag.Parse()
	fmt.Printf("Para a: %f, b: %f\n", a, b)
	PhaseGraph(a, b)
}
开发者ID:rosrad,项目名称:nonlinear-system,代码行数:8,代码来源:henon.go


示例12: init

func init() {
	width, height = openvg.Init()
	flag.Float64Var(&size, "s", float64(width)*.05, "bubble size")
	flag.IntVar(&niter, "n", width/6, "number of iterations")
	flag.Float64Var(&opacity, "o", 0.5, "opacity")
	flag.Parse()
	rand.Seed(int64(time.Now().Nanosecond()) % 1e9)
}
开发者ID:jhautefeuille,项目名称:openvg,代码行数:8,代码来源:bubtrail.go


示例13: main

func main() {
	var l1weight float64
	var l2weight float64
	var feature_num int
	var m int
	var tol float64
	var quiet bool
	var feature_file string
	var output_file string
	flag.Float64Var(&l1weight, "l1weight", 1.0, "coefficient of l1 regularizer (default is 1)")
	flag.Float64Var(&l2weight, "l2weight", 0.0, "coefficient of l2 regularizer(default is 0)")
	flag.IntVar(&m, "m", 10, "sets L-BFGS memory parameter (default is 10)")
	flag.IntVar(&feature_num, "num", 5, "total feature count")
	flag.Float64Var(&tol, "tol", 0.0001, " sets convergence tolerance (default is 1e-4)")
	flag.BoolVar(&quiet, "quiet", false, "Suppress all output information")
	flag.StringVar(&feature_file, "input", "./testdata", "the path of input feature file")
	flag.StringVar(&output_file, "output", "./model", "the path of output model file")
	flag.Parse()
	fmt.Println("feature_num:", feature_num, "  l1weight:", l1weight)
	lr := owlqn.NewLogisticRegression(feature_file, feature_num)

	obj := owlqn.NewLogisticRegressionObjective(lr, float32(l2weight))

	init := make([]float32, feature_num)
	for i := 0; i < len(init); i++ {
		init[i] = rand.Float32()
	}
	result := make([]float32, feature_num)
	opt := owlqn.NewOWLQN(quiet)
	fmt.Println("init:", init)
	opt.Minimize(obj, init, result, float32(l1weight), float32(tol), m)

	nonZero := 0
	for i := 0; i < feature_num; i++ {
		if result[i] != 0.0 {
			nonZero++
		}
	}
	fmt.Printf("Finished train,%d/%d nonZero weight\n", nonZero, feature_num)
	fmt.Println("result:", result)

	f, err := os.Create(output_file)
	if err != nil {
		fmt.Printf("%v\n", err)
		os.Exit(1)
	}
	defer f.Close()
	br := bufio.NewWriter(f)
	br.WriteString("feature_num=" + strconv.FormatInt(int64(feature_num), 10) + "\n")
	br.WriteString("l1weight=" + strconv.FormatFloat(float64(l1weight), 'f', 4, 32) + "\n")
	br.Flush()
	for i := 0; i < feature_num; i++ {
		res := strconv.FormatFloat(float64(result[i]), 'f', 4, 32)
		br.WriteString(res + "\n")
		br.Flush()
	}

}
开发者ID:postfix,项目名称:OWLQN,代码行数:58,代码来源:test.go


示例14: init

// init sets up command flags
func init() {
	flag.BoolVar(&localfile, "f", false, "read from local files")
	flag.BoolVar(&postlink, "p", false, "link to original post")
	flag.Float64Var(&ncols, "nc", 5, "number of columns")
	flag.Float64Var(&gutter, "g", 5, "gutter (pixels)")
	flag.Float64Var(&thumbwidth, "tw", 75, "thumbnail width")
	flag.Float64Var(&piclimit, "n", 30, "picture limit")
	flag.StringVar(&filtertag, "tag", "", "filter tag")
	flag.Parse()
}
开发者ID:stanim,项目名称:svgof,代码行数:11,代码来源:tumblrgrid.go


示例15: init

func init() {
	flag.StringVar(&algSuffix, "algorithm", "sp", "the algorithm suffix to use")
	flag.StringVar(&constrained, "constrained", "", "name of constraint to pass")
	flag.IntVar(&intConstrained, "intConstrained", 0, "int value of constraint")
	flag.Float64Var(&upperLat, "upperLat", 54.0, "upper latitude")
	flag.Float64Var(&lowerLat, "lowerLat", 47.0, "lower latitude")
	flag.Float64Var(&leftLon, "leftLon", 5.9, "left longitude")
	flag.Float64Var(&rightLon, "rightLon", 14.9, "right longitude")
	flag.UintVar(&numPoints, "numPoints", 2, "number of points in request")
	rand.Seed(42) // So we get always the same points
}
开发者ID:ToureNPlaner,项目名称:perftester,代码行数:11,代码来源:stdalgtest.go


示例16: getArgs

func getArgs() args {
	params := args{}
	flag.UintVar(&params.sheeplecnt, "sheeple", 0, "Number of sheeple")
	flag.UintVar(&params.tvcnt, "tv", 0, "Number of TVs")
	flag.UintVar(&params.itermax, "iterations", 100, "Number of iterations")
	flag.Float64Var(&params.width, "width", 10, "Torus width")
	flag.Float64Var(&params.height, "height", 10, "Torus height")
	flag.StringVar(&params.beliefs, "beliefs", "A,B,C", "Comma separated belief list")
	flag.Parse()
	return params
}
开发者ID:johnny-morrice,项目名称:amoebethics,代码行数:11,代码来源:amoeconf.go


示例17: init

// init sets up the command line flags.
func init() {
	flag.BoolVar(&poster, "poster", false, "poster style")
	flag.BoolVar(&opacity, "opacity", false, "opacity style")
	flag.BoolVar(&row, "row", false, "display is a single row")
	flag.BoolVar(&col, "col", false, "display in a single column")
	flag.BoolVar(&offset, "offset", false, "display in a row, even layers offset")
	flag.Float64Var(&width, "width", stdwidth, "image width")
	flag.Float64Var(&height, "height", stdheight, "image height")
	flag.StringVar(&title, "title", "", "title")
	flag.Parse()
}
开发者ID:stanim,项目名称:svgof,代码行数:12,代码来源:ltr.go


示例18: main

func main() {
	cd, err := NewCheckDocker("")
	if err != nil {
		nagios.Critical(err)
	}

	var dockerEndpoint string

	flag.StringVar(&dockerEndpoint, "base-url", "http://localhost:2375", "The Base URL for the Docker server")
	flag.Float64Var(&cd.WarnMetaSpace, "warn-meta-space", 100, "Warning threshold for Metadata Space")
	flag.Float64Var(&cd.CritMetaSpace, "crit-meta-space", 100, "Critical threshold for Metadata Space")
	flag.Float64Var(&cd.WarnDataSpace, "warn-data-space", 100, "Warning threshold for Data Space")
	flag.Float64Var(&cd.CritDataSpace, "crit-data-space", 100, "Critical threshold for Data Space")
	flag.StringVar(&cd.ImageId, "image-id", "", "An image ID that must be running on the Docker server")
	flag.StringVar(&cd.ContainerName, "container-name", "", "The name of a container that must be running on the Docker server")
	flag.StringVar(&cd.TLSCertPath, "tls-cert", "", "Path to TLS cert file.")
	flag.StringVar(&cd.TLSKeyPath, "tls-key", "", "Path to TLS key file.")
	flag.StringVar(&cd.TLSCAPath, "tls-ca", "", "Path to TLS CA file.")

	flag.Parse()

	err = cd.setupClient(dockerEndpoint)
	if err != nil {
		nagios.Critical(err)
	}

	err = cd.GetData()
	if err != nil {
		nagios.Critical(err)
	}

	baseStatus := &nagios.NagiosStatus{fmt.Sprintf("Total Containers: %v", len(cd.dockerContainersData)), nagios.NAGIOS_OK}

	statuses := make([]*nagios.NagiosStatus, 0)

	driver := cd.dockerInfoData.Get("Driver")

	// Unfortunately, Metadata Space and Data Space information is only available on devicemapper
	if driver == "devicemapper" {
		statuses = append(statuses, cd.CheckMetaSpace(cd.WarnMetaSpace, cd.CritMetaSpace))
		statuses = append(statuses, cd.CheckDataSpace(cd.WarnDataSpace, cd.CritDataSpace))
	}

	if cd.ImageId != "" {
		statuses = append(statuses, cd.CheckImageContainerIsInGoodShape(cd.ImageId))
	}

	if cd.ContainerName != "" {
		statuses = append(statuses, cd.CheckNamedContainerIsInGoodShape(cd.ContainerName))
	}

	baseStatus.Aggregate(statuses)
	nagios.ExitWithStatus(baseStatus)
}
开发者ID:avldya,项目名称:check_docker,代码行数:54,代码来源:check_docker.go


示例19: init

func init() {
	flag.Usage = usage

	flag.StringVar(&filename, "o", "fractal.png", "output filename.")
	flag.IntVar(&width, "width", 1920, "image width.")
	flag.IntVar(&height, "height", 1080, "image height.")
	flag.Float64Var(&iterations, "i", 1000, "number of iterations.")
	flag.Float64Var(&zoom, "z", 1, "zoom level.")
	flag.Float64Var(&centerReal, "cr", 0, "real value of center offset.")
	flag.Float64Var(&centerImag, "ci", 0, "imaginary value of center offset.")
	flag.StringVar(&colorScheme, "t", "smooth", "color scheme")
}
开发者ID:karlek,项目名称:vanilj,代码行数:12,代码来源:vanilj.go


示例20: parseArguments

func parseArguments(args *commandLine) {
	flag.UintVar(&args.iterateLimit, "iterateLimit", 255, "Maximum number of iterations")
	flag.Float64Var(&args.divergeLimit, "divergeLimit", 4.0, "Limit where function is said to diverge to infinity")
	flag.UintVar(&args.width, "imageWidth", 800, "Width of output PNG")
	flag.UintVar(&args.height, "imageHeight", 600, "Height of output PNG")
	flag.StringVar(&args.filename, "filename", "mandelbrot.png", "Name of output PNG")
	flag.Float64Var(&args.xOffset, "xOffset", -1.5, "Leftmost position of complex plane projected onto PNG image")
	flag.Float64Var(&args.yOffset, "yOffset", 1.0, "Topmost position of complex plane projected onto PNG image")
	flag.Float64Var(&args.zoom, "zoom", 1.0, "Look into the eyeball")
	flag.StringVar(&args.mode, "mode", "sequential", "Render mode")
	flag.Parse()
}
开发者ID:technicalities,项目名称:godelbrot,代码行数:12,代码来源:godelbrot.go



注:本文中的flag.Float64Var函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang flag.Int函数代码示例发布时间:2022-05-24
下一篇:
Golang flag.Float64函数代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap