text:
r"""
Class describing a one-shot build configuration object
"""

import logging as log
import os
from collections import OrderedDict

from Deploy import CompileOneShot
from FlowCfg import FlowCfg
from Modes import BuildModes, Modes
from utils import rm_path

class OneShotCfg(FlowCfg):
    """Simple one-shot build flow for non-simulation targets like
    linting, synthesis and FPV.
    """

    ignored_wildcards = (FlowCfg.ignored_wildcards +
                         ['build_mode', 'index', 'test'])

    def __init__(self, flow_cfg_file, hjson_data, args, mk_config):
        # Options set from command line
        self.tool = args.tool
        self.verbose = args.verbose
        self.flist_gen_cmd = ""
        self.flist_gen_opts = []
        self.sv_flist_gen_dir = ""
        self.flist_file = ""
        self.build_cmd = ""
        self.build_opts = []
        self.build_log = ""
        self.report_cmd = ""
        self.report_opts = []
        self.build_opts.extend(args.build_opts)
        self.build_unique = args.build_unique
        self.build_only = args.build_only

        # Options built from cfg_file files
        self.project = ""
        self.flow = ""
        self.flow_makefile = ""
        self.scratch_path = ""
        self.build_dir = ""
        self.run_dir = ""
        self.pass_patterns = []
        self.fail_patterns = []
        self.name = ""
        self.dut = ""
        self.fusesoc_core = ""
        self.ral_spec = ""
        self.build_modes = []
        self.run_modes = []
        self.regressions = []
        self.max_msg_count = -1

        # Flow results
        self.result = OrderedDict()
        self.result_summary = OrderedDict()

        self.dry_run = args.dry_run

        # Not needed for this build
        self.verbosity = ""
        self.en_build_modes = []

        # Generated data structures
        self.links = {}
        self.build_list = []
        self.deploy = []
        self.cov = args.cov

        super().__init__(flow_cfg_file, hjson_data, args, mk_config)

    def _merge_hjson(self, hjson_data):
        # If build_unique is set, then add current timestamp to uniquify it
        if self.build_unique:
            self.build_dir += "_" + self.timestamp

        super()._merge_hjson(hjson_data)

    def _expand(self):
        super()._expand()

        # Stuff below only pertains to individual cfg (not primary cfg).
        if not self.is_primary_cfg and (not self.select_cfgs or
                                        self.name in self.select_cfgs):
            # Print scratch_path at the start:
            log.info("[scratch_path]: [%s] [%s]", self.name, self.scratch_path)

            # Set directories with links for ease of debug / triage.
            self.links = {
                "D": self.scratch_path + "/" + "dispatched",
                "P": self.scratch_path + "/" + "passed",
                "F": self.scratch_path + "/" + "failed",
                "K": self.scratch_path + "/" + "killed"
            }

            # Use the default build mode for tests that do not specify it
            if not hasattr(self, "build_mode"):
                setattr(self, "build_mode", "default")

            # Create objects from raw dicts - build_modes, sim_modes, run_modes,
            # tests and regressions, only if not a primary cfg obj
            self._create_objects()

    # Purge the output directories. This operates on self.
    def _purge(self):
        assert self.scratch_path
        log.info("Purging scratch path %s", self.scratch_path)
        rm_path(self.scratch_path)

    def _create_objects(self):
        # Create build and run modes objects
        build_modes = Modes.create_modes(BuildModes,
                                         getattr(self, "build_modes"))
        setattr(self, "build_modes", build_modes)

        # All defined build modes are being built, h
        # ence extend all with the global opts.
        for build_mode in build_modes:
            build_mode.build_opts.extend(self.build_opts)

    def _print_list(self):
        for list_item in self.list_items:
            log.info("---- List of %s in %s ----", list_item, self.name)
            if hasattr(self, list_item):
                items = getattr(self, list_item)
                for item in items:
                    log.info(item)
            else:
                log.error("Item %s does not exist!", list_item)

    def _create_dirs(self):
        '''Create initial set of directories
        '''
        for link in self.links.keys():
            rm_path(self.links[link])
            os.makedirs(self.links[link])

    def _create_deploy_objects(self):
        '''Create deploy objects from build modes
        '''
        builds = []
        build_map = {}
        for build in self.build_modes:
            item = CompileOneShot(build, self)
            builds.append(item)
            build_map[build] = item

        self.builds = builds
        self.deploy = builds

        # Create initial set of directories before kicking off the regression.
        self._create_dirs()


text:
Chat

    <form class="col-xs-12 col-md-offset-4 col-md-4" ng-submit="sendMessage();">
      <fieldset class="row">

          <input type="text" id="messageText" name="messageText" class="form-control" ng-model="messageText" placeholder="Enter new message" autocomplete="off">

            <button type="submit" class="btn PUButton" ng-disabled="!messageText.length">Submit</button>

      </fieldset>
    </form>

redpajama_set_name: RedPajamaGithub


text:
actions :deploy

default_action :deploy

attribute :name,           kind_of: String, name_attribute: true
attribute :user,           kind_of: String, default: nil
attribute :fabric_command, kind_of: String, required: true
attribute :shared_dirs,    kind_of: Hash, default: {'log' => true, 'tmp' => true, 'bundle' => false, 'config' => false}
attribute :envvars,        kind_of: Hash, default: {}
attribute :packages,       kind_of: Array, default: []


text:
====================================
Mathematical Functions and Operators
====================================

Mathematical Operators
----------------------

======== ===========
Operator Description
======== ===========
``+``    Addition
``-``    Subtraction
``*``    Multiplication
``/``    Division (integer division performs truncation)
``%``    Modulus (remainder)
======== ===========

Mathematical Functions
----------------------

.. function:: abs(x) -> [same as input]

    Returns the absolute value of ``x``.

.. function:: cbrt(x) -> double

    Returns the cube root of ``x``.

.. function:: ceil(x) -> [same as input]

    This is an alias for :func:`ceiling`.

.. function:: ceiling(x) -> [same as input]

    Returns ``x`` rounded up to the nearest integer.

.. function:: cosine_similarity(x, y) -> double

    Returns the cosine similarity between the sparse vectors ``x`` and ``y``::

        SELECT cosine_similarity(MAP(ARRAY['a'], ARRAY[1.0]), MAP(ARRAY['a'], ARRAY[2.0])); -- 1.0

.. function:: degrees(x) -> double

    Converts angle ``x`` in radians to degrees.

.. function:: e() -> double

    Returns the constant Euler's number.

.. function:: exp(x) -> double

    Returns Euler's number raised to the power of ``x``.

.. function:: floor(x) -> [same as input]

    Returns ``x`` rounded down to the nearest integer.

.. function:: from_base(string, radix) -> bigint

    Returns the value of ``string`` interpreted as a base-``radix`` number.

.. function:: inverse_normal_cdf(mean, sd, p) -> double

    Compute the inverse of the Normal cdf with given mean and standard
    deviation (sd) for the cumulative probability (p): P(N < n). The mean must be
    a real value and the standard deviation must be a real and positive value.
    The probability p must lie on the interval (0, 1).

.. function:: normal_cdf(mean, sd, v) -> double

    Compute the Normal cdf with given mean and standard deviation (sd):  P(N < v; mean, sd).
    The mean and value v must be real values and the standard deviation must be a real
    and positive value.

.. function:: inverse_beta_cdf(a, b, p) -> double

    Compute the inverse of the Beta cdf with given a, b parameters for the cumulative
    probability (p): P(N < n). The a, b parameters must be positive real values.
    The probability p must lie on the interval [0, 1].

.. function:: beta_cdf(a, b, v) -> double

    Compute the Beta cdf with given a, b parameters:  P(N < v; a, b).
    The a, b parameters must be positive real numbers and value v must be a real value.
    The value v must lie on the interval [0, 1].

.. function:: ln(x) -> double

    Returns the natural logarithm of ``x``.

.. function:: log(b, x) -> double

    Returns the base ``b`` logarithm of ``x``.

.. function:: log2(x) -> double

    Returns the base 2 logarithm of ``x``.

.. function:: log10(x) -> double

    Returns the base 10 logarithm of ``x``.

.. function:: mod(n, m) -> [same as input]

    Returns the modulus (remainder) of ``n`` divided by ``m``.

.. function:: pi() -> double

    Returns the constant Pi.

.. function:: pow(x, p) -> double

    This is an alias for :func:`power`.

.. function:: power(x, p) -> double

    Returns ``x`` raised to the power of ``p``.

.. function:: radians(x) -> double

    Converts angle ``x`` in degrees to radians.

.. function:: rand() -> double

    This is an alias for :func:`random()`.

.. function:: random() -> double

    Returns a pseudo-random value in the range 0.0 <= x < 1.0.

.. function:: random(n) -> [same as input]

    Returns a pseudo-random number between 0 and n (exclusive).

.. function:: round(x) -> [same as input]

    Returns ``x`` rounded to the nearest integer.

.. function:: round(x, d) -> [same as input]

    Returns ``x`` rounded to ``d`` decimal places.

.. function:: sign(x) -> [same as input]

    Returns the signum function of ``x``, that is:

    * 0 if the argument is 0,
    * 1 if the argument is greater than 0,
    * -1 if the argument is less than 0.

    For double arguments, the function additionally returns:

    * NaN if the argument is NaN,
    * 1 if the argument is +Infinity,
    * -1 if the argument is -Infinity.

.. function:: sqrt(x) -> double

    Returns the square root of ``x``.

.. function:: to_base(x, radix) -> varchar

    Returns the base-``radix`` representation of ``x``.

.. function:: truncate(x) -> double

    Returns ``x`` rounded to integer by dropping digits after decimal point.

.. function:: width_bucket(x, bound1, bound2, n) -> bigint

    Returns the bin number of ``x`` in an equi-width histogram with the
    specified ``bound1`` and ``bound2`` bounds and ``n`` number of buckets.

.. function:: width_bucket(x, bins) -> bigint

    Returns the bin number of ``x`` according to the bins specified by the
    array ``bins``. The ``bins`` parameter must be an array of doubles and is
    assumed to be in sorted ascending order.

Statistical Functions
-----------------------

.. function:: wilson_interval_lower(successes, trials, z) -> double

    Returns the lower bound of the Wilson score interval of a Bernoulli trial process
    at a confidence specified by the z-score ``z``.

.. function:: wilson_interval_upper(successes, trials, z) -> double

    Returns the upper bound of the Wilson score interval of a Bernoulli trial process
    at a confidence specified by the z-score ``z``.

Trigonometric Functions
-----------------------

All trigonometric function arguments are expressed in radians.
See unit conversion functions :func:`degrees` and :func:`radians`.

.. function:: acos(x) -> double

    Returns the arc cosine of ``x``.

.. function:: asin(x) -> double

    Returns the arc sine of ``x``.

.. function:: atan(x) -> double

    Returns the arc tangent of ``x``.

.. function:: atan2(y, x) -> double

    Returns the arc tangent of ``y / x``.

.. function:: cos(x) -> double

    Returns the cosine of ``x``.

.. function:: cosh(x) -> double

    Returns the hyperbolic cosine of ``x``.

.. function:: sin(x) -> double

    Returns the sine of ``x``.

.. function:: tan(x) -> double

    Returns the tangent of ``x``.

.. function:: tanh(x) -> double

    Returns the hyperbolic tangent of ``x``.

Floating Point Functions
------------------------

.. function:: infinity() -> double

    Returns the constant representing positive infinity.

.. function:: is_finite(x) -> boolean

    Determine if ``x`` is finite.

.. function:: is_infinite(x) -> boolean

    Determine if ``x`` is infinite.

.. function:: is_nan(x) -> boolean

    Determine if ``x`` is not-a-number.

.. function:: nan() -> double

    Returns the constant representing not-a-number.


text:
Adds a "view" link to Magento static block grid in Adminhtml

##The problem

Admin grid rows in Magento have their click target set via Javascript. This is a Bad Thing™ because control/command-click events are largely ignored, meaning it is impossible to open line-items in a new tab.

Other admin grids in Magento provide an "Edit" or "View" link in a column (e.g. Sales Order) that works around this problem as the click target is the <a> tag and not the Javascript outer link.

##The solution

This module adds the view link to the right-most column in your static block grid view. This allows you to control/command-click to open multiples in new tabs without navigating away from the current static block grid view.

![static block grid view](http://i.imgur.com/yGnrTQX.png)

##License

The MIT License (MIT)

Copyright (c) 2015 Phillip Jackson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
package org.apache.tools.ant.util;

/**
 * Interface for classes that want to be notified by Watchdog.
 *
 * @since Ant 1.5
 *
 * @see org.apache.tools.ant.util.Watchdog
 *
 */
public interface TimeoutObserver {

    /**
     * Called when the watchdow times out.
     *
     * @param w the watchdog that timed out.
     */
    void timeoutOccured(Watchdog w);
}


text:
// Copyright 2016 The Cockroach 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, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
//
// Author: Ben Darnell

package cli

import (
	"bytes"
	"errors"
	"fmt"
	"strconv"

	"github.com/cockroachdb/cockroach/config"
	"github.com/cockroachdb/cockroach/keys"
	"github.com/cockroachdb/cockroach/roachpb"
	"github.com/cockroachdb/cockroach/storage"
	"github.com/cockroachdb/cockroach/storage/engine"
	"github.com/cockroachdb/cockroach/util/stop"
	"github.com/cockroachdb/cockroach/util/timeutil"
	"github.com/coreos/etcd/raft/raftpb"
	"github.com/gogo/protobuf/proto"
	"github.com/kr/pretty"
	"github.com/spf13/cobra"
)

var debugKeysCmd = &cobra.Command{
	Use:   "keys [directory]",
	Short: "dump all the keys in a store",
	Long: `
Pretty-prints all keys in a store.
`,
	RunE: runDebugKeys,
}

func parseRangeID(arg string) (roachpb.RangeID, error) {
	rangeIDInt, err := strconv.ParseInt(arg, 10, 64)
	if err != nil {
		return 0, err
	}
	return roachpb.RangeID(rangeIDInt), nil
}

func openStore(cmd *cobra.Command, dir string, stopper *stop.Stopper) (engine.Engine, error) {
	initCacheSize()

	db := engine.NewRocksDB(roachpb.Attributes{}, dir,
		cliContext.CacheSize, cliContext.MemtableBudget, 0, stopper)
	if err := db.Open(); err != nil {
		return nil, err
	}
	return db, nil
}

func printKey(kv engine.MVCCKeyValue) (bool, error) {
	fmt.Printf("%q\n", kv.Key)

	return false, nil
}

func printKeyValue(kv engine.MVCCKeyValue) (bool, error) {
	if kv.Key.Timestamp != roachpb.ZeroTimestamp {
		fmt.Printf("%s %q: ", kv.Key.Timestamp, kv.Key.Key)
	} else {
		fmt.Printf("%q: ", kv.Key.Key)
	}
	for _, decoder := range []func(kv engine.MVCCKeyValue) (string, error){tryRaftLogEntry, tryRangeDescriptor, tryMeta, trySequence, tryTxn} {
		out, err := decoder(kv)
		if err != nil {
			continue
		}
		fmt.Println(out)
		return false, nil
	}
	// No better idea, just print raw bytes and hope that folks use `less -S`.
	fmt.Printf("%q\n\n", kv.Value)
	return false, nil
}

func runDebugKeys(cmd *cobra.Command, args []string) error {
	stopper := stop.NewStopper()
	defer stopper.Stop()

	if len(args) != 1 {
		return errors.New("one argument is required")
	}

	db, err := openStore(cmd, args[0], stopper)
	if err != nil {
		return err
	}

	d := cliContext.debug

	from := engine.NilKey
	to := engine.MVCCKeyMax
	if d.raw {
		if len(d.startKey) > 0 {
			from = engine.MakeMVCCMetadataKey(roachpb.Key(d.startKey))
		}
		if len(d.endKey) > 0 {
			to = engine.MakeMVCCMetadataKey(roachpb.Key(d.endKey))
		}
	} else {
		if len(d.startKey) > 0 {
			startKey, err := keys.UglyPrint(d.startKey)
			if err != nil {
				return err
			}
			from = engine.MakeMVCCMetadataKey(startKey)
		}
		if len(d.endKey) > 0 {
			endKey, err := keys.UglyPrint(d.endKey)
			if err != nil {
				return err
			}
			to = engine.MakeMVCCMetadataKey(endKey)
		}
	}

	printer := printKey
	if d.values {
		printer = printKeyValue
	}

	if err := db.Iterate(from, to, printer); err != nil {
		return err
	}

	return nil
}

var debugRangeDescriptorsCmd = &cobra.Command{
	Use:   "range-descriptors [directory]",
	Short: "print all range descriptors in a store",
	Long: `
Prints all range descriptors in a store with a history of changes.
`,
	RunE: runDebugRangeDescriptors,
}

func descStr(desc roachpb.RangeDescriptor) string {
	return fmt.Sprintf("[%s, %s)\n\tRaw:%s\n",
		desc.StartKey, desc.EndKey, &desc)
}

func tryMeta(kv engine.MVCCKeyValue) (string, error) {
	if !bytes.HasPrefix(kv.Key.Key, keys.Meta1Prefix) && !bytes.HasPrefix(kv.Key.Key, keys.Meta2Prefix) {
		return "", errors.New("not a meta key")
	}
	value := roachpb.Value{
		Timestamp: kv.Key.Timestamp,
		RawBytes:  kv.Value,
	}
	var desc roachpb.RangeDescriptor
	if err := value.GetProto(&desc); err != nil {
		return "", err
	}
	return descStr(desc), nil
}

func maybeUnmarshalInline(v []byte, dest proto.Message) error {
	var meta engine.MVCCMetadata
	if err := meta.Unmarshal(v); err != nil {
		return err
	}
	value := roachpb.Value{
		RawBytes: meta.RawBytes,
	}
	return value.GetProto(dest)
}

func tryTxn(kv engine.MVCCKeyValue) (string, error) {
	var txn roachpb.Transaction
	if err := maybeUnmarshalInline(kv.Value, &txn); err != nil {
		return "", err
	}
	return txn.String() + "\n", nil
}

func trySequence(kv engine.MVCCKeyValue) (string, error) {
	if kv.Key.Timestamp != roachpb.ZeroTimestamp {
		return "", errors.New("not a sequence cache key")
	}
	_, _, _, err := keys.DecodeSequenceCacheKey(kv.Key.Key, nil)
	if err != nil {
		return "", err
	}
	var dest roachpb.SequenceCacheEntry
	if err := maybeUnmarshalInline(kv.Value, &dest); err != nil {
		return "", err
	}
	return fmt.Sprintf("ts=%s, key=%q\n", dest.Timestamp, dest.Key), nil
}

func tryRangeDescriptor(kv engine.MVCCKeyValue) (string, error) {
	_, suffix, _, err := keys.DecodeRangeKey(kv.Key.Key)
	if err != nil {
		return "", err
	}
	if !bytes.Equal(suffix, keys.LocalRangeDescriptorSuffix) {
		return "", fmt.Errorf("wrong suffix: %s", suffix)
	}
	value := roachpb.Value{
		RawBytes: kv.Value,
	}
	var desc roachpb.RangeDescriptor
	if err := value.GetProto(&desc); err != nil {
		return "", err
	}
	return descStr(desc), nil
}

func printRangeDescriptor(kv engine.MVCCKeyValue) (bool, error) {
	if out, err := tryRangeDescriptor(kv); err != nil {
		fmt.Printf("%s %q: invalid value: %v", kv.Key.Timestamp, kv.Key.Key, err)
	} else {
		fmt.Println(out)
	}
	return true, nil
}

func runDebugRangeDescriptors(cmd *cobra.Command, args []string) error {
	stopper := stop.NewStopper()
	defer stopper.Stop()

	if len(args) != 1 {
		return errors.New("one argument is required")
	}

	db, err := openStore(cmd, args[0], stopper)
	if err != nil {
		return err
	}

	start := engine.MakeMVCCMetadataKey(keys.LocalRangePrefix)
	end := engine.MakeMVCCMetadataKey(keys.LocalRangeMax)

	if err := db.Iterate(start, end, printRangeDescriptor); err != nil {
		return err
	}
	return nil
}

var debugRaftLogCmd = &cobra.Command{
	Use:   "raft-log [directory] [range id]",
	Short: "print the raft log for a range",
	Long: `
Prints all log entries in a store for the given range.
`,
	RunE: runDebugRaftLog,
}

func tryRaftLogEntry(kv engine.MVCCKeyValue) (string, error) {
	var ent raftpb.Entry
	if err := maybeUnmarshalInline(kv.Value, &ent); err != nil {
		return "", err
	}
	if ent.Type == raftpb.EntryNormal {
		if len(ent.Data) > 0 {
			_, cmdData := storage.DecodeRaftCommand(ent.Data)
			var cmd roachpb.RaftCommand
			if err := cmd.Unmarshal(cmdData); err != nil {
				return "", err
			}
			ent.Data = nil
			return fmt.Sprintf("%s by %v\n%s\n%s\n", &ent, cmd.OriginReplica, &cmd.Cmd, &cmd), nil
		}
		return fmt.Sprintf("%s: EMPTY\n", &ent), nil
	} else if ent.Type == raftpb.EntryConfChange {
		var cc raftpb.ConfChange
		if err := cc.Unmarshal(ent.Data); err != nil {
			return "", err
		}
		var ctx storage.ConfChangeContext
		if err := ctx.Unmarshal(cc.Context); err != nil {
			return "", err
		}
		var cmd roachpb.RaftCommand
		if err := cmd.Unmarshal(ctx.Payload); err != nil {
			return "", err
		}
		ent.Data = nil
		return fmt.Sprintf("%s\n%s\n", &ent, &cmd), nil
	}
	return "", fmt.Errorf("Unknown log entry type: %s\n", &ent)
}

func printRaftLogEntry(kv engine.MVCCKeyValue) (bool, error) {
	if out, err := tryRaftLogEntry(kv); err != nil {
		fmt.Printf("%q: %v\n\n", kv.Key.Key, err)
	} else {
		fmt.Println(out)
	}
	return false, nil
}

func runDebugRaftLog(cmd *cobra.Command, args []string) error {
	stopper := stop.NewStopper()
	defer stopper.Stop()

	if len(args) != 2 {
		return errors.New("required arguments: dir range_id")
	}

	db, err := openStore(cmd, args[0], stopper)
	if err != nil {
		return err
	}

	rangeID, err := parseRangeID(args[1])
	if err != nil {
		return err
	}

	start := engine.MakeMVCCMetadataKey(keys.RaftLogPrefix(rangeID))
	end := engine.MakeMVCCMetadataKey(keys.RaftLogPrefix(rangeID).PrefixEnd())

	if err := db.Iterate(start, end, printRaftLogEntry); err != nil {
		return err
	}
	return nil
}

var debugGCCmd = &cobra.Command{
	Use:   "estimate-gc [directory] [range id]",
	Short: "find out what a GC run would do",
	Long: `
Sets up (but does not run) a GC collection cycle, giving insight into how much
work would be done (assuming all intent resolution and pushes succeed).

Without a RangeID specified on the command line, runs the analysis for all
ranges individually.

Uses a hard-coded GC policy with a 24 hour TTL for old versions.
`,
	RunE: runDebugGCCmd,
}

func runDebugGCCmd(cmd *cobra.Command, args []string) error {
	stopper := stop.NewStopper()
	defer stopper.Stop()

	if len(args) != 1 {
		return errors.New("required arguments: dir")
	}

	var rangeID roachpb.RangeID
	if len(args) == 2 {
		var err error
		if rangeID, err = parseRangeID(args[1]); err != nil {
			return err
		}
	}

	db, err := openStore(cmd, args[0], stopper)
	if err != nil {
		return err
	}

	start := keys.RangeDescriptorKey(roachpb.RKeyMin)
	end := keys.RangeDescriptorKey(roachpb.RKeyMax)

	var descs []roachpb.RangeDescriptor

	if _, err := engine.MVCCIterate(db, start, end, roachpb.MaxTimestamp,
		false /* !consistent */, nil, /* txn */
		false /* !reverse */, func(kv roachpb.KeyValue) (bool, error) {
			var desc roachpb.RangeDescriptor
			_, suffix, _, err := keys.DecodeRangeKey(kv.Key)
			if err != nil {
				return false, err
			}
			if !bytes.Equal(suffix, keys.LocalRangeDescriptorSuffix) {
				return false, nil
			}
			if err := kv.Value.GetProto(&desc); err != nil {
				return false, err
			}
			if desc.RangeID == rangeID || rangeID == 0 {
				descs = append(descs, desc)
			}
			return desc.RangeID == rangeID, nil
		}); err != nil {
		return err
	}

	if len(descs) == 0 {
		return fmt.Errorf("no range matching the criteria found")
	}

	for _, desc := range descs {
		snap := db.NewSnapshot()
		defer snap.Close()
		_, info, err := storage.RunGC(&desc, snap, roachpb.Timestamp{WallTime: timeutil.Now().UnixNano()},
			config.GCPolicy{TTLSeconds: 24 * 60 * 60 /* 1 day */}, func(_ roachpb.Timestamp, _ *roachpb.Transaction, _ roachpb.PushTxnType) {
			}, func(_ []roachpb.Intent, _, _ bool) error { return nil })
		if err != nil {
			return err
		}
		fmt.Printf("RangeID: %d [%s, %s):\n", desc.RangeID, desc.StartKey, desc.EndKey)
		_, _ = pretty.Println(info)
	}
	return nil
}

func init() {
	debugCmd.AddCommand(debugCmds...)
}

var debugCmds = []*cobra.Command{
	debugKeysCmd,
	debugRangeDescriptorsCmd,
	debugRaftLogCmd,
	debugGCCmd,
	kvCmd,
	rangeCmd,
}

var debugCmd = &cobra.Command{
	Use:   "debug [command]",
	Short: "debugging commands",
	Long: `Various commands for debugging.

These commands are useful for extracting data from the data files of a
process that has failed and cannot restart.
`,
	Run: func(cmd *cobra.Command, args []string) {
		mustUsage(cmd)
	},
}


text:
using JustLogic.Core;
using System.Collections.Generic;
using System;

[UnitMenu("String/Split")]
[UnitFriendlyName("String.Split")]
[UnitUsage(typeof(String[]), HideExpressionInActionsList = true)]
public class JLStringSplit4 : JLExpression
{
    [Parameter(ExpressionType = typeof(String))]
    public JLExpression OperandValue;

    [Parameter(ExpressionType = typeof(String))]
    public JLExpression[] Separator;

    [Parameter(ExpressionType = typeof(StringSplitOptions))]
    public JLExpression Options;

    public override object GetAnyResult(IExecutionContext context)
    {
        String opValue = OperandValue.GetResult<String>(context);
        return opValue.Split(Separator.GetResult<String>(context), Options.GetResult<StringSplitOptions>(context));
    }
}


text:
Logger
======

A base-interface to shorten psr's LoggerInterface to Logger

[![Latest Stable](http://img.shields.io/packagist/v/logger/logger.svg)](https://packagist.org/packages/logger/logger)


text:
<?php

namespace App\Entity;

use App\Repository\ContactRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity(repositoryClass=ContactRepository::class)
 */
class Contact
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=100)
     */
    private $firstname;

    /**
     * @ORM\Column(type="string", length=100)
     */
    private $lastname;

    /**
     * @ORM\Column(type="string", length=10)
     */
    private $phone;

    /**
     * @ORM\Column(type="string", length=50)
     */
    private $email;

    /**
     * @ORM\Column(type="text")
     */
    private $message;

    /**
     * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="contacts")
     * @ORM\JoinColumn(nullable=false)
     */
    private $category;

    /**
     * @Gedmo\Timestampable(on="create")
     * @ORM\Column(type="datetime")
     */
    private $created_at;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getFirstname(): ?string
    {
        return $this->firstname;
    }

    public function setFirstname(string $firstname): self
    {
        $this->firstname = $firstname;

        return $this;
    }

    public function getLastname(): ?string
    {
        return $this->lastname;
    }

    public function setLastname(string $lastname): self
    {
        $this->lastname = $lastname;

        return $this;
    }

    public function getPhone(): ?string
    {
        return $this->phone;
    }

    public function setPhone(string $phone): self
    {
        $this->phone = $phone;

        return $this;
    }

    public function getEmail(): ?string
    {
        return $this->email;
    }

    public function setEmail(string $email): self
    {
        $this->email = $email;

        return $this;
    }

    public function getMessage(): ?string
    {
        return $this->message;
    }

    public function setMessage(string $message): self
    {
        $this->message = $message;

        return $this;
    }

    public function getCategory(): ?Category
    {
        return $this->category;
    }

    public function setCategory(?Category $category): self
    {
        $this->category = $category;

        return $this;
    }

    public function getCreatedAt(): ?\DateTimeInterface
    {
        return $this->created_at;
    }

}


text:
package de.tor.tribes.ui.renderer;

import de.tor.tribes.io.UnitHolder;
import de.tor.tribes.ui.ImageManager;
import de.tor.tribes.util.Constants;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.SwingConstants;

/**
 *
 * @author Torridity
 */
public class UnitListCellRenderer extends JLabel implements ListCellRenderer {

    public UnitListCellRenderer() {
        super();
    }

    @Override
    public Component getListCellRendererComponent(JList list, Object pValue, int pIndex, boolean pSelected, boolean pHasFocus) {
        // Component c = super.getListCellRendererComponent(list, pValue, pIndex, pSelected, pHasFocus);

        setOpaque(true);
        if (pSelected) {
            setForeground(list.getSelectionForeground());
            super.setBackground(list.getSelectionBackground());
        } else {
            if (pIndex % 2 == 0) {
                setBackground(Constants.DS_ROW_B);
            } else {
                setBackground(Constants.DS_ROW_A);
            }
        }

        try {
            setHorizontalAlignment(SwingConstants.CENTER);
            if (pValue == null) {
                //no icon!?
                setText("-");
                setIcon(null);
            } else {
                setText("");
                setIcon(ImageManager.getUnitIcon((UnitHolder) pValue));
            }
        } catch (Exception e) {
            //cast problem
        }

        return this;

    }
}


text:
description: (no paper)
---

# Rolling Memory

Rolling memory is a type of experience replay. Each training step, a memory is replaced with the top scoring batch item.

Each `types` pairing becomes a discriminator that is added to the loss.

## examples

```javascript
{
    "class": "function:hypergan.train_hooks.experimental.rolling_memory_2_train_hook.RollingMemoryTrainHook",
    "types": ["mx-/g(mz-)"]
}
```

mx- is a memory of x that gets updated each training step. g\(mz-\) is a memory of z that gets run through a generator and updated each trainng step.

A discriminator `d(mx-, g(mz-))` is created and added to the gan loss.

## options

| attribute | description | type |
| :---: | :---: | :---: |
| types | What memories and how they are paired.  See **memory types** below | array of strings |
| top\_k | How many memory items to replace per frame.  Defaults to `1` | integer |
| only | Overrides all other losses when this is set. Defaults to `false` | boolean |

### memory types

| memory | description |
| :--- | :--- |
| mx- | x reverse sorted by d\_real |
| mx+ | x sorted by d\_real |
| mg- | memory of g reverse sorted by d\_fake |
| mg+ | memory of g sorted by d\_fake |
| g\(mz-\) | generator of memory of z reverse sorted by d\_fake |
| g\(mz+\) | generator of memory of z sorted by d\_fake |
| x | gan.inputs.x |
| g | gan.generator.sample |


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Package Ventanas</title>
<meta name="date" content="2017-05-10">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
Ventanas

Packages that use Ventanas

Package
Description

Modelo

Ventanas

Classes in Ventanas used by Modelo

Class and Description

TodosLosPartes

Classes in Ventanas used by Ventanas

Class and Description

AdministrativoHome

BuscarTrabajador

TrabajadorFormularioEdit

VentanaParte

VentanaParteAdminis

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
namespace TestCases.XSSF.Streaming
{
    using NPOI.SS.UserModel;
    using NPOI.XSSF;
    using NPOI.XSSF.Streaming;
    using NPOI.XSSF.UserModel;
    using NUnit.Framework;

    /**
     * Formula Evaluation with SXSSF.
     *
     * Note that SXSSF can only Evaluate formulas where the
     *  cell is in the current window, and all references
     *  from the cell are in the current window
     */
    [TestFixture]
    public class TestSXSSFFormulaEvaluation
    {
        public static SXSSFITestDataProvider _testDataProvider = SXSSFITestDataProvider.instance;

        /**
         * EvaluateAll will normally fail, as any reference or
         *  formula outside of the window will fail, and any
         *  non-active sheets will fail
         */
        [Test]

        public void TestEvaluateAllFails()
        {
            SXSSFWorkbook wb = new SXSSFWorkbook(5);
            SXSSFSheet s = wb.CreateSheet() as SXSSFSheet;

            IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();

            s.CreateRow(0).CreateCell(0).CellFormula = (/*setter*/"1+2");
            s.CreateRow(1).CreateCell(0).CellFormula = (/*setter*/"A21");
            for (int i = 2; i < 19; i++) { s.CreateRow(i); }

            // Cells outside window will fail, whether referenced or not
            s.CreateRow(19).CreateCell(0).CellFormula = (/*setter*/"A1+A2");
            s.CreateRow(20).CreateCell(0).CellFormula = (/*setter*/"A1+A11+100");
            try
            {
                eval.EvaluateAll();
                Assert.Fail("Evaluate All shouldn't work, as some cells outside the window");
            }
            catch (RowFlushedException)
            {
                // Expected
            }

            // Inactive sheets will fail
            XSSFWorkbook xwb = new XSSFWorkbook();
            xwb.CreateSheet("Open");
            xwb.CreateSheet("Closed");

            wb.Close();
            wb = new SXSSFWorkbook(xwb, 5);
            s = wb.GetSheet("Closed") as SXSSFSheet;
            s.FlushRows();
            s = wb.GetSheet("Open") as SXSSFSheet;
            s.CreateRow(0).CreateCell(0).CellFormula = (/*setter*/"1+2");

            eval = wb.GetCreationHelper().CreateFormulaEvaluator();
            try
            {
                eval.EvaluateAll();
                Assert.Fail("Evaluate All shouldn't work, as sheets flushed");
            }
            catch (SheetsFlushedException) { }

            wb.Close();
        }

        [Test]
        public void TestEvaluateRefOutsideWindowFails()
        {
            SXSSFWorkbook wb = new SXSSFWorkbook(5);
            SXSSFSheet s = wb.CreateSheet() as SXSSFSheet;

            s.CreateRow(0).CreateCell(0).CellFormula = (/*setter*/"1+2");
            Assert.AreEqual(false, s.AllRowsFlushed);
            Assert.AreEqual(-1, s.LastFlushedRowNumber);

            for (int i = 1; i <= 19; i++) { s.CreateRow(i); }
            ICell c = s.CreateRow(20).CreateCell(0);
            c.CellFormula = (/*setter*/"A1+100");

            Assert.AreEqual(false, s.AllRowsFlushed);
            Assert.AreEqual(15, s.LastFlushedRowNumber);

            IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();
            try
            {
                eval.EvaluateFormulaCell(c);
                Assert.Fail("Evaluate shouldn't work, as reference outside the window");
            }
            catch (RowFlushedException)
            {
                // Expected
            }

            wb.Close();
        }

        /**
         * If all formula cells + their references are inside the window,
         *  then Evaluation works
         */
        [Test]
        public void TestEvaluateAllInWindow()
        {
            SXSSFWorkbook wb = new SXSSFWorkbook(5);
            SXSSFSheet s = wb.CreateSheet() as SXSSFSheet;
            s.CreateRow(0).CreateCell(0).CellFormula = (/*setter*/"1+2");
            s.CreateRow(1).CreateCell(1).CellFormula = (/*setter*/"A1+10");
            s.CreateRow(2).CreateCell(2).CellFormula = (/*setter*/"B2+100");

            IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();
            eval.EvaluateAll();

            Assert.AreEqual(3, (int)s.GetRow(0).GetCell(0).NumericCellValue);
            Assert.AreEqual(13, (int)s.GetRow(1).GetCell(1).NumericCellValue);
            Assert.AreEqual(113, (int)s.GetRow(2).GetCell(2).NumericCellValue);

            wb.Close();
        }

        [Test]
        public void TestEvaluateRefInsideWindow()
        {
            SXSSFWorkbook wb = new SXSSFWorkbook(5);
            SXSSFSheet s = wb.CreateSheet() as SXSSFSheet;

            IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();

            SXSSFCell c = s.CreateRow(0).CreateCell(0) as SXSSFCell;
            c.SetCellValue(1.5);

            c = s.CreateRow(1).CreateCell(0) as SXSSFCell;
            c.CellFormula = (/*setter*/"A1*2");

            Assert.AreEqual(0, (int)c.NumericCellValue);
            eval.EvaluateFormulaCell(c);
            Assert.AreEqual(3, (int)c.NumericCellValue);

            wb.Close();
        }

        [Test]
        public void TestEvaluateSimple()
        {
            SXSSFWorkbook wb = new SXSSFWorkbook(5);
            SXSSFSheet s = wb.CreateSheet() as SXSSFSheet;

            IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();

            SXSSFCell c = s.CreateRow(0).CreateCell(0) as SXSSFCell;
            c.CellFormula = (/*setter*/"1+2");
            Assert.AreEqual(0, (int)c.NumericCellValue);
            eval.EvaluateFormulaCell(c);
            Assert.AreEqual(3, (int)c.NumericCellValue);

            c = s.CreateRow(1).CreateCell(0) as SXSSFCell;
            c.CellFormula = (/*setter*/"CONCATENATE(\"hello\",\" \",\"world\")");
            eval.EvaluateFormulaCell(c);
            Assert.AreEqual("hello world", c.StringCellValue);

        }
    }

}


text:
var Cenemy = function(pos)
{
    this.name = "MAD-" + (Math.random() * 652 + 79).toFixed();
    this.texts = ["* Spherical drones descend from the\nceiling!"];
    this.speech = ["Null", "Beep.", "Boop."];
    this.acts = ["Check", "Turn Off", "Stare"];
    this.ress = [
        "* " + this.name + "   2 ATK 12 DEF * Monitor & Defense drone. Someone\nmight get mad if you broke it.",
        "* You reach for the drone's off\nswitch.",
        "* You stare at the drone. It recorded\nthat you stared at it."];
    this.ressFunctions = [
        function()
        {
            console.log("actFunction 1");
        },
        function()
        {
            console.log("actFunction 2");
        },
        function()
        {
            console.log("actFunction 3");
        }];
    this.atk = 5;
    this.def = 5;
    this.maxHP = 200;
    this.curHP = 200;
    this.defense = 10;
    this.damageVel = 120;
    this.damagePos = pos;
    this.bubblePos = pos.getAdd(new Vect(80, -80, 0));
    this.bubbleOff = 30;
    this.active = false;
    this.modelPoses = [];
    this.animations = [];
}

//Add an animtion
Cenemy.prototype.addAnimation = function(text, pos)
{
    this.active = true;
    this.modelPoses.push(pos);
    var anim = JSON.parse(text);
    if(anim.image_id == "drone_2")
    {
        this.animations.push(new AnimationNum(anim, this.name));
    }
    else
    {
        this.animations.push(new Animation(anim));
    }
    this.sortAnimations();
}

//Sort animations
Cenemy.prototype.sortAnimations = function()
{
    for(var i = this.animations.length - 1; i > 0; i--)
    {
        if(this.animations[i].zindex > this.animations[i - 1].zindex)
        {
            var temp = this.animations[i];
            this.animations[i] = this.animations[i - 1];
            this.animations[i - 1] = temp;
        }
    }
}

//Update
Cenemy.prototype.update = function(dt)
{
    if(this.active)
    {
        for(var i = 0; i < this.animations.length; i++)
        {
            this.animations[i].update(dt);
        }
    }
}

//Draw
Cenemy.prototype.draw = function(ctx)
{
    if(this.active)
    {
        for(var i = 0; i < this.animations.length; i++)
        {
            ctx.save();
            ctx.translate(this.modelPoses[i].x, this.modelPoses[i].y);
            this.animations[i].draw(ctx);
            ctx.restore();
        }
    }
}


text:
package com.opengamma.util.fudgemsg.tuple;

import org.fudgemsg.FudgeField;
import org.fudgemsg.FudgeMsg;
import org.fudgemsg.MutableFudgeMsg;
import org.fudgemsg.mapping.FudgeBuilder;
import org.fudgemsg.mapping.FudgeBuilderFor;
import org.fudgemsg.mapping.FudgeDeserializer;
import org.fudgemsg.mapping.FudgeSerializer;
import org.fudgemsg.mapping.GenericFudgeBuilderFor;
import org.fudgemsg.wire.types.FudgeWireType;

import com.opengamma.util.tuple.DoublesPair;
import com.opengamma.util.tuple.IntDoublePair;
import com.opengamma.util.tuple.IntObjectPair;
import com.opengamma.util.tuple.LongDoublePair;
import com.opengamma.util.tuple.LongObjectPair;
import com.opengamma.util.tuple.ObjectsPair;
import com.opengamma.util.tuple.Pair;

/**
 * Fudge builder for {@code DoublesPair}.
 */
@GenericFudgeBuilderFor(Pair.class)
//Without this the JavaBeanBuilder is used, which is slow
@FudgeBuilderFor(DoublesPair.class)
public final class PairFudgeBuilder implements FudgeBuilder<Pair<?, ?>> {

  /** Field name. */
  public static final String FIRST_FIELD_NAME = "first";
  /** Field name. */
  public static final String SECOND_FIELD_NAME = "second";

  @Override
  public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final Pair<?, ?> object) {
    final MutableFudgeMsg msg = serializer.newMessage();
    if (object instanceof LongObjectPair || object instanceof LongDoublePair) {
      msg.add("firstLong", object.getFirst());
    } else if (object instanceof IntObjectPair || object instanceof IntDoublePair) {
      msg.add("firstInt", object.getFirst());
    } else if (object instanceof DoublesPair) {
      msg.add("firstDouble", object.getFirst());
    } else {
      if (object.getFirst() != null) {
        if (object.getFirst() instanceof String) {
          msg.add(FIRST_FIELD_NAME, null, FudgeWireType.STRING, object.getFirst());
        } else {
          serializer.addToMessageObject(msg, FIRST_FIELD_NAME, null, object.getFirst(), Object.class);
        }
      }
    }
    if (object instanceof LongDoublePair || object instanceof IntDoublePair || object instanceof DoublesPair) {
      msg.add("secondDouble", object.getSecond());
    } else {
      if (object.getSecond() != null) {
        if (object.getSecond() instanceof String) {
          msg.add(SECOND_FIELD_NAME, null, FudgeWireType.STRING, object.getSecond());
        } else {
          serializer.addToMessageObject(msg, SECOND_FIELD_NAME, null, object.getSecond(), Object.class);
        }
      }
    }
    return msg;
  }

  @Override
  public Pair<?, ?> buildObject(final FudgeDeserializer deserializer, final FudgeMsg msg) {
    final Long firstLong = msg.getLong("firstLong");
    if (firstLong != null) {
      final Double secondDouble = msg.getDouble("secondDouble");
      if (secondDouble != null) {
        return LongDoublePair.of(firstLong.longValue(), secondDouble.doubleValue());
      }
      final FudgeField secondField = msg.getByName(SECOND_FIELD_NAME);
      final Object second = secondField != null ? deserializer.fieldValueToObject(secondField) : null;
      return LongObjectPair.of(firstLong.longValue(), second);
    }
    final Long firstInt = msg.getLong("firstInt");
    if (firstInt != null) {
      final Double secondDouble = msg.getDouble("secondDouble");
      if (secondDouble != null) {
        return IntDoublePair.of(firstInt.intValue(), secondDouble.doubleValue());
      }
      final FudgeField secondField = msg.getByName(SECOND_FIELD_NAME);
      final Object second = secondField != null ? deserializer.fieldValueToObject(secondField) : null;
      return IntObjectPair.of(firstInt.intValue(), second);
    }
    final Double firstDouble = msg.getDouble("firstDouble");
    final Double secondDouble = msg.getDouble("secondDouble");
    if (firstDouble != null && secondDouble != null) {
      return DoublesPair.of(firstDouble.doubleValue(), secondDouble.doubleValue());
    }
    final FudgeField firstField = msg.getByName(FIRST_FIELD_NAME);
    final Object first = firstField != null ? deserializer.fieldValueToObject(firstField) : null;
    final FudgeField secondField = msg.getByName(SECOND_FIELD_NAME);
    final Object second = secondField != null ? deserializer.fieldValueToObject(secondField) : null;
    return ObjectsPair.of(first, second);
  }

}


text:
module Dry
  module Monads
    # Represents a value which can be either success or a failure (an exception).
    # Use it to wrap code that can raise exceptions.
    #
    # @api public
    class Try
      # @private
      DEFAULT_EXCEPTIONS = [StandardError].freeze

      include ConversionStubs[:to_maybe, :to_result]

      # @return [Exception] Caught exception
      attr_reader :exception

      class << self
        extend Core::Deprecations[:"dry-monads"]

        # Invokes a callable and if successful stores the result in the
        # {Try::Value} type, but if one of the specified exceptions was raised it stores
        # it in a {Try::Error}.
        #
        # @param exceptions [Array<Exception>] list of exceptions to rescue
        # @param f [#call] callable object
        # @return [Try::Value, Try::Error]
        def run(exceptions, f)
          Value.new(exceptions, f.call)
        rescue *exceptions => e
          Error.new(e)
        end
        deprecate :lift, :run

        # Wraps a value with Value
        #
        # @overload pure(value, exceptions = DEFAULT_EXCEPTIONS)
        #   @param value [Object] value for wrapping
        #   @param exceptions [Array<Exceptions>] list of exceptions to rescue
        #   @return [Try::Value]
        #
        # @overload pure(exceptions = DEFAULT_EXCEPTIONS, &block)
        #   @param exceptions [Array<Exceptions>] list of exceptions to rescue
        #   @param block [Proc] value for wrapping
        #   @return [Try::Value]
        #
        def pure(value = Undefined, exceptions = DEFAULT_EXCEPTIONS, &block)
          if value.equal?(Undefined)
            Value.new(DEFAULT_EXCEPTIONS, block)
          elsif block.nil?
            Value.new(exceptions, value)
          else
            Value.new(value, block)
          end
        end

        # Safely runs a block
        #
        # @example using Try with [] and a block (Ruby 2.5+)
        #   include Dry::Monads::Try::Mixin
        #
        #   def safe_db_call
        #     Try[DatabaseError] { db_call }
        #   end
        #
        # @param exceptions [Array<Exception>]
        # @return [Try::Value,Try::Error]
        def [](*exceptions, &block)
          raise ArgumentError, "At least one exception type required" if exceptions.empty?

          run(exceptions, block)
        end
      end

      # Returns true for an instance of a {Try::Value} monad.
      def value?
        is_a?(Value)
      end
      alias_method :success?, :value?

      # Returns true for an instance of a {Try::Error} monad.
      def error?
        is_a?(Error)
      end
      alias_method :failure?, :error?

      # Returns self.
      #
      # @return [Try::Value, Try::Error]
      def to_monad
        self
      end

      # Represents a result of a successful execution.
      #
      # @api public
      class Value < Try
        include Dry::Equalizer(:value!, :catchable)
        include RightBiased::Right

        # @return [Array<Exception>] List of exceptions to rescue
        attr_reader :catchable

        # @param exceptions [Array<Exception>] list of exceptions to be rescued
        # @param value [Object] the value to be stored in the monad
        def initialize(exceptions, value)
          super()

          @catchable = exceptions
          @value = value
        end

        alias_method :bind_call, :bind
        private :bind_call

        # Calls the passed in Proc object with value stored in self
        # and returns the result.
        #
        # If proc is nil, it expects a block to be given and will yield to it.
        #
        # @example
        #   success = Dry::Monads::Try::Value.new(ZeroDivisionError, 10)
        #   success.bind(->(n) { n / 2 }) # => 5
        #   success.bind { |n| n / 0 } # => Try::Error(ZeroDivisionError: divided by 0)
        #
        # @param args [Array<Object>] arguments that will be passed to a block
        #                             if one was given, otherwise the first
        #                             value assumed to be a Proc (callable)
        #                             object and the rest of args will be passed
        #                             to this object along with the internal value
        # @return [Object, Try::Error]
        def bind(...)
          super
        rescue *catchable => e
          Error.new(e)
        end

        # Does the same thing as #bind except it also wraps the value
        # in an instance of a Try monad. This allows for easier
        # chaining of calls.
        #
        # @example
        #   success = Dry::Monads::Try::Value.new(ZeroDivisionError, 10)
        #   success.fmap(&:succ).fmap(&:succ).value # => 12
        #   success.fmap(&:succ).fmap { |n| n / 0 }.fmap(&:succ).value # => nil
        #
        # @param args [Array<Object>] extra arguments for the block, arguments are being processes
        #                             just as in #bind
        # @return [Try::Value, Try::Error]
        def fmap(...)
          Value.new(catchable, bind_call(...))
        rescue *catchable => e
          Error.new(e)
        end

        # @return [String]
        def to_s
          if Unit.equal?(@value)
            "Try::Value()"
          else
            "Try::Value(#{@value.inspect})"
          end
        end
        alias_method :inspect, :to_s

        # Ignores values and returns self, see {Try::Error#recover}
        #
        # @param errors [Class] List of Exception subclasses
        #
        # @return [Try::Value]
        def recover(*_errors)
          self
        end
      end

      # Represents a result of a failed execution.
      #
      # @api public
      class Error < Try
        include Dry::Equalizer(:exception)
        include RightBiased::Left

        singleton_class.alias_method(:call, :new)

        # @param exception [Exception]
        def initialize(exception)
          super()

          @exception = exception
        end

        # @return [String]
        def to_s
          "Try::Error(#{exception.class}: #{exception.message})"
        end
        alias_method :inspect, :to_s

        # If a block is given passes internal value to it and returns the result,
        # otherwise simply returns the first argument.
        #
        # @example
        #   Try(ZeroDivisionError) { 1 / 0 }.or { "zero!" } # => "zero!"
        #
        # @param args [Array<Object>] arguments that will be passed to a block
        #                             if one was given, otherwise the first
        #                             value will be returned
        # @return [Object]
        def or(*args)
          if block_given?
            yield(exception, *args)
          else
            args[0]
          end
        end

        # @param other [Try]
        # @return [Boolean]
        def ===(other)
          Error === other && exception === other.exception
        end

        # Acts in a similar way to `rescue`. It checks if
        # {exception} is one of {errors} and yields the block if so.
        #
        # @param errors [Class] List of Exception subclasses
        #
        # @return [Try::Value]
        def recover(*errors)
          if errors.empty?
            classes = DEFAULT_EXCEPTIONS
          else
            classes = errors
          end

          if classes.any? { _1 === exception }
            Value.new([exception.class], yield(exception))
          else
            self
          end
        end
      end

      # A module that can be included for easier access to Try monads.
      #
      # @example
      #   class Foo
      #     include Dry::Monads::Try::Mixin
      #
      #     attr_reader :average
      #
      #     def initialize(total, count)
      #       @average = Try(ZeroDivisionError) { total / count }.value
      #     end
      #   end
      #
      #   Foo.new(10, 2).average # => 5
      #   Foo.new(10, 0).average # => nil
      module Mixin
        # @see Dry::Monads::Try
        Try = Try

        # @private
        module Constructors
          # A convenience wrapper for {Monads::Try.run}.
          # If no exceptions are provided it falls back to StandardError.
          # In general, relying on this behaviour is not recommended as it can lead to unnoticed
          # bugs and it is always better to explicitly specify a list of exceptions if possible.
          #
          # @param exceptions [Array<Exception>]
          # @return [Try]
          def Try(*exceptions, &f)
            catchable = exceptions.empty? ? DEFAULT_EXCEPTIONS : exceptions.flatten
            Try.run(catchable, f)
          end
        end

        include Constructors

        # Value constructor
        #
        # @overload Value(value)
        #   @param value [Object]
        #   @return [Try::Value]
        #
        # @overload Value(&block)
        #   @param block [Proc] a block to be wrapped with Value
        #   @return [Try::Value]
        #
        def Value(value = Undefined, exceptions = DEFAULT_EXCEPTIONS, &block)
          v = Undefined.default(value, block)
          raise ArgumentError, "No value given" if !value.nil? && v.nil?

          Try::Value.new(exceptions, v)
        end

        # Error constructor
        #
        # @overload Error(value)
        #   @param error [Exception]
        #   @return [Try::Error]
        #
        # @overload Error(&block)
        #   @param block [Proc] a block to be wrapped with Error
        #   @return [Try::Error]
        #
        def Error(error = Undefined, &block)
          v = Undefined.default(error, block)
          raise ArgumentError, "No value given" if v.nil?

          Try::Error.new(v)
        end
      end
    end

    require "dry/monads/registry"
    register_mixin(:try, Try::Mixin)
  end
end


text:
package org.assertj.core.api;

import static java.lang.String.format;
import static org.assertj.core.util.Preconditions.checkNotNull;

import java.util.Comparator;

import org.assertj.core.internal.Comparables;
import org.assertj.core.internal.ComparatorBasedComparisonStrategy;
import org.assertj.core.util.CheckReturnValue;
import org.assertj.core.util.VisibleForTesting;

public class AbstractStringAssert<SELF extends AbstractStringAssert<SELF>> extends AbstractCharSequenceAssert<SELF, String> {

  public AbstractStringAssert(String actual, Class<?> selfType) {
    super(actual, selfType);
  }

  @VisibleForTesting
  Comparables comparables = new Comparables();

  /**
   * Verifies that the actual value is less than the given {@link String} according to {@link String#compareTo(String)}.
   *

   * Note that it is possible to change the comparison strategy with {@link AbstractAssert#usingComparator(Comparator) usingComparator}.
   *

   * Examples:
   *
 // assertions succeed
   * assertThat("abc").isLessThan("bcd")
   *                  .isLessThan("b")
   *                  .isLessThan("abca")
   *                  .usingComparator(CASE_INSENSITIVE)
   *                  .isLessThan("BCD");
   *
   * // assertions fail
   * assertThat("abc").isLessThan("ab");
   * assertThat("abc").isLessThan("abc");
   * assertThat("abc").isLessThan("ABC");

   *
   * @param other the {@link String} to compare the actual value to.
   * @return {@code this} assertion object.
   * @throws AssertionError if the actual value is {@code null}.
   * @throws AssertionError if the actual value is greater than or equal to the given one.
   *
   * @since 3.11.0
   */
  public SELF isLessThan(String other) {
    comparables.assertLessThan(info, actual, other);
    return myself;
  }

  /**
   * Verifies that the actual value is less than or equal to the given {@link String} according to {@link String#compareTo(String)}.
   *

   * Note that it is possible to change the comparison strategy with {@link AbstractAssert#usingComparator(Comparator) usingComparator}.
   *

   * Examples:
   *
 // assertions succeed
   * assertThat("abc").isLessThanOrEqualTo("bcd")
   *                  .isLessThanOrEqualTo("abc")
   *                  .isLessThanOrEqualTo("b")
   *                  .isLessThanOrEqualTo("abca")
   *                  .usingComparator(CASE_INSENSITIVE)
   *                  .isLessThanOrEqualTo("ABC");
   *
   * // assertions fail
   * assertThat("abc").isLessThanOrEqualTo("ab");
   * assertThat("abc").isLessThanOrEqualTo("ABC");

   *
   * @param other the {@link String} to compare the actual value to.
   * @return {@code this} assertion object.
   * @throws AssertionError if the actual value is {@code null}.
   * @throws AssertionError if the actual value is greater than the given one.
   *
   * @since 3.11.0
   */
  public SELF isLessThanOrEqualTo(String other) {
    comparables.assertLessThanOrEqualTo(info, actual, other);
    return myself;
  }

  /**
   * Verifies that the actual value is greater than the given {@link String} according to {@link String#compareTo(String)}.
   *

   * Note that it is possible to change the comparison strategy with {@link AbstractAssert#usingComparator(Comparator) usingComparator}.
   *

   * Examples:
   *
 // assertions succeed
   * assertThat("xyz").isGreaterThan("abc")
   *                  .isGreaterThan("xy")
   *                  .isGreaterThan("ABC");
   * assertThat("XYZ").usingComparator(CASE_INSENSITIVE)
   *                  .isGreaterThan("abc");
   *
   * // assertions fail
   * assertThat("xyz").isGreaterThan("xyzz");
   * assertThat("xyz").isGreaterThan("xyz");
   * assertThat("xyz").isGreaterThan("z");

   *
   * @param other the {@link String} to compare the actual value to.
   * @return {@code this} assertion object.
   * @throws AssertionError if the actual value is {@code null}.
   * @throws AssertionError if the actual value is less than or equal to the given one.
   *
   * @since 3.11.0
   */
  public SELF isGreaterThan(String other) {
    comparables.assertGreaterThan(info, actual, other);
    return myself;
  }

  /**
   * Verifies that the actual value is greater than or equal to the given {@link String} according to {@link String#compareTo(String)}.
   *

   * Note that it is possible to change the comparison strategy with {@link AbstractAssert#usingComparator(Comparator) usingComparator}.
   *

   * Examples:
   *
 // assertions succeed
   * assertThat("xyz").isGreaterThanOrEqualTo("abc")
   *                  .isGreaterThanOrEqualTo("xyz")
   *                  .isGreaterThanOrEqualTo("xy")
   *                  .isGreaterThanOrEqualTo("ABC");
   * assertThat("XYZ").usingComparator(CASE_INSENSITIVE)
   *                  .isGreaterThanOrEqualTo("abc");
   *
   * // assertions fail
   * assertThat("xyz").isGreaterThanOrEqualTo("xyzz");
   * assertThat("xyz").isGreaterThanOrEqualTo("z");

   *
   * @param other the {@link String} to compare the actual value to.
   * @return {@code this} assertion object.
   * @throws AssertionError if the actual value is {@code null}.
   * @throws AssertionError if the actual value is less than the given one.
   *
   * @since 3.11.0
   */
  public SELF isGreaterThanOrEqualTo(String other) {
    comparables.assertGreaterThanOrEqualTo(info, actual, other);
    return myself;
  }

  /**
   * Verifies that the actual value is in [start, end] range (start included, end included) according to {@link String#compareTo(String)}.
   *

   * Note that it is possible to change the comparison strategy with {@link AbstractAssert#usingComparator(Comparator) usingComparator}.
   *

   * Examples:
   *
 // assertions succeed
   * assertThat("ab").isBetween("aa", "ac")
   *                 .isBetween("ab", "ac")
   *                 .isBetween("aa", "ab")
   *                 .isBetween("ab", "ab")
   *                 .isBetween("a", "c")
   *                 .usingComparator(CASE_INSENSITIVE)
   *                 .isBetween("AA", "AC");
   *
   * // assertions fail
   * assertThat("ab").isBetween("ac", "bc");
   * assertThat("ab").isBetween("abc", "ac");

   *
   * @param startInclusive the start value (inclusive), expected not to be null.
   * @param endInclusive the end value (inclusive), expected not to be null.
   * @return this assertion object.
   * @throws AssertionError if the actual value is {@code null}.
   * @throws NullPointerException if start value is {@code null}.
   * @throws NullPointerException if end value is {@code null}.
   * @throws AssertionError if the actual value is not in the [start, end] range.
   *
   * @since 3.11.0
   */
  public SELF isBetween(String startInclusive, String endInclusive) {
    comparables.assertIsBetween(info, actual, startInclusive, endInclusive, true, true);
    return myself;
  }

  /**
   * Verifies that the actual value is strictly in ]start, end[ range (start excluded, end excluded) according to {@link String#compareTo(String)}.
   *

   * Note that it is possible to change the comparison strategy with {@link AbstractAssert#usingComparator(Comparator) usingComparator}.
   *

   * Examples:
   *
 // assertions succeed
   * assertThat("ab").isStrictlyBetween("aa", "ac")
   *                 .isStrictlyBetween("a", "c")
   *                 .usingComparator(CASE_INSENSITIVE)
   *                 .isStrictlyBetween("AA", "AC");
   *
   * // assertions fail
   * assertThat("ab").isStrictlyBetween("ac", "bc");
   * assertThat("ab").isStrictlyBetween("ab", "ac");
   * assertThat("ab").isStrictlyBetween("aa", "ab");
   * assertThat("ab").isStrictlyBetween("abc", "ac");

   *
   * @param startExclusive the start value (exclusive), expected not to be null.
   * @param endExclusive the end value (exclusive), expected not to be null.
   * @return this assertion object.
   * @throws AssertionError if the actual value is {@code null}.
   * @throws NullPointerException if start value is {@code null}.
   * @throws NullPointerException if end value is {@code null}.
   * @throws AssertionError if the actual value is not in ]start, end[ range.
   *
   * @since 3.11.0
   */
  public SELF isStrictlyBetween(String startExclusive, String endExclusive) {
    comparables.assertIsBetween(info, actual, startExclusive, endExclusive, false, false);
    return myself;
  }

  /**
   * Use the given custom comparator instead of relying on {@link String} natural comparator for the incoming assertions.
   *

   * The custom comparator is bound to an assertion instance, meaning that if a new assertion instance is created
   * it is forgotten and the default ({@link String} natural comparator) is used.
   *

   * Examples :
   *
 // assertions succeed
   * assertThat("abc").usingComparator(CASE_INSENSITIVE)
   *                  .isEqualTo("Abc")
   *                  .isEqualTo("ABC");
   *
   * // assertion fails as it relies on String natural comparator
   * assertThat("abc").isEqualTo("ABC");

   *
   * @param customComparator the comparator to use for the incoming assertions.
   * @throws NullPointerException if the given comparator is {@code null}.
   * @return {@code this} assertion object.
   */
  @Override
  @CheckReturnValue
  public SELF usingComparator(Comparator<? super String> customComparator) {
    return usingComparator(customComparator, null);
  }

  /**
   * Use the given custom comparator instead of relying on {@link String} natural comparator for the incoming assertions.
   *

   * The custom comparator is bound to an assertion instance, meaning that if a new assertion instance is created
   * it is forgotten and the default ({@link String} natural comparator) is used.
   *

   * Examples :
   *
 // assertions succeed
   * assertThat("abc").usingComparator(CASE_INSENSITIVE, "String case insensitive comparator")
   *                  .isEqualTo("Abc")
   *                  .isEqualTo("ABC");
   *
   * // assertion fails as it relies on String natural comparator
   * assertThat("abc").isEqualTo("ABC");

   *
   * @param customComparator the comparator to use for the incoming assertions.
   * @param customComparatorDescription comparator description to be used in assertion error messages
   * @throws NullPointerException if the given comparator is {@code null}.
   * @return {@code this} assertion object.
   */
  @Override
  @CheckReturnValue
  public SELF usingComparator(Comparator<? super String> customComparator, String customComparatorDescription) {
    this.comparables = new Comparables(new ComparatorBasedComparisonStrategy(customComparator, customComparatorDescription));
    return super.usingComparator(customComparator, customComparatorDescription);
  }

  @Override
  @CheckReturnValue
  public SELF usingDefaultComparator() {
    this.comparables = new Comparables();
    return super.usingDefaultComparator();
  }

  /**
   * Verifies that the actual value is equal to expected build using {@link String#format(String stringTemplate, Object... args)}.
   *

   * Note that for this assertion to be called, you must use a format template with parameters otherwise {@link #isEqualTo(Object)} is called which
   * does not perform any formatting. For example, it you only use {@code %n} in the template they won't be replaced.
   *

   * Examples:
   *
 // assertion succeeds
   * assertThat("R2D2").isEqualTo("%d%s%d%s", "R", 2, "D", 2);
   *
   * // assertion fails
   * assertThat("C6PO").isEqualTo("%d%s%d%s", "R", 2, "D", 2);
   *
   * // assertion fails with {@link java.lang.NullPointerException}
   * assertThat("1,A,2").isEqualTo(null, 1, "A", 2);
   *
   * // assertion fails with {@link java.util.IllegalFormatException}
   * assertThat("1").isEqualTo("%s%s", 1);

   *
   * @param expectedStringTemplate the format template used to build the expected String.
   * @param args the arguments referenced by the format specifiers in the format string.
   * @throws NullPointerException if stringTemplate parameter is {@code null}.
   * @throws AssertionError if the actual value is {@code null} as the template you provide must not be {@code null}.
   * @throws java.util.IllegalFormatException as in {@link String#format(String, Object...)}, see
   *         Details section of the
   *         formatter class specification.
   * @return this assertion object.
   *
   * @since 3.12.0
   */
  public SELF isEqualTo(String expectedStringTemplate, Object... args) {
    checkNotNull(expectedStringTemplate, "The expectedStringTemplate must not be null");
    return super.isEqualTo(format(expectedStringTemplate, args));
  }

  /**
   * Verifies that the actual value is equal to expected.
   *

   * This method needs to be overridden because otherwise {@link #isEqualTo(String, Object...)} is called from tests in Kotlin without args which breaks whenever the is {@code %} in the string.
   *
   * @param expected the given {@link String} to compare the actual to.
   * @return this assertion object.
   * @see Assert#isEqualTo(java.lang.Object)
   * @since 3.13.0
   */
  public SELF isEqualTo(String expected) {
    return super.isEqualTo(expected);
  }
}


text:
// +build go1.6,!go1.7

package transport

import (
	"net"

	"golang.org/x/net/context"
)

// dialContext connects to the address on the named network.
func dialContext(ctx context.Context, network, address string) (net.Conn, error) {
	return (&net.Dialer{Cancel: ctx.Done()}).Dial(network, address)
}


text:
<?php

use yii\helpers\Html;
use app\models\general\GeneralLabel;

/* @var $this yii\web\View */
/* @var $model app\models\RefKategoriPencalonanAtlet */

$this->title = GeneralLabel::createTitle.' '.GeneralLabel::kategori_pencalonan_atlet;
$this->params['breadcrumbs'][] = ['label' => GeneralLabel::kategori_pencalonan_atlet, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>


text:
<?php

use Advent2016\Day6\Message;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;

require_once __DIR__ . '/../vendor/autoload.php';

$adapter = new Local(__DIR__ . '\..\src\Day6');
$filesystem = new Filesystem($adapter);

$message = new Message($filesystem);
echo $message->decode('input.txt') . PHP_EOL;
echo $message->decode('input.txt', 'ASC');


text:
/**
 * @file
 *   This file implements the nrf 802.15.4 radio arbiter for single phy.
 *
 * This arbiter should be used when 802.15.4 is the only wireless protocol used by the application.
 *
 */

#include "nrf_raal_api.h"

#include <assert.h>
#include <stdbool.h>
#include <stdint.h>

static bool m_continuous;

void nrf_raal_init(void)
{
    m_continuous = false;
}

void nrf_raal_uninit(void)
{
    // Intentionally empty.
}

void nrf_raal_continuous_mode_enter(void)
{
    assert(!m_continuous);

    m_continuous = true;
    nrf_raal_timeslot_started();
}

void nrf_raal_continuous_mode_exit(void)
{
    assert(m_continuous);

    m_continuous = false;
}

void nrf_raal_continuous_ended(void)
{
    // Intentionally empty.
}

bool nrf_raal_timeslot_request(uint32_t length_us)
{
    (void)length_us;

    assert(m_continuous);

    return true;
}

uint32_t nrf_raal_timeslot_us_left_get(void)
{
    return UINT32_MAX;
}


text:
module Rea
  class WorkKey

    attr_reader :provider
    attr_reader :identifier

    def initialize(provider, identifier)
      @provider, @identifier = provider, identifier
    end

    def self.parse(str)
      return str if str.is_a?(WorkKey)
      unless str.strip =~ /^([a-z]+):\/\/(.+)$/
        raise ArgumentError, "Invalid work key #{str}"
      end
      WorkKey.new($1, $2)
    end

    def ==(other)
      other.is_a?(WorkKey) and other.to_s == to_s
    end
    alias :eql? :==

    def to_s
      "#{provider}://#{identifier}"
    end

    def to_ruby_literal
      "Rea::WorkKey(#{to_s.inspect})"
    end

  end # class WorkKey
end # module Rea


text:
#pragma once
#ifndef ACCRE_LIO_MONITOR_H_INCLUDED
#define ACCRE_LIO_MONITOR_H_INCLUDED

#include <tbx/visibility.h>
#include <tbx/monitor.h>

//** Just define all the type indices for monitoring for the various toolbox, gop, IBP, IBP server, and LIO tools

#define MON_INDEX_NSSEND  1
#define MON_INDEX_NSRECV  2
#define MON_INDEX_GOP     3
#define MON_INDEX_QUE     4
#define MON_INDEX_HPSEND  5
#define MON_INDEX_HPRECV  6

#define MON_INDEX_IBP    10

#define MON_INDEX_LIO    20
#define MON_INDEX_AUTHN  21
#define MON_INDEX_DS     22
#define MON_INDEX_RS     23
#define MON_INDEX_OS     24
#define MON_INDEX_OSAZ   25
#define MON_INDEX_SEG    26
#define MON_INDEX_FS     27

#ifdef __cplusplus
}
#endif

#endif


text:
#ifndef INTPROTO_H
#define INTPROTO_H

/**----------------------------------------------------------------------------
          Include Files and Type Defines
----------------------------------------------------------------------------**/
#include BOSS_TESSERACT_U_genericvector_h //original-code:"genericvector.h"
#include BOSS_TESSERACT_U_matchdefs_h //original-code:"matchdefs.h"
#include BOSS_TESSERACT_U_mfoutline_h //original-code:"mfoutline.h"
#include BOSS_TESSERACT_U_protos_h //original-code:"protos.h"
#include BOSS_TESSERACT_U_scrollview_h //original-code:"scrollview.h"
#include BOSS_TESSERACT_U_unicharset_h //original-code:"unicharset.h"

class FCOORD;

/* define order of params in pruners */
#define PRUNER_X      0
#define PRUNER_Y      1
#define PRUNER_ANGLE    2

/* definition of coordinate system offsets for each table parameter */
#define ANGLE_SHIFT (0.0)
#define X_SHIFT   (0.5)
#define Y_SHIFT   (0.5)

#define MAX_PROTO_INDEX   24
#define BITS_PER_WERD   static_cast<int>(8 * sizeof(uinT32))
/* Script detection: increase this number to 128 */
#define MAX_NUM_CONFIGS   64
#define MAX_NUM_PROTOS    512
#define PROTOS_PER_PROTO_SET  64
#define MAX_NUM_PROTO_SETS  (MAX_NUM_PROTOS / PROTOS_PER_PROTO_SET)
#define NUM_PP_PARAMS   3
#define NUM_PP_BUCKETS    64
#define NUM_CP_BUCKETS    24
#define CLASSES_PER_CP    32
#define NUM_BITS_PER_CLASS  2
#define CLASS_PRUNER_CLASS_MASK (~(~0u << NUM_BITS_PER_CLASS))
#define CLASSES_PER_CP_WERD (CLASSES_PER_CP / NUM_BITS_PER_CLASS)
#define PROTOS_PER_PP_WERD  BITS_PER_WERD
#define BITS_PER_CP_VECTOR  (CLASSES_PER_CP * NUM_BITS_PER_CLASS)
#define MAX_NUM_CLASS_PRUNERS	((MAX_NUM_CLASSES + CLASSES_PER_CP - 1) /   \
				CLASSES_PER_CP)
#define WERDS_PER_CP_VECTOR (BITS_PER_CP_VECTOR / BITS_PER_WERD)
#define WERDS_PER_PP_VECTOR	((PROTOS_PER_PROTO_SET+BITS_PER_WERD-1)/    \
				BITS_PER_WERD)
#define WERDS_PER_PP		(NUM_PP_PARAMS * NUM_PP_BUCKETS *		\
				WERDS_PER_PP_VECTOR)
#define WERDS_PER_CP		(NUM_CP_BUCKETS * NUM_CP_BUCKETS *		\
				NUM_CP_BUCKETS * WERDS_PER_CP_VECTOR)
#define WERDS_PER_CONFIG_VEC	((MAX_NUM_CONFIGS + BITS_PER_WERD - 1) /    \
				BITS_PER_WERD)

/* The first 3 dimensions of the CLASS_PRUNER_STRUCT are the
 * 3 axes of the quantized feature space.
 * The position of the the bits recorded for each class in the
 * 4th dimension is determined by using CPrunerWordIndexFor(c),
 * where c is the corresponding class id. */
struct CLASS_PRUNER_STRUCT {
  uinT32 p[NUM_CP_BUCKETS][NUM_CP_BUCKETS][NUM_CP_BUCKETS][WERDS_PER_CP_VECTOR];
};

typedef struct
{
  inT8 A;
  uinT8 B;
  inT8 C;
  uinT8 Angle;
  uinT32 Configs[WERDS_PER_CONFIG_VEC];
}

INT_PROTO_STRUCT, *INT_PROTO;

typedef uinT32 PROTO_PRUNER[NUM_PP_PARAMS][NUM_PP_BUCKETS][WERDS_PER_PP_VECTOR];

typedef struct
{
  PROTO_PRUNER ProtoPruner;
  INT_PROTO_STRUCT Protos[PROTOS_PER_PROTO_SET];
}

PROTO_SET_STRUCT, *PROTO_SET;

typedef uinT32 CONFIG_PRUNER[NUM_PP_PARAMS][NUM_PP_BUCKETS][4];

typedef struct
{
  uinT16 NumProtos;
  uinT8 NumProtoSets;
  uinT8 NumConfigs;
  PROTO_SET ProtoSets[MAX_NUM_PROTO_SETS];
  uinT8 *ProtoLengths;
  uinT16 ConfigLengths[MAX_NUM_CONFIGS];
  int font_set_id;  // FontSet id, see above
}

INT_CLASS_STRUCT, *INT_CLASS;

typedef struct
{
  int NumClasses;
  int NumClassPruners;
  INT_CLASS Class[MAX_NUM_CLASSES];
  CLASS_PRUNER_STRUCT* ClassPruners[MAX_NUM_CLASS_PRUNERS];
}

INT_TEMPLATES_STRUCT, *INT_TEMPLATES;

/* definitions of integer features*/
#define MAX_NUM_INT_FEATURES 512
#define INT_CHAR_NORM_RANGE  256

struct INT_FEATURE_STRUCT {
  INT_FEATURE_STRUCT() : X(0), Y(0), Theta(0), CP_misses(0) { }
  // Builds a feature from an FCOORD for position with all the necessary
  // clipping and rounding.
  INT_FEATURE_STRUCT(const FCOORD& pos, uinT8 theta);
  // Builds a feature from ints with all the necessary clipping and casting.
  INT_FEATURE_STRUCT(int x, int y, int theta);

  uinT8 X;
  uinT8 Y;
  uinT8 Theta;
  inT8 CP_misses;

  void print() const {
    tprintf("(%d,%d):%d\n", X, Y, Theta);
  }
};

typedef INT_FEATURE_STRUCT *INT_FEATURE;

typedef INT_FEATURE_STRUCT INT_FEATURE_ARRAY[MAX_NUM_INT_FEATURES];

enum IntmatcherDebugAction {
  IDA_ADAPTIVE,
  IDA_STATIC,
  IDA_SHAPE_INDEX,
  IDA_BOTH
};

/**----------------------------------------------------------------------------
            Macros
----------------------------------------------------------------------------**/

#define MaxNumIntProtosIn(C)  (C->NumProtoSets * PROTOS_PER_PROTO_SET)
#define SetForProto(P)    (P / PROTOS_PER_PROTO_SET)
#define IndexForProto(P)  (P % PROTOS_PER_PROTO_SET)
#define ProtoForProtoId(C,P)	(&((C->ProtoSets[SetForProto (P)])->	\
					Protos [IndexForProto (P)]))
#define PPrunerWordIndexFor(I)	(((I) % PROTOS_PER_PROTO_SET) /		\
				PROTOS_PER_PP_WERD)
#define PPrunerBitIndexFor(I) ((I) % PROTOS_PER_PP_WERD)
#define PPrunerMaskFor(I) (1 << PPrunerBitIndexFor (I))

#define MaxNumClassesIn(T)    (T->NumClassPruners * CLASSES_PER_CP)
#define LegalClassId(c)   ((c) >= 0 && (c) <= MAX_CLASS_ID)
#define UnusedClassIdIn(T,c)  ((T)->Class[c] == NULL)
#define ClassForClassId(T,c) ((T)->Class[c])
#define ClassPrunersFor(T)  ((T)->ClassPruner)
#define CPrunerIdFor(c)   ((c) / CLASSES_PER_CP)
#define CPrunerFor(T,c)   ((T)->ClassPruners[CPrunerIdFor(c)])
#define CPrunerWordIndexFor(c)  (((c) % CLASSES_PER_CP) / CLASSES_PER_CP_WERD)
#define CPrunerBitIndexFor(c) (((c) % CLASSES_PER_CP) % CLASSES_PER_CP_WERD)
#define CPrunerMaskFor(L,c) (((L)+1) << CPrunerBitIndexFor (c) * NUM_BITS_PER_CLASS)

/* DEBUG macros*/
#define PRINT_MATCH_SUMMARY 0x001
#define DISPLAY_FEATURE_MATCHES 0x002
#define DISPLAY_PROTO_MATCHES 0x004
#define PRINT_FEATURE_MATCHES 0x008
#define PRINT_PROTO_MATCHES 0x010
#define CLIP_MATCH_EVIDENCE 0x020

#define MatchDebuggingOn(D)   (D)
#define PrintMatchSummaryOn(D)    ((D) & PRINT_MATCH_SUMMARY)
#define DisplayFeatureMatchesOn(D)  ((D) & DISPLAY_FEATURE_MATCHES)
#define DisplayProtoMatchesOn(D)  ((D) & DISPLAY_PROTO_MATCHES)
#define PrintFeatureMatchesOn(D)  ((D) & PRINT_FEATURE_MATCHES)
#define PrintProtoMatchesOn(D)    ((D) & PRINT_PROTO_MATCHES)
#define ClipMatchEvidenceOn(D)    ((D) & CLIP_MATCH_EVIDENCE)

/**----------------------------------------------------------------------------
          Public Function Prototypes
----------------------------------------------------------------------------**/
void AddIntClass(INT_TEMPLATES Templates, CLASS_ID ClassId, INT_CLASS Class);

int AddIntConfig(INT_CLASS Class);

int AddIntProto(INT_CLASS Class);

void AddProtoToClassPruner(PROTO Proto,
                           CLASS_ID ClassId,
                           INT_TEMPLATES Templates);

void AddProtoToProtoPruner(PROTO Proto, int ProtoId,
                           INT_CLASS Class, bool debug);

uinT8 Bucket8For(FLOAT32 param, FLOAT32 offset, int num_buckets);
uinT16 Bucket16For(FLOAT32 param, FLOAT32 offset, int num_buckets);

uinT8 CircBucketFor(FLOAT32 param, FLOAT32 offset, int num_buckets);

void UpdateMatchDisplay();

void ConvertConfig(BIT_VECTOR Config, int ConfigId, INT_CLASS Class);

void DisplayIntFeature(const INT_FEATURE_STRUCT* Feature, FLOAT32 Evidence);

void DisplayIntProto(INT_CLASS Class, PROTO_ID ProtoId, FLOAT32 Evidence);

INT_CLASS NewIntClass(int MaxNumProtos, int MaxNumConfigs);

INT_TEMPLATES NewIntTemplates();

void free_int_templates(INT_TEMPLATES templates);

void ShowMatchDisplay();

namespace tesseract {

// Clears the given window and draws the featurespace guides for the
// appropriate normalization method.
void ClearFeatureSpaceWindow(NORM_METHOD norm_method, ScrollView* window);

}  // namespace tesseract.

/*----------------------------------------------------------------------------*/
#ifndef GRAPHICS_DISABLED
void RenderIntFeature(ScrollView *window, const INT_FEATURE_STRUCT* Feature,
                      ScrollView::Color color);

void InitIntMatchWindowIfReqd();

void InitProtoDisplayWindowIfReqd();

void InitFeatureDisplayWindowIfReqd();

// Creates a window of the appropriate size for displaying elements
// in feature space.
ScrollView* CreateFeatureSpaceWindow(const char* name, int xpos, int ypos);
#endif  // GRAPHICS_DISABLED

#endif


text:
/**
 * @file task.cpp
 *
 * Main task handling the temperature calibration process
 *
 * @author Beat Küng <beat-kueng@gmx.net>
 */

#include <uORB/Publication.hpp>
#include <uORB/topics/sensor_gyro.h>
#include <mathlib/mathlib.h>
#include <px4_platform_common/atomic.h>
#include <px4_platform_common/log.h>
#include <px4_platform_common/posix.h>
#include <px4_platform_common/tasks.h>
#include <drivers/drv_hrt.h>
#include <drivers/drv_led.h>

#include <unistd.h>

#include "common.h"
#include "temperature_calibration.h"
#include "accel.h"
#include "baro.h"
#include "gyro.h"

class TemperatureCalibration;

namespace temperature_calibration
{
px4::atomic<TemperatureCalibration *> instance{nullptr};
}

class TemperatureCalibration
{
public:

	TemperatureCalibration(bool accel, bool baro, bool gyro) : _accel(accel), _baro(baro), _gyro(gyro) {}
	~TemperatureCalibration() = default;

	/**
	 * Start task.
	 *
	 * @return		OK on success.
	 */
	int		start();

	static int do_temperature_calibration(int argc, char *argv[]);

	void		task_main();

	void exit_task() { _force_task_exit = true; }

private:
	void publish_led_control(led_control_s &led_control);

	uORB::Publication<led_control_s> _led_control_pub{ORB_ID(led_control)};

	bool	_force_task_exit = false;
	int	_control_task = -1;		// task handle for task

	const bool _accel; ///< enable accel calibration?
	const bool _baro; ///< enable baro calibration?
	const bool _gyro; ///< enable gyro calibration?
};

void TemperatureCalibration::task_main()
{
	// subscribe to all gyro instances
	int gyro_sub[SENSOR_COUNT_MAX] {-1, -1, -1};
	px4_pollfd_struct_t fds[SENSOR_COUNT_MAX] {};
	unsigned num_gyro = orb_group_count(ORB_ID(sensor_gyro));

	if (num_gyro > SENSOR_COUNT_MAX) {
		num_gyro = SENSOR_COUNT_MAX;
	}

	for (unsigned i = 0; i < num_gyro; i++) {
		gyro_sub[i] = orb_subscribe_multi(ORB_ID(sensor_gyro), i);
		fds[i].fd = gyro_sub[i];
		fds[i].events = POLLIN;
	}

	int32_t min_temp_rise = 24;
	param_get(param_find("SYS_CAL_TDEL"), &min_temp_rise);
	PX4_INFO("Waiting for %" PRId32 " degrees difference in sensor temperature", min_temp_rise);

	int32_t min_start_temp = 5;
	param_get(param_find("SYS_CAL_TMIN"), &min_start_temp);

	int32_t max_start_temp = 10;
	param_get(param_find("SYS_CAL_TMAX"), &max_start_temp);

	//init calibrators
	TemperatureCalibrationBase *calibrators[3] {};
	bool error_reported[3] {};
	int num_calibrators = 0;

	if (_accel) {
		calibrators[num_calibrators] = new TemperatureCalibrationAccel(min_temp_rise, min_start_temp, max_start_temp);

		if (calibrators[num_calibrators]) {
			++num_calibrators;

		} else {
			PX4_ERR("alloc failed");
		}
	}

	if (_baro) {
		calibrators[num_calibrators] = new TemperatureCalibrationBaro(min_temp_rise, min_start_temp, max_start_temp);

		if (calibrators[num_calibrators]) {
			++num_calibrators;

		} else {
			PX4_ERR("alloc failed");
		}
	}

	if (_gyro) {
		calibrators[num_calibrators] = new TemperatureCalibrationGyro(min_temp_rise, min_start_temp, max_start_temp, gyro_sub,
				num_gyro);

		if (calibrators[num_calibrators]) {
			++num_calibrators;

		} else {
			PX4_ERR("alloc failed");
		}
	}

	hrt_abstime next_progress_output = hrt_absolute_time() + 1e6;

	// control LED's: blink, then turn solid according to progress
	led_control_s led_control{};
	led_control.led_mask = 0xff;
	led_control.mode = led_control_s::MODE_BLINK_NORMAL;
	led_control.priority = led_control_s::MAX_PRIORITY;
	led_control.color = led_control_s::COLOR_YELLOW;
	led_control.num_blinks = 0;
	publish_led_control(led_control);
	int leds_completed = 0;

	bool abort_calibration = false;

	while (!_force_task_exit) {
		/* we poll on the gyro(s), since this is the sensor with the highest update rate.
		 * Each individual sensor will then check on its own if there's new data.
		 */
		int ret = px4_poll(fds, num_gyro, 1000);

		if (ret < 0) {
			// Poll error, sleep and try again
			px4_usleep(10000);
			continue;

		} else if (ret == 0) {
			// Poll timeout or no new data, do nothing
			continue;
		}

		//if gyro is not enabled: we must do an orb_copy here, so that poll() does not immediately return again
		if (!_gyro) {
			sensor_gyro_s gyro_data;

			for (unsigned i = 0; i < num_gyro; ++i) {
				orb_copy(ORB_ID(sensor_gyro), gyro_sub[i], &gyro_data);
			}
		}

		int min_progress = 110;

		for (int i = 0; i < num_calibrators; ++i) {
			ret = calibrators[i]->update();

			if (ret == -TC_ERROR_COMMUNICATION) {
				abort_calibration = true;
				PX4_ERR("Calibration won't start - sensor bad or communication error");
				_force_task_exit = true;
				break;

			} else if (ret == -TC_ERROR_INITIAL_TEMP_TOO_HIGH) {
				abort_calibration = true;
				PX4_ERR("Calibration won't start - sensor temperature too high");
				_force_task_exit = true;
				break;

			} else if (ret < 0 && !error_reported[i]) {
				// temperature has decreased so calibration is not being updated
				error_reported[i] = true;
				PX4_ERR("Calibration update step failed (%i)", ret);

			} else if (ret < min_progress) {
				// temperature is stable or increasing
				min_progress = ret;
			}
		}

		if (min_progress == 110 || abort_calibration) {
			break; // we are done
		}

		int led_progress = min_progress * BOARD_MAX_LEDS / 100;

		for (; leds_completed < led_progress; ++leds_completed) {
			led_control.led_mask = 1 << leds_completed;
			led_control.mode = led_control_s::MODE_ON;
			publish_led_control(led_control);
		}

		//print progress each second
		hrt_abstime now = hrt_absolute_time();

		if (now > next_progress_output) {
			PX4_INFO("Calibration progress: %i%%", min_progress);
			next_progress_output = now + 1e6;
		}
	}

	if (abort_calibration) {
		led_control.color = led_control_s::COLOR_RED;

	} else {
		PX4_INFO("Sensor Measurments completed");

		// save params immediately so that we can check the result and don't have to wait for param save timeout
		param_control_autosave(false);

		// do final calculations & parameter storage
		for (int i = 0; i < num_calibrators; ++i) {
			int ret = calibrators[i]->finish();

			if (ret < 0) {
				PX4_ERR("Failed to finish calibration process (%i)", ret);
			}
		}

		param_notify_changes();
		int ret = param_save_default();

		if (ret != 0) {
			PX4_ERR("Failed to save params (%i)", ret);
		}

		param_control_autosave(true);

		led_control.color = led_control_s::COLOR_GREEN;
	}

	// blink the LED's according to success/failure
	led_control.led_mask = 0xff;
	led_control.mode = led_control_s::MODE_BLINK_FAST;
	led_control.num_blinks = 0;
	publish_led_control(led_control);

	for (int i = 0; i < num_calibrators; ++i) {
		delete calibrators[i];
	}

	for (unsigned i = 0; i < num_gyro; i++) {
		orb_unsubscribe(gyro_sub[i]);
	}

	delete temperature_calibration::instance.load();
	temperature_calibration::instance.store(nullptr);
	PX4_INFO("Exiting temperature calibration task");
}

int TemperatureCalibration::do_temperature_calibration(int argc, char *argv[])
{
	temperature_calibration::instance.load()->task_main();
	return 0;
}

int TemperatureCalibration::start()
{
	_control_task = px4_task_spawn_cmd("temperature_calib",
					   SCHED_DEFAULT,
					   SCHED_PRIORITY_MAX - 5,
					   5800,
					   (px4_main_t)&TemperatureCalibration::do_temperature_calibration,
					   nullptr);

	if (_control_task < 0) {
		delete temperature_calibration::instance.load();
		temperature_calibration::instance.store(nullptr);
		PX4_ERR("start failed");
		return -errno;
	}

	return 0;
}

void TemperatureCalibration::publish_led_control(led_control_s &led_control)
{
	led_control.timestamp = hrt_absolute_time();
	_led_control_pub.publish(led_control);
}

int run_temperature_calibration(bool accel, bool baro, bool gyro)
{
	if (temperature_calibration::instance.load() == nullptr) {
		PX4_INFO("Starting temperature calibration task (accel=%i, baro=%i, gyro=%i)", (int)accel, (int)baro, (int)gyro);
		temperature_calibration::instance.store(new TemperatureCalibration(accel, baro, gyro));

		if (temperature_calibration::instance.load() == nullptr) {
			PX4_ERR("alloc failed");
			return 1;
		}

		return temperature_calibration::instance.load()->start();

	} else {
		PX4_WARN("temperature calibration task already running");
	}

	return PX4_ERROR;
}


text:
cask 'iina' do
  version '0.0.12-build37'
  sha256 '5b4bd7cc48cf153c3488539fa6a9f60a5850c60e616110553cc833358d66bcbe'

  # dl-portal.iina.io was verified as official when first introduced to the cask
  url "https://dl-portal.iina.io/IINA.v#{version}.dmg"
  appcast 'https://www.iina.io/appcast.xml',
          checkpoint: '1a82d5afaeb09f22737d3c06195ac12afcedb9935c50d86fe4f770ecfe97d112'
  name 'IINA'
  homepage 'https://lhc70000.github.io/iina/'

  auto_updates true
  depends_on macos: '>= :yosemite'

  app 'IINA.app'

  zap delete: [
                '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.colliderli.iina.sfl',
                '~/Library/Caches/com.colliderli.iina',
                '~/Library/Cookies/com.colliderli.iina.binarycookies',
                '~/Library/Logs/DiagnosticReports/IINA*.crash',
                '~/Library/Saved Application State/com.colliderli.iina.savedState',
              ],
      trash:  [
                '~/Library/Application Support/com.colliderli.iina',
                '~/Library/Preferences/com.colliderli.iina.plist',
              ]
end


text:
(function (document, window, undefined) {
    function initFixTitle() {
        // First, check if we have to do anything
        if (window.location.href.match(/\/compare\//i)) {
            // Get the title and comment field:
            var title_field = document.querySelector('[name="pull_request[title]"]'),
                comment_field = document.querySelector('[name="pull_request[body]"]');

            // Remove the 'Hotfix/' or 'Feature/' prefix from the title field
            GitFlow.fix_title(title_field);

            // Check if the comment field is empty
            if (comment_field.value == '') {
                GitFlow.insert_pr_template(comment_field);
            }
        }
    }

    // Make sure this only happens at the right time!
    if (document.readyState === 'complete' || document.readyState === 'interactive') {
        initFixTitle();
    } else {
        document.addEventListener('load', initFixTitle);
    }
})(document, window);


text:
class WsjcppArgumentSingle {
    public:
        WsjcppArgumentSingle(const std::string &sName, const std::string &sDescription);
        std::string getName();
        std::string getDescription();

    private:
        std::string TAG;
        std::string m_sName;
        std::string m_sDescription;
};

// ---------------------------------------------------------------------

class WsjcppArgumentParameter {
    public:
        WsjcppArgumentParameter(
            const std::string &sName,
            const std::string &sValueName,
            const std::string &sDescription
        );
        std::string getName();
        std::string getValueName();
        std::string getDescription();
        std::string getValue();
        void setValue(const std::string &sValue);

    private:
        std::string TAG;
        std::string m_sName;
        std::string m_sValueName;
        std::string m_sValue;
        std::string m_sDescription;
};

// ---------------------------------------------------------------------

class WsjcppArgumentProcessor {
    public:
        WsjcppArgumentProcessor(
            const std::vector<std::string> &vNames,
            const std::string &sShortDescription,
            const std::string &sDescription
        );
        const std::vector<std::string> &getNames();
        std::string getNamesAsString();
        std::string getShortDescription();
        std::string getDescription();

        void registryProcessor(WsjcppArgumentProcessor *p);
        void registryExample(const std::string &sExample);
        void registrySingleArgument(const std::string &sArgumentName, const std::string &sDescription);
        void registryParameterArgument(
            const std::string &sArgumentName,
            const std::string &sArgumentValueName,
            const std::string &sDescription
        );
        WsjcppArgumentProcessor *findRegisteredProcessor(const std::string &sArgumentName);
        WsjcppArgumentSingle *findRegisteredSingleArgument(const std::string &sArgumentName);
        WsjcppArgumentParameter *findRegisteredParameterArgument(const std::string &sArgumentName);

        bool hasRegisteredArgumentName(const std::string &sArgumentName);

        bool getValueOfParam(const std::string &sArgumentName);
        int help(
            const std::vector<std::string> &vRoutes,
            const std::vector<std::string> &vSubParams
        );
        bool hasMoreOptions();

        virtual bool applySingleArgument(const std::string &sProgramName, const std::string &sArgumentName);
        virtual bool applyParameterArgument(const std::string &sProgramName, const std::string &sArgumentName, const std::string &sValue);
        virtual int exec(const std::vector<std::string> &vRoutes, const std::vector<std::string> &vSubParams);

    protected:
        std::string TAG;

    private:
        std::vector<std::string> m_vNames;
        std::string m_sShortDescription;
        std::string m_sDescription;
        std::vector<WsjcppArgumentProcessor *> m_vProcessors;
        std::vector<WsjcppArgumentSingle *> m_vSingleArguments;
        std::vector<WsjcppArgumentParameter *> m_vParameterArguments;
        std::vector<std::string> m_vExamples;
};

// ---------------------------------------------------------------------

class WsjcppArgumentsSpliter {
    public:
        WsjcppArgumentsSpliter(WsjcppArgumentProcessor *pArgumentProcessor, const std::vector<std::string> &vParams);
        std::vector<std::string> getSingleAgruments();
        std::vector<std::string> getParamsArguments();

    private:
        std::vector<std::string> m_vOriginalParams;
        std::vector<std::string> m_vSingleArguments;
        std::vector<std::string> m_vParamsArguments;
};

// ---------------------------------------------------------------------

class WsjcppArguments {
    public:
        WsjcppArguments(int argc, const char* argv[], WsjcppArgumentProcessor *pRoot);
        ~WsjcppArguments();
        void enablePrintAutoHelp(bool bEnablePrintAutoHelp);
        int exec();

    private:
        WsjcppArgumentProcessor *m_pRoot;
        std::vector<std::string> extractSingleAndParameterArguments(
            WsjcppArgumentProcessor *pArgumentProcessor,
            const std::vector<std::string> &vArguments,
            std::vector<WsjcppArgumentSingle *> &vSingleArguments,
            std::vector<WsjcppArgumentParameter *> &vParameterArguments
        );
        int recursiveExec(
            WsjcppArgumentProcessor *pArgumentProcessor,
            std::vector<std::string> &vRoutes,
            std::vector<std::string> &vSubArguments
        );

        std::string TAG;
        std::vector<std::string> m_vArguments;
        std::string m_sProgramName;
        bool m_bEnablePrintAutoHelp;
        std::vector<WsjcppArgumentProcessor *> m_vProcessors;

};

// ---------------------------------------------------------------------

#endif // WSJCPP_ARGUMENTS_H


text:
#pragma once

/**
 * @file sys/errno.h
 * @brief Historical synonym for `<errno.h>`.
 *
 * New code should use `<errno.h>` directly.
 */

#include <errno.h>


text:
<configuration>

    <conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />

    <appender name="ACCESS_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${application.home}/logs/access.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${application.home}/logs/access.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%message%n</pattern>
        </encoder>
    </appender>

    <appender name="APPLICATION_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${application.home}/logs/application.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${application.home}/logs/application.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
        </encoder>
    </appender>

    <appender name="MAIL_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${application.home}/logs/mail.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${application.home}/logs/mail.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
        </encoder>
    </appender>

    <appender name="ROOT_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${application.home}/logs/root.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${application.home}/logs/root.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pattern>
        </encoder>
    </appender>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%coloredLevel %logger{15} - %message%n%xException{5}</pattern>
        </encoder>
    </appender>

    <root level="ERROR">
        <appender-ref ref="STDOUT" />
        <appender-ref ref="ROOT_LOG_FILE" />
    </root>

    <logger name="play" level="DEBUG">
        <appender-ref ref="APPLICATION_LOG_FILE" />
    </logger>

    <logger name="application" level="DEBUG">
        <appender-ref ref="APPLICATION_LOG_FILE" />
    </logger>

    <logger name="access" level="DEBUG">
        <appender-ref ref="ACCESS_LOG_FILE" />
    </logger>

    <logger name="mail" level="DEBUG">
        <appender-ref ref="MAIL_LOG_FILE" />
    </logger>

    <logger name="info.schleichardt.play2.mail" level="DEBUG">
        <appender-ref ref="STDOUT" />
    </logger>

</configuration>


text:
Veros setup class
=================

.. autoclass:: veros.VerosSetup
   :members:


text:
if [[ ! -d .venv ]]; then
    python3 -m venv .venv
fi

. .venv/bin/activate

pip install twine
pip install wheel

python setup.py sdist
python setup.py bdist_wheel --universal


text:
liuzhen
lidongyang
xiehaishen
zhaohailin
yangbaibing