text:
GENN
====

Gradient-Enhanced Neural Networks (GENN) are fully connected multi-layer perceptrons, whose training process was modified to
account for gradient information. Specifically, the parameters are learned by minimizing the Least Squares Estimator (LSE),
modified to account for partial derivatives.  The theory behind the algorithm can be found `here`_,
but suffice it to say that the model is trained in such a way so as to minimize not only the prediction error :math:`y - f(x)` of
the response, but also the prediction error :math:`{dy}/{dx} - f'(x)` of the partial derivatives. The chief benefit of gradient-enhancement
is better accuracy with fewer training points, compared to regular neural networks without gradient-enhancement. Note that GENN applies
to regression (single-output or multi-output), but not classification since there is no gradient in that case. The implementation
is fully vectorized and uses Adam optimization, mini-batch, and L2-norm regularization.

.. _here: https://github.com/SMTorg/smt/blob/master/doc/_src_docs/surrogate_models/genn_theory.pdf

Limitations
-----------

Gradient-enhanced methods only apply to the special use-case of computer aided design, where data is generated
synthetically using physics-based computer models, responses are continuous, and their gradient is defined. Furthermore,
gradient enhancement is only beneficial when the cost of obtaining the gradient is not excessive in the first place.
This is often true in computer-aided design with the advent of adjoint design methods for example, but it is not always
the case. The user should therefore carefully weight the benefit of gradient-enhanced methods depending on the application.

Usage
-----

.. code-block:: python

  import numpy as np
  import matplotlib.pyplot as plt
  from smt.surrogate_models.genn import GENN, load_smt_data

  # Training data
  lower_bound = -np.pi
  upper_bound = np.pi
  number_of_training_points = 4
  xt = np.linspace(lower_bound, upper_bound, number_of_training_points)
  yt = xt * np.sin(xt)
  dyt_dxt = np.sin(xt) + xt * np.cos(xt)

  # Validation data
  number_of_validation_points = 30
  xv = np.linspace(lower_bound, upper_bound, number_of_validation_points)
  yv = xv * np.sin(xv)
  dyv_dxv = np.sin(xv) + xv * np.cos(xv)

  # Truth model
  x = np.arange(lower_bound, upper_bound, 0.01)
  y = x * np.sin(x)

  # GENN
  genn = GENN()
  genn.options["alpha"] = 0.1  # learning rate that controls optimizer step size
  genn.options["beta1"] = 0.9  # tuning parameter to control ADAM optimization
  genn.options["beta2"] = 0.99  # tuning parameter to control ADAM optimization
  genn.options[
      "lambd"
  ] = 0.1  # lambd = 0. = no regularization, lambd > 0 = regularization
  genn.options[
      "gamma"
  ] = 1.0  # gamma = 0. = no grad-enhancement, gamma > 0 = grad-enhancement
  genn.options["deep"] = 2  # number of hidden layers
  genn.options["wide"] = 6  # number of nodes per hidden layer
  genn.options[
      "mini_batch_size"
  ] = 64  # used to divide data into training batches (use for large data sets)
  genn.options["num_epochs"] = 20  # number of passes through data
  genn.options[
      "num_iterations"
  ] = 100  # number of optimizer iterations per mini-batch
  genn.options["is_print"] = True  # print output (or not)
  load_smt_data(
      genn, xt, yt, dyt_dxt
  )  # convenience function to read in data that is in SMT format
  genn.train()  # API function to train model
  genn.plot_training_history()  # non-API function to plot training history (to check convergence)
  genn.goodness_of_fit(
      xv, yv, dyv_dxv
  )  # non-API function to check accuracy of regression
  y_pred = genn.predict_values(
      x
  )  # API function to predict values at new (unseen) points

  # Plot
  fig, ax = plt.subplots()
  ax.plot(x, y_pred)
  ax.plot(x, y, "k--")
  ax.plot(xv, yv, "ro")
  ax.plot(xt, yt, "k+", mew=3, ms=10)
  ax.set(xlabel="x", ylabel="y", title="GENN")
  ax.legend(["Predicted", "True", "Test", "Train"])
  plt.show()

::

  ___________________________________________________________________________

                                     GENN
  ___________________________________________________________________________

   Problem size

        # training points.        : 4

  ___________________________________________________________________________

   Training

     Training ...
  epoch = 0, mini-batch = 0, avg cost = 22.881
  epoch = 1, mini-batch = 0, avg cost =  7.640
  epoch = 2, mini-batch = 0, avg cost =  7.474
  epoch = 3, mini-batch = 0, avg cost =  7.379
  epoch = 4, mini-batch = 0, avg cost =  7.308
  epoch = 5, mini-batch = 0, avg cost =  4.056
  epoch = 6, mini-batch = 0, avg cost =  0.701
  epoch = 7, mini-batch = 0, avg cost =  0.660
  epoch = 8, mini-batch = 0, avg cost =  0.647
  epoch = 9, mini-batch = 0, avg cost =  0.641
  epoch = 10, mini-batch = 0, avg cost =  0.637
  epoch = 11, mini-batch = 0, avg cost =  0.634
  epoch = 12, mini-batch = 0, avg cost =  0.632
  epoch = 13, mini-batch = 0, avg cost =  0.630
  epoch = 14, mini-batch = 0, avg cost =  0.629
  epoch = 15, mini-batch = 0, avg cost =  0.628
  epoch = 16, mini-batch = 0, avg cost =  0.627
  epoch = 17, mini-batch = 0, avg cost =  0.627
  epoch = 18, mini-batch = 0, avg cost =  0.627
  epoch = 19, mini-batch = 0, avg cost =  0.626
     Training - done. Time (sec):  3.2554069
  ___________________________________________________________________________

   Evaluation

        # eval points. : 629

     Predicting ...
     Predicting - done. Time (sec):  0.0000818

     Prediction time/pt. (sec) :  0.0000001

.. figure:: genn_Test_test_genn.png
  :scale: 80 %
  :align: center

Options
-------

.. list-table:: List of options
  :header-rows: 1
  :widths: 15, 10, 20, 20, 30
  :stub-columns: 0

  *  -  Option
     -  Default
     -  Acceptable values
     -  Acceptable types
     -  Description
  *  -  print_global
     -  True
     -  None
     -  ['bool']
     -  Global print toggle. If False, all printing is suppressed
  *  -  print_training
     -  True
     -  None
     -  ['bool']
     -  Whether to print training information
  *  -  print_prediction
     -  True
     -  None
     -  ['bool']
     -  Whether to print prediction information
  *  -  print_problem
     -  True
     -  None
     -  ['bool']
     -  Whether to print problem information
  *  -  print_solver
     -  True
     -  None
     -  ['bool']
     -  Whether to print solver information
  *  -  alpha
     -  0.5
     -  None
     -  ['int', 'float']
     -  optimizer learning rate
  *  -  beta1
     -  0.9
     -  None
     -  ['int', 'float']
     -  Adam optimizer tuning parameter
  *  -  beta2
     -  0.99
     -  None
     -  ['int', 'float']
     -  Adam optimizer tuning parameter
  *  -  lambd
     -  0.1
     -  None
     -  ['int', 'float']
     -  regularization coefficient
  *  -  gamma
     -  1.0
     -  None
     -  ['int', 'float']
     -  gradient-enhancement coefficient
  *  -  deep
     -  2
     -  None
     -  ['int']
     -  number of hidden layers
  *  -  wide
     -  2
     -  None
     -  ['int']
     -  number of nodes per hidden layer
  *  -  mini_batch_size
     -  64
     -  None
     -  ['int']
     -  split data into batches of specified size
  *  -  num_epochs
     -  10
     -  None
     -  ['int']
     -  number of random passes through the data
  *  -  num_iterations
     -  100
     -  None
     -  ['int']
     -  number of optimizer iterations per mini-batch
  *  -  seed
     -  None
     -  None
     -  ['int']
     -  random seed to ensure repeatability of results when desired
  *  -  is_print
     -  True
     -  None
     -  ['bool']
     -  print progress (or not)


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel frontend\modules\stock\models\StockSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Stocks';
$this->params['breadcrumbs'][] = $this->title;
?>

    <?/*= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'title',
            'number',
            'weight',
            'link',
            // 'price',
            // 'dt_add',
            // 'dt_update',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); */?>

<?= Html::a('Synchronize', ['synchronize'], ['class' => 'button button_size_s']) ?>

                <input class="checkAllStock" type="checkbox">
                Data
                Product
                Track Number
                Weight
                Price

                <?= \yii\widgets\ListView::widget(
                    [
                        'dataProvider' => $dataProvider,
                        'itemView' => '_list',

                        'layout' => "{items}",
                    ]
                )?>

            Data
            Products Information
            Address
            Description

            <?= date('d.m.Y'); ?>

            Address

Total price: $0

Tracking number:

Comment:

    <form id="packedForm" action="/packed/packed/update" method="post">
        <input type="hidden" name="packed_id" id="">
        <input type="hidden" name="Packed[idStock]" id="">
        <input type="hidden" name="Packed[dt_add]" value="<?= time(); ?>" id="">
        <input type="hidden" name="Packed[address_id]" value="" id="">
        <input type="hidden" name="Packed[price]" value="" id="">
        <input type="hidden" name="Packed[number]" value="" id="">
        <input type="hidden" name="Packed[comment]" value="" id="">

        <input type="hidden" name="_csrf" value="<?= Yii::$app->request->csrfToken?>" id="">

        <input type="submit" value="Send to packed" class="button  sendToPackedBtn" name="" id="">

    </form>

Edit Product

        <form class="edit-product edit-stock popup__form">

        </form>

Choose Address

        <form class="choose-address popup__form">
            <fieldset>
                Choose address

                    <?php foreach($address as $item): ?>
                            <div class="choose-address__item" id="address<?= $item->id; ?>">

                                    <input type="radio" value="<?= $item->id; ?>" name="addres" class="radio"><?= $item->country?>, <?= $item->city?>, <?= $item->address?>, <?= $item->first_name . ' ' . $item->last_name?>

                                <span data-csrf="<?= Yii::$app->request->csrfToken?>" data-id="<?= $item->id; ?>" title="Edit" class="link fa fa-pencil editAddress">

                    <?php endforeach; ?>

            </fieldset>

                + Add new address

                <button class="button addAddresToForm">Confirm</button>

        </form>

Add Address

            < Choose address

        <form class="form-address popup__form addressForm">
            <fieldset>

                    First name <input data-msg="requared input" type="text" name="first_name" class="input valid" required>Last name <input data-msg="requared input" type="text" name="last_name" class="input valid" required>

                Address <input data-msg="requared input" type="text" name="address" class="input valid" required>

                    City <input data-msg="requared input" type="text" name="city" class="input valid" required>Zip code <input data-msg="requared input" type="text" name="zip_code" class="input valid" required>Country <input data-msg="requared input" type="text" name="country" class="input valid" required>Telefon number <input data-msg="requared input" type="text" name="phone" class="input valid address_phone" required>

            </fieldset>

            <input type="hidden" name="_csrf" value="<?= Yii::$app->request->csrfToken?>" id="">

<button class="button jobAddrss createAddress" id="btnAddAddress">Confirm</button>

        </form>

Introduce Commentary

        <form class="edit-product popup__form">
            <fieldset>
                Comment <textarea name="comment" cols="" rows="" class="textarea"></textarea>
            </fieldset>

<button class="button addCommentForm">Confirm</button>

        </form>

redpajama_set_name: RedPajamaGithub


text:
package godot

import (
	"github.com/shadowapex/godot-go/gdnative"
)

/*------------------------------------------------------------------------------
//   This code was generated by a tool.
//
//   Changes to this file may cause incorrect behavior and will be lost if
//   the code is regenerated. Any updates should be done in
//   "class.go.tmpl" so they can be included in the generated
//   code.
//----------------------------------------------------------------------------*/

// SceneStateGenEditState is an enum for GenEditState values.
type SceneStateGenEditState int

const (
	SceneStateGenEditStateDisabled SceneStateGenEditState = 0
	SceneStateGenEditStateInstance SceneStateGenEditState = 1
	SceneStateGenEditStateMain     SceneStateGenEditState = 2
)

//func NewSceneStateFromPointer(ptr gdnative.Pointer) SceneState {
func newSceneStateFromPointer(ptr gdnative.Pointer) SceneState {
	owner := gdnative.NewObjectFromPointer(ptr)
	obj := SceneState{}
	obj.SetBaseObject(owner)

	return obj
}

/*
Maintains a list of resources, nodes, exported and overridden properties, and built-in scripts associated with a scene.
*/
type SceneState struct {
	Reference
	owner gdnative.Object
}

func (o *SceneState) BaseClass() string {
	return "SceneState"
}

/*
        Returns the list of bound parameters for the signal at [code]idx[/code].
	Args: [{ false idx int}], Returns: Array
*/
func (o *SceneState) GetConnectionBinds(idx gdnative.Int) gdnative.Array {
	//log.Println("Calling SceneState.GetConnectionBinds()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_connection_binds")

	// Call the parent method.
	// Array
	retPtr := gdnative.NewEmptyArray()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewArrayFromPointer(retPtr)
	return ret
}

/*
        Returns the number of signal connections in the scene.
	Args: [], Returns: int
*/
func (o *SceneState) GetConnectionCount() gdnative.Int {
	//log.Println("Calling SceneState.GetConnectionCount()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 0, 0)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_connection_count")

	// Call the parent method.
	// int
	retPtr := gdnative.NewEmptyInt()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewIntFromPointer(retPtr)
	return ret
}

/*
        Returns the flags for the signal at [code]idx[/code]. See [Object]'s [code]CONNECT_*[/code] flags.
	Args: [{ false idx int}], Returns: int
*/
func (o *SceneState) GetConnectionFlags(idx gdnative.Int) gdnative.Int {
	//log.Println("Calling SceneState.GetConnectionFlags()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_connection_flags")

	// Call the parent method.
	// int
	retPtr := gdnative.NewEmptyInt()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewIntFromPointer(retPtr)
	return ret
}

/*
        Returns the method connected to the signal at [code]idx[/code].
	Args: [{ false idx int}], Returns: String
*/
func (o *SceneState) GetConnectionMethod(idx gdnative.Int) gdnative.String {
	//log.Println("Calling SceneState.GetConnectionMethod()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_connection_method")

	// Call the parent method.
	// String
	retPtr := gdnative.NewEmptyString()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewStringFromPointer(retPtr)
	return ret
}

/*
        Returns the name of the signal at [code]idx[/code].
	Args: [{ false idx int}], Returns: String
*/
func (o *SceneState) GetConnectionSignal(idx gdnative.Int) gdnative.String {
	//log.Println("Calling SceneState.GetConnectionSignal()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_connection_signal")

	// Call the parent method.
	// String
	retPtr := gdnative.NewEmptyString()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewStringFromPointer(retPtr)
	return ret
}

/*
        Returns the path to the node that owns the signal at [code]idx[/code], relative to the root node.
	Args: [{ false idx int}], Returns: NodePath
*/
func (o *SceneState) GetConnectionSource(idx gdnative.Int) gdnative.NodePath {
	//log.Println("Calling SceneState.GetConnectionSource()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_connection_source")

	// Call the parent method.
	// NodePath
	retPtr := gdnative.NewEmptyNodePath()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewNodePathFromPointer(retPtr)
	return ret
}

/*
        Returns the path to the node that owns the method connected to the signal at [code]idx[/code], relative to the root node.
	Args: [{ false idx int}], Returns: NodePath
*/
func (o *SceneState) GetConnectionTarget(idx gdnative.Int) gdnative.NodePath {
	//log.Println("Calling SceneState.GetConnectionTarget()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_connection_target")

	// Call the parent method.
	// NodePath
	retPtr := gdnative.NewEmptyNodePath()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewNodePathFromPointer(retPtr)
	return ret
}

/*
        Returns the number of nodes in the scene.
	Args: [], Returns: int
*/
func (o *SceneState) GetNodeCount() gdnative.Int {
	//log.Println("Calling SceneState.GetNodeCount()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 0, 0)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_count")

	// Call the parent method.
	// int
	retPtr := gdnative.NewEmptyInt()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewIntFromPointer(retPtr)
	return ret
}

/*
        Returns the list of group names associated with the node at [code]idx[/code].
	Args: [{ false idx int}], Returns: PoolStringArray
*/
func (o *SceneState) GetNodeGroups(idx gdnative.Int) gdnative.PoolStringArray {
	//log.Println("Calling SceneState.GetNodeGroups()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_groups")

	// Call the parent method.
	// PoolStringArray
	retPtr := gdnative.NewEmptyPoolStringArray()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewPoolStringArrayFromPointer(retPtr)
	return ret
}

/*

	Args: [{ false idx int}], Returns: int
*/
func (o *SceneState) GetNodeIndex(idx gdnative.Int) gdnative.Int {
	//log.Println("Calling SceneState.GetNodeIndex()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_index")

	// Call the parent method.
	// int
	retPtr := gdnative.NewEmptyInt()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewIntFromPointer(retPtr)
	return ret
}

/*
        Returns the scene for the node at [code]idx[/code] or [code]null[/code] if the node is not an instance.
	Args: [{ false idx int}], Returns: PackedScene
*/
func (o *SceneState) GetNodeInstance(idx gdnative.Int) PackedSceneImplementer {
	//log.Println("Calling SceneState.GetNodeInstance()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_instance")

	// Call the parent method.
	// PackedScene
	retPtr := gdnative.NewEmptyObject()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := newPackedSceneFromPointer(retPtr)

	// Check to see if we already have an instance of this object in our Go instance registry.
	if instance, ok := InstanceRegistry.Get(ret.GetBaseObject().ID()); ok {
		return instance.(PackedSceneImplementer)
	}

	// Check to see what kind of class this is and create it. This is generally used with
	// GetNode().
	className := ret.GetClass()
	if className != "PackedScene" {
		actualRet := getActualClass(className, ret.GetBaseObject())
		return actualRet.(PackedSceneImplementer)
	}

	return &ret
}

/*
        Returns the path to the represented scene file if the node at [code]idx[/code] is an [InstancePlaceholder].
	Args: [{ false idx int}], Returns: String
*/
func (o *SceneState) GetNodeInstancePlaceholder(idx gdnative.Int) gdnative.String {
	//log.Println("Calling SceneState.GetNodeInstancePlaceholder()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_instance_placeholder")

	// Call the parent method.
	// String
	retPtr := gdnative.NewEmptyString()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewStringFromPointer(retPtr)
	return ret
}

/*
        Returns the name of the node at [code]idx[/code].
	Args: [{ false idx int}], Returns: String
*/
func (o *SceneState) GetNodeName(idx gdnative.Int) gdnative.String {
	//log.Println("Calling SceneState.GetNodeName()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_name")

	// Call the parent method.
	// String
	retPtr := gdnative.NewEmptyString()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewStringFromPointer(retPtr)
	return ret
}

/*
        Returns the path to the owner of the node at [code]idx[/code], relative to the root node.
	Args: [{ false idx int}], Returns: NodePath
*/
func (o *SceneState) GetNodeOwnerPath(idx gdnative.Int) gdnative.NodePath {
	//log.Println("Calling SceneState.GetNodeOwnerPath()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_owner_path")

	// Call the parent method.
	// NodePath
	retPtr := gdnative.NewEmptyNodePath()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewNodePathFromPointer(retPtr)
	return ret
}

/*
        Returns the path to the node at [code]idx[/code].
	Args: [{ false idx int} {False true for_parent bool}], Returns: NodePath
*/
func (o *SceneState) GetNodePath(idx gdnative.Int, forParent gdnative.Bool) gdnative.NodePath {
	//log.Println("Calling SceneState.GetNodePath()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 2, 2)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)
	ptrArguments[1] = gdnative.NewPointerFromBool(forParent)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_path")

	// Call the parent method.
	// NodePath
	retPtr := gdnative.NewEmptyNodePath()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewNodePathFromPointer(retPtr)
	return ret
}

/*
        Returns the number of exported or overridden properties for the node at [code]idx[/code].
	Args: [{ false idx int}], Returns: int
*/
func (o *SceneState) GetNodePropertyCount(idx gdnative.Int) gdnative.Int {
	//log.Println("Calling SceneState.GetNodePropertyCount()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_property_count")

	// Call the parent method.
	// int
	retPtr := gdnative.NewEmptyInt()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewIntFromPointer(retPtr)
	return ret
}

/*
        Returns the name of the property at [code]prop_idx[/code] for the node at [code]idx[/code].
	Args: [{ false idx int} { false prop_idx int}], Returns: String
*/
func (o *SceneState) GetNodePropertyName(idx gdnative.Int, propIdx gdnative.Int) gdnative.String {
	//log.Println("Calling SceneState.GetNodePropertyName()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 2, 2)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)
	ptrArguments[1] = gdnative.NewPointerFromInt(propIdx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_property_name")

	// Call the parent method.
	// String
	retPtr := gdnative.NewEmptyString()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewStringFromPointer(retPtr)
	return ret
}

/*
        Returns the value of the property at [code]prop_idx[/code] for the node at [code]idx[/code].
	Args: [{ false idx int} { false prop_idx int}], Returns: Variant
*/
func (o *SceneState) GetNodePropertyValue(idx gdnative.Int, propIdx gdnative.Int) gdnative.Variant {
	//log.Println("Calling SceneState.GetNodePropertyValue()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 2, 2)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)
	ptrArguments[1] = gdnative.NewPointerFromInt(propIdx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_property_value")

	// Call the parent method.
	// Variant
	retPtr := gdnative.NewEmptyVariant()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewVariantFromPointer(retPtr)
	return ret
}

/*
        Returns the type of the node at [code]idx[/code].
	Args: [{ false idx int}], Returns: String
*/
func (o *SceneState) GetNodeType(idx gdnative.Int) gdnative.String {
	//log.Println("Calling SceneState.GetNodeType()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "get_node_type")

	// Call the parent method.
	// String
	retPtr := gdnative.NewEmptyString()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewStringFromPointer(retPtr)
	return ret
}

/*
        Returns [code]true[/code] if the node at [code]idx[/code] is an [InstancePlaceholder].
	Args: [{ false idx int}], Returns: bool
*/
func (o *SceneState) IsNodeInstancePlaceholder(idx gdnative.Int) gdnative.Bool {
	//log.Println("Calling SceneState.IsNodeInstancePlaceholder()")

	// Build out the method's arguments
	ptrArguments := make([]gdnative.Pointer, 1, 1)
	ptrArguments[0] = gdnative.NewPointerFromInt(idx)

	// Get the method bind
	methodBind := gdnative.NewMethodBind("SceneState", "is_node_instance_placeholder")

	// Call the parent method.
	// bool
	retPtr := gdnative.NewEmptyBool()
	gdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)

	// If we have a return type, convert it from a pointer into its actual object.
	ret := gdnative.NewBoolFromPointer(retPtr)
	return ret
}

// SceneStateImplementer is an interface that implements the methods
// of the SceneState class.
type SceneStateImplementer interface {
	ReferenceImplementer
	GetConnectionBinds(idx gdnative.Int) gdnative.Array
	GetConnectionCount() gdnative.Int
	GetConnectionFlags(idx gdnative.Int) gdnative.Int
	GetConnectionMethod(idx gdnative.Int) gdnative.String
	GetConnectionSignal(idx gdnative.Int) gdnative.String
	GetConnectionSource(idx gdnative.Int) gdnative.NodePath
	GetConnectionTarget(idx gdnative.Int) gdnative.NodePath
	GetNodeCount() gdnative.Int
	GetNodeGroups(idx gdnative.Int) gdnative.PoolStringArray
	GetNodeIndex(idx gdnative.Int) gdnative.Int
	GetNodeInstance(idx gdnative.Int) PackedSceneImplementer
	GetNodeInstancePlaceholder(idx gdnative.Int) gdnative.String
	GetNodeName(idx gdnative.Int) gdnative.String
	GetNodeOwnerPath(idx gdnative.Int) gdnative.NodePath
	GetNodePath(idx gdnative.Int, forParent gdnative.Bool) gdnative.NodePath
	GetNodePropertyCount(idx gdnative.Int) gdnative.Int
	GetNodePropertyName(idx gdnative.Int, propIdx gdnative.Int) gdnative.String
	GetNodePropertyValue(idx gdnative.Int, propIdx gdnative.Int) gdnative.Variant
	GetNodeType(idx gdnative.Int) gdnative.String
	IsNodeInstancePlaceholder(idx gdnative.Int) gdnative.Bool
}


text:
/**
 * The contents of this file is free and unencumbered software released into the
 * public domain. For more information, please refer to <http://unlicense.org/>
 *
 * @author Maxmillion McLaughlin <npm@maxmclau.com>
 */

'use strict'

import debug from 'debug'
import yaml from 'yamljs'
import express from 'express'
import bodyParser from 'body-parser'
import expressHealthCheck from 'express-healthcheck'
import expressStatusMonitor from 'express-status-monitor'
import api from './api'

let log = debug('api-servicetitan-xyz')

let server = express()

let apiVersion = yaml.load(`${__dirname}/./../app.yaml`).api_version

server.use(bodyParser.urlencoded({ extended: true }))
server.use(bodyParser.json())

server.use('/', express.static(`${__dirname}/./public`));

server.use('/_ah', expressStatusMonitor())
server.use('/_ah/health', expressHealthCheck())

server.use(`/${apiVersion}`, api())

let listener = server.listen(process.env.PORT || 8080, () => {
  log(`${listener.address().port} did start server on port`)
})

export default server;


text:
package org.apache.batik.dom.svg;

import java.awt.geom.AffineTransform;

import org.apache.batik.anim.values.AnimatableMotionPointValue;
import org.apache.batik.anim.values.AnimatableValue;
import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.util.DoublyIndexedTable;
import org.apache.batik.util.SVGTypes;

import org.w3c.dom.Node;
import org.w3c.dom.svg.SVGAnimatedTransformList;
import org.w3c.dom.svg.SVGElement;
import org.w3c.dom.svg.SVGException;
import org.w3c.dom.svg.SVGMatrix;
import org.w3c.dom.svg.SVGRect;
import org.w3c.dom.svg.SVGTextElement;

/**
 * This class implements {@link SVGTextElement}.
 *
 * @author Stephane Hillion
 * @version $Id$
 */
public class SVGOMTextElement
    extends    SVGOMTextPositioningElement
    implements SVGTextElement,
               SVGMotionAnimatableElement {

    // Default values for attributes on a text element
    protected static final String X_DEFAULT_VALUE = "0";
    protected static final String Y_DEFAULT_VALUE = "0";

    /**
     * Table mapping XML attribute names to TraitInformation objects.
     */
    protected static DoublyIndexedTable xmlTraitInformation;
    static {
        DoublyIndexedTable t =
            new DoublyIndexedTable(SVGOMTextPositioningElement.xmlTraitInformation);
        t.put(null, SVG_TRANSFORM_ATTRIBUTE,
                new TraitInformation(true, SVGTypes.TYPE_TRANSFORM_LIST));
        xmlTraitInformation = t;
    }

    /**
     * The 'transform' attribute value.
     */
    protected SVGOMAnimatedTransformList transform;

    /**
     * Supplemental transformation due to motion animation.
     */
    protected AffineTransform motionTransform;

    /**
     * Creates a new SVGOMTextElement object.
     */
    protected SVGOMTextElement() {
    }

    /**
     * Creates a new SVGOMTextElement object.
     * @param prefix The namespace prefix.
     * @param owner The owner document.
     */
    public SVGOMTextElement(String prefix, AbstractDocument owner) {
        super(prefix, owner);
        initializeLiveAttributes();
    }

    /**
     * Initializes all live attributes for this element.
     */
    protected void initializeAllLiveAttributes() {
        super.initializeAllLiveAttributes();
        initializeLiveAttributes();
    }

    /**
     * Initializes the live attribute values of this element.
     */
    private void initializeLiveAttributes() {
        transform =
            createLiveAnimatedTransformList(null, SVG_TRANSFORM_ATTRIBUTE, "");
    }

    /**
     * DOM: Implements {@link Node#getLocalName()}.
     */
    public String getLocalName() {
        return SVG_TEXT_TAG;
    }

    // SVGLocatable support /////////////////////////////////////////////

    /**
     * DOM: Implements {@link
     * org.w3c.dom.svg.SVGLocatable#getNearestViewportElement()}.
     */
    public SVGElement getNearestViewportElement() {
        return SVGLocatableSupport.getNearestViewportElement(this);
    }

    /**
     * DOM: Implements {@link
     * org.w3c.dom.svg.SVGLocatable#getFarthestViewportElement()}.
     */
    public SVGElement getFarthestViewportElement() {
        return SVGLocatableSupport.getFarthestViewportElement(this);
    }

    /**
     * DOM: Implements {@link org.w3c.dom.svg.SVGLocatable#getBBox()}.
     */
    public SVGRect getBBox() {
        return SVGLocatableSupport.getBBox(this);
    }

    /**
     * DOM: Implements {@link org.w3c.dom.svg.SVGLocatable#getCTM()}.
     */
    public SVGMatrix getCTM() {
        return SVGLocatableSupport.getCTM(this);
    }

    /**
     * DOM: Implements {@link
     * org.w3c.dom.svg.SVGLocatable#getScreenCTM()}.
     */
    public SVGMatrix getScreenCTM() {
        return SVGLocatableSupport.getScreenCTM(this);
    }

    /**
     * DOM: Implements {@link
     * org.w3c.dom.svg.SVGLocatable#getTransformToElement(SVGElement)}.
     */
    public SVGMatrix getTransformToElement(SVGElement element)
        throws SVGException {
        return SVGLocatableSupport.getTransformToElement(this, element);
    }

    // SVGTransformable support /////////////////////////////////////////////

    /**
     * DOM: Implements {@link
     * org.w3c.dom.svg.SVGTransformable#getTransform()}.
     */
    public SVGAnimatedTransformList getTransform() {
        return transform;
    }

    /**
     * Returns the default value of the 'x' attribute.
     */
    protected String getDefaultXValue() {
        return X_DEFAULT_VALUE;
    }

    /**
     * Returns the default value of the 'y' attribute.
     */
    protected String getDefaultYValue() {
        return Y_DEFAULT_VALUE;
    }

    /**
     * Returns a new uninitialized instance of this object's class.
     */
    protected Node newNode() {
        return new SVGOMTextElement();
    }

    /**
     * Returns the table of TraitInformation objects for this element.
     */
    protected DoublyIndexedTable getTraitInformationTable() {
        return xmlTraitInformation;
    }

    // SVGMotionAnimatableElement ////////////////////////////////////////////

    /**
     * Returns the {@link AffineTransform} representing the current motion
     * animation for this element.
     */
    public AffineTransform getMotionTransform() {
        return motionTransform;
    }

    // AnimationTarget ///////////////////////////////////////////////////////

    /**
     * Updates a 'other' animation value in this target.
     */
    public void updateOtherValue(String type, AnimatableValue val) {
        if (type.equals("motion")) {
            if (motionTransform == null) {
                motionTransform = new AffineTransform();
            }
            if (val == null) {
                motionTransform.setToIdentity();
            } else {
                AnimatableMotionPointValue p = (AnimatableMotionPointValue) val;
                motionTransform.setToTranslation(p.getX(), p.getY());
                motionTransform.rotate(p.getAngle());
            }
            SVGOMDocument d = (SVGOMDocument) ownerDocument;
            d.getAnimatedAttributeListener().otherAnimationChanged(this, type);
        } else {
            super.updateOtherValue(type, val);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Beef Brisket with Texas Barbecue Sauce</title>
      <categories>
        <cat>Summer</cat></categories>
      <yield>1</yield></head>
    <ingredients>
      <ing-div>
        <title/>
        <ing>
          <amt>
            <qty>1</qty>
            <unit>cup</unit></amt>
          <item>Vegetable oil</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit>cup</unit></amt>
          <item>Cider vinegar</item></ing>
        <ing>
          <amt>
            <qty>1/4</qty>
            <unit>cups</unit></amt>
          <item>Worcestershire sauce</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit/></amt>
          <item>Bay leaf; crumbled</item></ing>
        <ing>
          <amt>
            <qty>1 1/4</qty>
            <unit>teaspoons</unit></amt>
          <item>Seasoning salt</item></ing>
        <ing>
          <amt>
            <qty>2 1/4</qty>
            <unit>teaspoons</unit></amt>
          <item>Pepper</item></ing>
        <ing>
          <amt>
            <qty>3/4</qty>
            <unit>teaspoons</unit></amt>
          <item>Paprika</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit/></amt>
          <item>Beef; (3-lb.) brisket</item></ing>
        <ing>
          <amt>
            <qty/>
            <unit/></amt>
          <item>Texas barbecue sauce</item></ing></ing-div>
      <ing-div>
        <title>GARNISH</title>
        <ing>
          <amt>
            <qty/>
            <unit/></amt>
          <item>Fresh thyme sprigs</item></ing></ing-div></ingredients>
    <directions>
      <step>  Combine first 4 ingredients in a shallow dish or large zip-top plastic bag.

  Combine seasoning salt, pepper, and paprika; rub into brisket, and place in
  marinade. Cover or seal; chill 8 hours, turning occasionally. Prepare fire
  by placing 2 pieces of oak or 10 hickory chunks at front and back of grill,
  and piling charcoal in the middle. Let fire burn until coals are white.

       Remove brisket from marinade; discard marinade. Rake coals to 1 end of
  grill; place brisket at opposite end. Grill, without grill lid, over
  indirect heat 2 to 2 1/2 hours.

  Brush both sides of brisket with 1 cup Texas Barbecue Sauce, and cook 1
  hour or until tender, basting with sauce. Serve with remaining 2 cups
  sauce. Garnish, if desired. Makes 6 to 8 servings.

  Southern Living Website

  Recipe by: Southern Living

  Posted to MC-Recipe Digest V1 #1039 by Suzy Wert <SuzyWert@aol.com> on Jan
  23, 1998

</step></directions></recipe></recipeml>


text:
package com.all.app;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public abstract class AbstractApplication<T> implements Application<T> {
	private static final Log log = LogFactory.getLog(AbstractApplication.class);

	private List<AppListener> listeners;

	private ResultProcessor<T> resultProcessor;

	private Module mainModule;

	public AbstractApplication(Module mainModule) {
		this.mainModule = mainModule;
		listeners = new ArrayList<AppListener>();
	}

	public void setMainModule(Module mainModule) {
		this.mainModule = mainModule;
	}

	@Override
	public T execute() {
		try {
			launchInitializers();
			launchPhase();
			launchDestroyers();
		} catch (Exception e) {
			log.debug(e, e);
		}
		if (resultProcessor != null) {
			return resultProcessor.result(getAttributes());
		}
		return null;
	}

	private void launchDestroyers() {
		for (AppListener destroyer : listeners) {
			try {
				destroyer.destroy();
			} catch (ApplicationAbortException e) {
				log.debug(e, e);
				throw e;
			} catch (Exception e) {
				log.debug(e, e);
			}
		}
	}

	private void launchInitializers() {
		for (AppListener initializer : listeners) {
			try {
				initializer.initialize();
			} catch (ApplicationAbortException e) {
				log.debug(e, e);
				throw e;
			} catch (Exception e) {
				log.debug(e, e);
			}
		}
	}

	private void launchPhase() {
		// AppModule currentPhase = null;
		// do {
		// currentPhase = phases.poll();
		// if (currentPhase != null) {
		try {
			mainModule.activate();
		} catch (ApplicationAbortException e) {
			log.debug(e, e);
			throw e;
		} catch (Exception e) {
			log.error(e, e);
		}
		try {
			mainModule.execute(getAttributes());
		} catch (ApplicationAbortException e) {
			log.debug(e, e);
			throw e;
		} catch (Exception e) {
			log.error(e, e);
		}
		try {
			mainModule.destroy();
		} catch (ApplicationAbortException e) {
			log.debug(e, e);
			throw e;
		} catch (Exception e) {
			log.error(e, e);
		}
		// }
		// } while (currentPhase != null);
	}

	@Override
	public void addAppListener(AppListener listener) {
		listeners.add(listener);
	}

	@Override
	public void setResultProcessor(ResultProcessor<T> resultProcessor) {
		this.resultProcessor = resultProcessor;
	}

	protected abstract Attributes getAttributes();

}


text:
FFMPEG_SOURCE="git://source.ffmpeg.org/ffmpeg.git"
FFMPEG_VERSION=`cat version`

[ -z "$NDK_HOME" ] && NDK_HOME=/opt/android-ndk

# defaults
api_level=14
target=armeabi-v7a
compiler_version=4.8
ndk_home=$NDK_HOME
build_forks=

usage() {
cat << _EOF
Use: $0 [--api-level LEVEL] [--target TARGET] [--compiler-version CVER] [--ndk-home NDK_HOME] [-j BUILD_FORKS]

  LEVEL: see at the NDK_HOME/platform. Level is a digit
    14*

  TARGET:
     armeabi
     armeabi-v7a*
     mips
     x86

  CVER:
    4.6
    4.8*

  NDK_HOME: usaly /opt/android-ndk (this value sets by defaul)

  BUILD_FORKS: amout of parallel build processes, autodetect if omited

  Asterisk (*) marks default values
_EOF
}

# parse command line
while [ -n "$1" ]; do
    cur=$1

    case "$cur" in
        --api-level)
            shift
            api_level=$1
        ;;

        --target)
            shift
            target=$1
        ;;

        --compiler-version)
            shift
            compiler-version=$1
        ;;

        --ndk-home)
            shift
            ndk_home=$1
        ;;

        -j)
            shift
            build_forks=$1
        ;;

        --help)
            usage
            exit 0
        ;;

        *)
            echo "Unknown option: $1"
            exit 1
        ;;
    esac

    shift
done

# Autodetect parallel build
if [ -z "$build_forks" ]; then
    build_forks=`cat /proc/cpuinfo | grep processor | wc -l`
fi

# Android NDK setup
NDK_PLATFORM_LEVEL=$api_level
NDK_COMPILER_VERSION=$compiler_version
NDK_UNAME=`uname -s | tr '[A-Z]' '[a-z]'`

setup_abi() {

    if [ $NDK_ABI = "x86" ]; then
        HOST=i686-linux-android
        NDK_TOOLCHAIN=$NDK_ABI-$NDK_COMPILER_VERSION
    else
        HOST=$NDK_ABI-linux-androideabi
        NDK_TOOLCHAIN=$HOST-$NDK_COMPILER_VERSION
    fi

}

# select ABI
case $target in
    armeabi)
        NDK_ABI=arm
        HOST=$NDK_ABI-linux-androideabi
        NDK_TOOLCHAIN=$HOST-$NDK_COMPILER_VERSION

        FFMPEG_ARCH="arm"
        FFMPEG_FLAGS_EXTRA=""

        CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
            -finline-limit=300 -ffast-math \
            -fstrict-aliasing -Werror=strict-aliasing \
            -fmodulo-sched -fmodulo-sched-allow-regmoves \
            -Wno-psabi -Wa,--noexecstack \
            -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ \
            -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ \
            -DANDROID -DNDEBUG"

        EXTRA_CFLAGS="-march=armv6"
        EXTRA_LDFLAGS=""

    ;;
    armeabi-v7a)
        NDK_ABI=arm
        HOST=$NDK_ABI-linux-androideabi
        NDK_TOOLCHAIN=$HOST-$NDK_COMPILER_VERSION

        FFMPEG_ARCH="arm"
        FFMPEG_FLAGS_EXTRA="--cpu=cortex-a8"

        CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
            -finline-limit=300 -ffast-math \
            -fstrict-aliasing -Werror=strict-aliasing \
            -fmodulo-sched -fmodulo-sched-allow-regmoves \
            -Wno-psabi -Wa,--noexecstack \
            -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ \
            -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ \
            -DANDROID -DNDEBUG"

        EXTRA_CFLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad"
        EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"

    ;;
    x86)
        NDK_ABI=x86
        HOST=i686-linux-android
        NDK_TOOLCHAIN=$NDK_ABI-$NDK_COMPILER_VERSION

        FFMPEG_ARCH="x86"
        FFMPEG_FLAGS_EXTRA=""

        CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
            -finline-limit=300 -ffast-math \
            -fstrict-aliasing -Werror=strict-aliasing \
            -fmodulo-sched -fmodulo-sched-allow-regmoves \
            -Wno-psabi -Wa,--noexecstack \
            -DANDROID -DNDEBUG"

        EXTRA_CFLAGS="-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32"
        EXTRA_LDFLAGS=""

    ;;
    mips)
        NDK_ABI=mips
        HOST=mipsel-linux-android
        NDK_TOOLCHAIN=$HOST-$NDK_COMPILER_VERSION

        FFMPEG_ARCH="mips"
        FFMPEG_FLAGS_EXTRA=""

        CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
            -finline-limit=300 -ffast-math \
            -fstrict-aliasing -Werror=strict-aliasing \
            -fmodulo-sched -fmodulo-sched-allow-regmoves \
            -Wno-psabi -Wa,--noexecstack \
            -DANDROID -DNDEBUG"

        EXTRA_CFLAGS="-march=mipsel"
        EXTRA_LDFLAGS=""

    ;;
    *)
        echo "Unsupported target: $target"
        exit 1
    ;;
esac

NDK_TARGET=$target
NDK_SYSROOT=$NDK_HOME/platforms/android-$NDK_PLATFORM_LEVEL/arch-$NDK_ABI

export TOOLCHAIN=`pwd`/ffmpeg-git/ffmpeg-android-$NDK_TARGET
export SYSROOT=$TOOLCHAIN/sysroot
export PATH=$TOOLCHAIN/bin:$PATH

export CC=$HOST-gcc
export CXX=$HOST-g++
export LD=$HOST-ld
export AR=$HOST-ar

FFMPEG_FLAGS="\
  --prefix=$TOOLCHAIN/build \
  --target-os=linux \
  --arch=$FFMPEG_ARCH \
  $FFMPEG_FLAGS_EXTRA \
  --enable-runtime-cpudetect \
  --enable-pic \
  --enable-cross-compile \
  --cross-prefix=$HOST- \
  --enable-gpl \
  --enable-shared \
  --disable-symver \
  --disable-doc \
  --disable-ffplay \
  --disable-ffmpeg \
  --disable-ffprobe \
  --disable-ffserver \
  --enable-avdevice \
  --enable-avfilter \
  --enable-encoders  \
  --enable-muxers \
  --enable-protocols  \
  --enable-parsers \
  --enable-demuxers \
  --disable-demuxer=sbg \
  --enable-decoders \
  --enable-bsfs \
  --enable-network \
  --enable-swscale  \
  --enable-asm \
  --enable-version3"

START_DIR=`pwd`

echo "Build for $HOST"

get_source() {
    if [ -x "ffmpeg-git" ]; then
        cd ffmpeg-git

        branch=`git branch | grep '^\*' | awk '{print $2}'`

        if [ "$branch" != "master" ]; then
            echo "Clean up previous build: $branch"

            # Revert all changes
            git checkout .
            git reset
            git clean -f -x -d

            git checkout master
            git branch -D "$branch"
        fi

        git pull origin master
    else
        git clone $FFMPEG_SOURCE ffmpeg-git
        cd ffmpeg-git
    fi

    branch="android-build-$NDK_TARGET"
    git branch -d $branch || git branch -D $branch > /dev/null 2>&1
    git checkout -b android-build-$NDK_TARGET $FFMPEG_VERSION
}

prepare_ndk() {
    set -x
    rm -rf /tmp/ndk-$USER
    $NDK_HOME/build/tools/make-standalone-toolchain.sh \
        --toolchain=$NDK_TOOLCHAIN \
        --platform=android-$NDK_PLATFORM_LEVEL \
        --install-dir=$TOOLCHAIN
}

configure_ffmpeg() {
    ./configure $FFMPEG_FLAGS --extra-cflags="$CFLAGS $EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS"
}

build_ffmpeg() {
    make clean
    make -j $build_forks
    make install

    mkdir -p "$START_DIR/targets/$NDK_TARGET"
    cp -a "$TOOLCHAIN/build/"* "$START_DIR/targets/$NDK_TARGET/"
    rm -rf "$START_DIR/targets/$NDK_TARGET/lib/pkgconfig"
}

post_build_ffmpeg() {
    rm libavcodec/inverse.o
    $CC -lm -lz -shared --sysroot=$SYSROOT \
        -Wl,--no-undefined -Wl,-z,noexecstack $EXTRA_LDFLAGS \
            libavutil/*.o libavutil/arm/*.o libavcodec/*.o libavcodec/arm/*.o \
            libavformat/*.o libswresample/*.o libswscale/*.o -o libffmpeg.so
    $HOST-strip --strip-unneeded libffmpeg.so
}

get_source || exit 1
prepare_ndk || exit 2
configure_ffmpeg || exit 3
build_ffmpeg || exit 4
#post_build_ffmpeg


text:
unless Gem::Requirement.new(">= 12.0").satisfied_by?(Gem::Version.new(Chef::VERSION))
  raise "This resource is written with Chef 12.5 custom resources, and requires at least Chef 12.0 used with the compat_resource cookbook, it will not work with Chef 11.x clients, and those users must pin their cookbooks to older versions or upgrade."
end

# If users are on old verisons of ChefDK which activates an (old) gem via cheffish before this cookbook loads, then
# we just try to monkeypatch over the top of a monkeypatch.  Its possible that we have checks in this cookbook which
# will defeat that purpose and fail to monkeypatch on top of monkeypatches -- in which case those checks should be
# removed -- this cookbook needs to win when it gets into a fight with the old gem versions.
if Gem.loaded_specs["compat_resource"]
  Chef.log_deprecation "using compat_resource as a gem is deprecated;  please update cheffish and chef-provisioning gems (or use the latest Chef/ChefDK packages) or else manually pin your compat_resource cookbook version to the same version as the gem you are using to remove this warning"
end

# we want to not pollute the libpath with our files until after we've done the version check
require_relative '../files/lib/chef_upstream_version'

# on any chef client later than the one we were based off of we just turn into a no-op
if Gem::Requirement.new("< #{ChefCompat::CHEF_UPSTREAM_VERSION}").satisfied_by?(Gem::Version.new(Chef::VERSION))
  Chef::Log.debug "loading compat_resource based on chef-version #{ChefCompat::CHEF_UPSTREAM_VERSION} over chef version #{Gem::Version.new(Chef::VERSION)}"
  $LOAD_PATH.unshift(File.expand_path("../files/lib", File.dirname(__FILE__)))
  require 'compat_resource'
else
  Chef::Log.debug "NOT LOADING compat_resource based on chef-version #{ChefCompat::CHEF_UPSTREAM_VERSION} over chef version #{Gem::Version.new(Chef::VERSION)}"
end


text:
package com.intellij.openapi.project;

import org.jetbrains.annotations.NotNull;

public abstract class ProjectReloadState {
  public static ProjectReloadState getInstance(@NotNull Project project) {
    return project.getService(ProjectReloadState.class);
  }

  public abstract boolean isAfterAutomaticReload();

  public abstract void onBeforeAutomaticProjectReload();
}


text:
'use strict';

require('../../common/js/jump-message');
require('../../common/js/captcha');
require('./upload');
require('./manager-box');
require('./role-check-box');
require('./global');


text:
package kafka.log

import java.util.Properties

import kafka.server.KafkaConfig
import kafka.server.KafkaServer
import kafka.utils.TestUtils
import org.apache.kafka.common.config.ConfigException
import org.junit.{Assert, Test}
import org.junit.Assert._
import org.scalatest.Assertions._

class LogConfigTest {

  @Test
  def testKafkaConfigToProps() {
    val millisInHour = 60L * 60L * 1000L
    val kafkaProps = TestUtils.createBrokerConfig(nodeId = 0, zkConnect = "")
    kafkaProps.put(KafkaConfig.LogRollTimeHoursProp, "2")
    kafkaProps.put(KafkaConfig.LogRollTimeJitterHoursProp, "2")
    kafkaProps.put(KafkaConfig.LogRetentionTimeHoursProp, "2")

    val kafkaConfig = KafkaConfig.fromProps(kafkaProps)
    val logProps = KafkaServer.copyKafkaConfigToLog(kafkaConfig)
    assertEquals(2 * millisInHour, logProps.get(LogConfig.SegmentMsProp))
    assertEquals(2 * millisInHour, logProps.get(LogConfig.SegmentJitterMsProp))
    assertEquals(2 * millisInHour, logProps.get(LogConfig.RetentionMsProp))
  }

  @Test
  def testFromPropsEmpty() {
    val p = new Properties()
    val config = LogConfig(p)
    Assert.assertEquals(LogConfig(), config)
  }

  @Test
  def testFromPropsInvalid() {
    LogConfig.configNames().foreach((name) => {
      name match {
        case LogConfig.UncleanLeaderElectionEnableProp  => return
        case LogConfig.RetentionBytesProp => assertPropertyInvalid(name, "not_a_number")
        case LogConfig.RetentionMsProp => assertPropertyInvalid(name, "not_a_number" )
        case LogConfig.CleanupPolicyProp => assertPropertyInvalid(name, "true", "foobar");
        case LogConfig.MinCleanableDirtyRatioProp => assertPropertyInvalid(name, "not_a_number", "-0.1", "1.2")
        case LogConfig.MinInSyncReplicasProp => assertPropertyInvalid(name, "not_a_number", "0", "-1")
        case positiveIntProperty => assertPropertyInvalid(name, "not_a_number", "-1")
      }
    })
   }

  private def assertPropertyInvalid(name: String, values: AnyRef*) {
    values.foreach((value) => {
      val props = new Properties
      props.setProperty(name, value.toString)
      intercept[ConfigException] {
        LogConfig(props)
      }
    })
  }

  private def randFrom[T](choices: T*): T = {
    import scala.util.Random
    choices(Random.nextInt(choices.size))
  }
}


text:
package v1beta3

import (
	"net/url"
	"time"

	bootstraptokenv1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/bootstraptoken/v1"
	"k8s.io/kubernetes/cmd/kubeadm/app/constants"

	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
)

const (
	// DefaultServiceDNSDomain defines default cluster-internal domain name for Services and Pods
	DefaultServiceDNSDomain = "cluster.local"
	// DefaultServicesSubnet defines default service subnet range
	DefaultServicesSubnet = "10.96.0.0/12"
	// DefaultClusterDNSIP defines default DNS IP
	DefaultClusterDNSIP = "10.96.0.10"
	// DefaultKubernetesVersion defines default kubernetes version
	DefaultKubernetesVersion = "stable-1"
	// DefaultAPIBindPort defines default API port
	DefaultAPIBindPort = 6443
	// DefaultCertificatesDir defines default certificate directory
	DefaultCertificatesDir = "/etc/kubernetes/pki"
	// DefaultImageRepository defines default image registry
	DefaultImageRepository = "k8s.gcr.io"
	// DefaultManifestsDir defines default manifests directory
	DefaultManifestsDir = "/etc/kubernetes/manifests"
	// DefaultClusterName defines the default cluster name
	DefaultClusterName = "kubernetes"

	// DefaultEtcdDataDir defines default location of etcd where static pods will save data to
	DefaultEtcdDataDir = "/var/lib/etcd"
	// DefaultProxyBindAddressv4 is the default bind address when the advertise address is v4
	DefaultProxyBindAddressv4 = "0.0.0.0"
	// DefaultProxyBindAddressv6 is the default bind address when the advertise address is v6
	DefaultProxyBindAddressv6 = "::"
	// DefaultDiscoveryTimeout specifies the default discovery timeout for kubeadm (used unless one is specified in the JoinConfiguration)
	DefaultDiscoveryTimeout = 5 * time.Minute

	// DefaultImagePullPolicy is the default image pull policy in kubeadm
	DefaultImagePullPolicy = corev1.PullIfNotPresent
)

var (
	// DefaultAuditPolicyLogMaxAge is defined as a var so its address can be taken
	// It is the number of days to store audit logs
	DefaultAuditPolicyLogMaxAge = int32(2)
)

func addDefaultingFuncs(scheme *runtime.Scheme) error {
	return RegisterDefaults(scheme)
}

// SetDefaults_InitConfiguration assigns default values for the InitConfiguration
func SetDefaults_InitConfiguration(obj *InitConfiguration) {
	SetDefaults_BootstrapTokens(obj)
	SetDefaults_APIEndpoint(&obj.LocalAPIEndpoint)
	SetDefaults_NodeRegistration(&obj.NodeRegistration)
}

// SetDefaults_ClusterConfiguration assigns default values for the ClusterConfiguration
func SetDefaults_ClusterConfiguration(obj *ClusterConfiguration) {
	if obj.KubernetesVersion == "" {
		obj.KubernetesVersion = DefaultKubernetesVersion
	}

	if obj.Networking.ServiceSubnet == "" {
		obj.Networking.ServiceSubnet = DefaultServicesSubnet
	}

	if obj.Networking.DNSDomain == "" {
		obj.Networking.DNSDomain = DefaultServiceDNSDomain
	}

	if obj.CertificatesDir == "" {
		obj.CertificatesDir = DefaultCertificatesDir
	}

	if obj.ImageRepository == "" {
		obj.ImageRepository = DefaultImageRepository
	}

	if obj.ClusterName == "" {
		obj.ClusterName = DefaultClusterName
	}

	SetDefaults_Etcd(obj)
	SetDefaults_APIServer(&obj.APIServer)
}

// SetDefaults_APIServer assigns default values for the API Server
func SetDefaults_APIServer(obj *APIServer) {
	if obj.TimeoutForControlPlane == nil {
		obj.TimeoutForControlPlane = &metav1.Duration{
			Duration: constants.DefaultControlPlaneTimeout,
		}
	}
}

// SetDefaults_Etcd assigns default values for the proxy
func SetDefaults_Etcd(obj *ClusterConfiguration) {
	if obj.Etcd.External == nil && obj.Etcd.Local == nil {
		obj.Etcd.Local = &LocalEtcd{}
	}
	if obj.Etcd.Local != nil {
		if obj.Etcd.Local.DataDir == "" {
			obj.Etcd.Local.DataDir = DefaultEtcdDataDir
		}
	}
}

// SetDefaults_JoinConfiguration assigns default values to a regular node
func SetDefaults_JoinConfiguration(obj *JoinConfiguration) {
	if obj.CACertPath == "" {
		obj.CACertPath = DefaultCACertPath
	}

	SetDefaults_JoinControlPlane(obj.ControlPlane)
	SetDefaults_Discovery(&obj.Discovery)
	SetDefaults_NodeRegistration(&obj.NodeRegistration)
}

func SetDefaults_JoinControlPlane(obj *JoinControlPlane) {
	if obj != nil {
		SetDefaults_APIEndpoint(&obj.LocalAPIEndpoint)
	}
}

// SetDefaults_Discovery assigns default values for the discovery process
func SetDefaults_Discovery(obj *Discovery) {
	if len(obj.TLSBootstrapToken) == 0 && obj.BootstrapToken != nil {
		obj.TLSBootstrapToken = obj.BootstrapToken.Token
	}

	if obj.Timeout == nil {
		obj.Timeout = &metav1.Duration{
			Duration: DefaultDiscoveryTimeout,
		}
	}

	if obj.File != nil {
		SetDefaults_FileDiscovery(obj.File)
	}
}

// SetDefaults_FileDiscovery assigns default values for file based discovery
func SetDefaults_FileDiscovery(obj *FileDiscovery) {
	// Make sure file URL becomes path
	if len(obj.KubeConfigPath) != 0 {
		u, err := url.Parse(obj.KubeConfigPath)
		if err == nil && u.Scheme == "file" {
			obj.KubeConfigPath = u.Path
		}
	}
}

// SetDefaults_BootstrapTokens sets the defaults for the .BootstrapTokens field
// If the slice is empty, it's defaulted with one token. Otherwise it just loops
// through the slice and sets the defaults for the omitempty fields that are TTL,
// Usages and Groups. Token is NOT defaulted with a random one in the API defaulting
// layer, but set to a random value later at runtime if not set before.
func SetDefaults_BootstrapTokens(obj *InitConfiguration) {

	if obj.BootstrapTokens == nil || len(obj.BootstrapTokens) == 0 {
		obj.BootstrapTokens = []bootstraptokenv1.BootstrapToken{{}}
	}

	for i := range obj.BootstrapTokens {
		SetDefaults_BootstrapToken(&obj.BootstrapTokens[i])
	}
}

// SetDefaults_BootstrapToken sets the defaults for an individual Bootstrap Token
func SetDefaults_BootstrapToken(bt *bootstraptokenv1.BootstrapToken) {
	if bt.TTL == nil {
		bt.TTL = &metav1.Duration{
			Duration: constants.DefaultTokenDuration,
		}
	}
	if len(bt.Usages) == 0 {
		bt.Usages = constants.DefaultTokenUsages
	}

	if len(bt.Groups) == 0 {
		bt.Groups = constants.DefaultTokenGroups
	}
}

// SetDefaults_APIEndpoint sets the defaults for the API server instance deployed on a node.
func SetDefaults_APIEndpoint(obj *APIEndpoint) {
	if obj.BindPort == 0 {
		obj.BindPort = DefaultAPIBindPort
	}
}

// SetDefaults_NodeRegistration sets the defaults for the NodeRegistrationOptions object
func SetDefaults_NodeRegistration(obj *NodeRegistrationOptions) {
	if len(obj.ImagePullPolicy) == 0 {
		obj.ImagePullPolicy = DefaultImagePullPolicy
	}
}


text:
package pku.miao.zhihudaily.component;

import android.content.Context;
import android.support.design.widget.Snackbar;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.squareup.okhttp.OkHttpClient;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
import retrofit.RxJavaCallAdapterFactory;

public class RetrofitSingleton {

    private static ApiInterface apiService = null;

    private static Retrofit retrofit = null;

    private static OkHttpClient okHttpClient = null;

    private static final String TAG = RetrofitSingleton.class.getSimpleName();

    public static Context context;

    /**
     * 初始化
     */

    public static void init(final Context context) {

        Executor executor = Executors.newCachedThreadPool();

        Gson gson = new GsonBuilder()
                .excludeFieldsWithoutExposeAnnotation()
                .create();

        retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson))
                                         .baseUrl(ApiInterface.HOST)
                                         .callbackExecutor(executor)
                                         .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                                         .build();
        okHttpClient = retrofit.client();
        retrofit.client().interceptors().add(new LoggingInterceptor());
        retrofit.client().setConnectTimeout(30, TimeUnit.SECONDS);
        apiService = retrofit.create(ApiInterface.class);
    }

    public static ApiInterface getApiService(Context context) {
        if (apiService != null) return apiService;
        init(context);
        return getApiService(context);
    }

    public static Retrofit getRetrofit(Context context) {
        if (retrofit != null) return retrofit;
        init(context);
        return getRetrofit(context);
    }

    public static OkHttpClient getOkHttpClient(Context context) {
        if (okHttpClient != null) return okHttpClient;
        init(context);
        return getOkHttpClient(context);
    }

    public static void disposeFailureInfo(Throwable t, Context context, View view) {
        if (t.toString().contains("GaiException") || t.toString().contains("SocketTimeoutException") ||
                t.toString().contains("UnknownHostException")) {
            Snackbar.make(view, "网络不好,~( ´•︵•` )~", Snackbar.LENGTH_LONG).show();
        }
        else {
            Toast.makeText(context, t.getMessage(), Toast.LENGTH_LONG).show();
        }
        Log.w(TAG, t.toString());
    }
}


text:
<?php

namespace Doctrine\ORM\Proxy;

use Doctrine\Common\Proxy\Autoloader as BaseAutoloader;

/**
 * @deprecated use \Doctrine\Common\Proxy\Autoloader instead
 */
class Autoloader extends BaseAutoloader
{
}


text:
package org.apache.geode.admin.jmx.internal;

import javax.management.Notification;
import javax.management.ObjectName;
import javax.management.modelmbean.ModelMBean;
import javax.naming.OperationNotSupportedException;

import org.apache.commons.modeler.ManagedBean;
import org.apache.logging.log4j.Logger;

import org.apache.geode.CancelException;
import org.apache.geode.SystemFailure;
import org.apache.geode.admin.AdminException;
import org.apache.geode.admin.Statistic;
import org.apache.geode.internal.admin.StatResource;
import org.apache.geode.logging.internal.log4j.api.LogService;

/**
 * Provides MBean support for the monitoring of a statistic resource.
 *
 * @since GemFire 3.5
 *
 */
@Deprecated
public class StatisticResourceJmxImpl extends org.apache.geode.admin.internal.StatisticResourceImpl
    implements javax.management.NotificationListener,
    org.apache.geode.admin.jmx.internal.ManagedResource {

  private static final Logger logger = LogService.getLogger();

  /**
   * Interval in seconds between refreshes. Values less than one results in no refreshing .
   */
  private int refreshInterval = 0;

  /** The JMX object name of this managed resource */
  private ObjectName objectName;

  /** A flag to indicate if time is inited. MBeanUtil lookup is costly */
  private boolean timerInited = false;

  // -------------------------------------------------------------------------
  // Constructor(s)
  // -------------------------------------------------------------------------

  /**
   * Constructor for the StatisticResource object
   *
   * @param statResource the admin StatResource to manage/monitor
   * @param member the SystemMember owning this resource
   * @exception org.apache.geode.admin.AdminException if unable to create this StatisticResource for
   *            administration
   */
  public StatisticResourceJmxImpl(StatResource statResource, SystemMemberJmx member)
      throws org.apache.geode.admin.AdminException {
    super(statResource, member);
    initializeMBean();
  }

  /** Create and register the MBean to manage this resource */
  private void initializeMBean() throws org.apache.geode.admin.AdminException {
    mbeanName = "GemFire.Statistic:" + "source="
        + MBeanUtils.makeCompliantMBeanNameProperty(member.getId()) + ",type="
        + MBeanUtils.makeCompliantMBeanNameProperty(getType()) + ",name="
        + MBeanUtils.makeCompliantMBeanNameProperty(getName()) + ",uid="
        + getUniqueId();

    objectName =
        MBeanUtils.createMBean(this, addDynamicAttributes(MBeanUtils.lookupManagedBean(this)));

    // Refresh Interval
    AdminDistributedSystemJmxImpl sysJmx =
        (AdminDistributedSystemJmxImpl) member.getDistributedSystem();
    if (sysJmx.getRefreshInterval() > 0) {
      refreshInterval = sysJmx.getRefreshInterval();
    }
  }

  // -------------------------------------------------------------------------
  // MBean attributes - accessors/mutators
  // -------------------------------------------------------------------------

  /**
   * Gets the interval in seconds between statistics refreshes
   *
   * @return the current refresh interval in seconds
   */
  public int getRefreshInterval() {
    return refreshInterval;
  }

  /**
   * Sets interval in seconds between statistic refreshes; zero or less turns off auto refreshing.
   * Manual refreshing has no effect on when the next scheduled refresh will occur.
   *
   * @param refreshInterval the new refresh interval in seconds
   */
  private void _setRefreshInterval(int refreshInterval) {
    boolean isRegistered = MBeanUtils.isRefreshNotificationRegistered(this,
        RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS);

    if (isRegistered && (getRefreshInterval() == refreshInterval)) {
      return;
    }

    try {
      MBeanUtils.registerRefreshNotification(this, // NotificationListener
          getMBeanName(), // User Data as MBean Name
          RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS, refreshInterval); // int

      this.refreshInterval = refreshInterval;
      timerInited = true;
    } catch (RuntimeException e) {
      logger.warn(e.getMessage(), e); // dead in water, print, and then ignore
      this.refreshInterval = 0; // zero out to avoid more exceptions
    } catch (VirtualMachineError err) {
      SystemFailure.initiateFailure(err);
      // If this ever returns, rethrow the error. We're poisoned
      // now, so don't let this thread continue.
      throw err;
    } catch (Error e) {
      // Whenever you catch Error or Throwable, you must also
      // catch VirtualMachineError (see above). However, there is
      // _still_ a possibility that you are dealing with a cascading
      // error condition, so you also need to check to see if the JVM
      // is still usable:
      SystemFailure.checkFailure();
      logger.error(e.getMessage(), e); // dead in water, print, and then ignore
      this.refreshInterval = 0; // zero out to avoid more exceptions
    }
  }

  /**
   * RefreshInterval is now set only through the AdminDistributedSystem property refreshInterval.
   * Attempt to set refreshInterval on StatisticResourceJmx MBean would result in an
   * OperationNotSupportedException Auto-refresh is enabled on demand when a call to getStatistics
   * is made
   *
   * @param refreshInterval the new refresh interval in seconds
   * @deprecated since 6.0 use DistributedSystemConfig.refreshInterval instead
   */
  @Deprecated
  public void setRefreshInterval(int refreshInterval) throws OperationNotSupportedException {
    throw new OperationNotSupportedException(
        "RefreshInterval can not be set directly. Use DistributedSystemConfig.refreshInterval.");
  }

  // -------------------------------------------------------------------------
  // JMX Notification listener
  // -------------------------------------------------------------------------

  /**
   * Handles notification to refresh. Reacts by refreshing the values of this SystemMember's
   * ConfigurationParamaters. Any other notification is ignored. Given notification is handled only
   * if there is any JMX client connected to the system.
   *

   * TODO: investigate use of NotificationFilter instead of explicit check...
   *
   * @param notification the JMX notification being received
   * @param hb handback object is unused
   */
  @Override
  public void handleNotification(Notification notification, Object hb) {
    AdminDistributedSystemJmxImpl adminDSJmx =
        (AdminDistributedSystemJmxImpl) member.getDistributedSystem();

    String typeStatResourceStats = RefreshNotificationType.STATISTIC_RESOURCE_STATISTICS.getType();

    if (typeStatResourceStats.equals(notification.getType())
        && getMBeanName().equals(notification.getUserData())
        && !adminDSJmx.isRmiClientCountZero()) {
      try {
        refresh();

      } catch (org.apache.geode.admin.AdminException e) {
        logger.warn(e.getMessage(), e);
      } catch (org.apache.geode.admin.OperationCancelledException e) {
        // underlying resource is no longer reachable by remote admin
        logger.warn(e.getMessage(), e);
        _setRefreshInterval(0);
      } catch (CancelException e) {
        // shutting down - okay to ignore
      } catch (java.lang.RuntimeException e) {
        logger.debug(e.getMessage(), e); // dead in water, print, and then ignore
        _setRefreshInterval(0); // zero out to avoid more exceptions
      } catch (VirtualMachineError err) {
        SystemFailure.initiateFailure(err);
        // If this ever returns, rethrow the error. We're poisoned
        // now, so don't let this thread continue.
        throw err;
      } catch (java.lang.Error e) {
        // Whenever you catch Error or Throwable, you must also
        // catch VirtualMachineError (see above). However, there is
        // _still_ a possibility that you are dealing with a cascading
        // error condition, so you also need to check to see if the JVM
        // is still usable:
        SystemFailure.checkFailure();
        logger.error(e.getMessage(), e); // dead in water, print, and then ignore
        refreshInterval = 0; // zero out to avoid more exceptions
      }
    }
  }

  // -------------------------------------------------------------------------
  // Create MBean attributes for each Statistic
  // -------------------------------------------------------------------------

  /**
   * Add MBean attribute definitions for each Statistic.
   *
   * @param managed the mbean definition to add attributes to
   * @return a new instance of ManagedBean copied from managed but with the new
   *         attributes added
   */
  ManagedBean addDynamicAttributes(ManagedBean managed)
      throws org.apache.geode.admin.AdminException {
    if (managed == null) {
      throw new IllegalArgumentException(
          "ManagedBean is null");
    }

    refresh(); // to get the stats...

    // need to create a new instance of ManagedBean to clean the "slate"...
    ManagedBean newManagedBean = new DynamicManagedBean(managed);
    for (final Statistic statistic : statistics) {
      StatisticAttributeInfo attrInfo = new StatisticAttributeInfo();

      attrInfo.setName(statistic.getName());
      attrInfo.setDisplayName(statistic.getName());
      attrInfo.setDescription(statistic.getDescription());
      attrInfo.setType("java.lang.Number");

      attrInfo.setIs(false);
      attrInfo.setReadable(true);
      attrInfo.setWriteable(false);

      attrInfo.setStat(statistic);

      newManagedBean.addAttribute(attrInfo);
    }
    return newManagedBean;
  }

  @Override
  public Statistic[] getStatistics() {
    if (!timerInited) {
      // 1st call to getStatistics would trigger
      // the auto-refresh if an interval is set
      if (refreshInterval > 0) {
        _setRefreshInterval(refreshInterval);
      }
    }

    if (statistics == null) {
      try {
        refresh();
      } catch (AdminException e) {
        statistics = new Statistic[0];
      }
    }

    return statistics;
  }

  // -------------------------------------------------------------------------
  // ManagedResource implementation
  // -------------------------------------------------------------------------

  /** The name of the MBean that will manage this resource */
  private String mbeanName;

  /** The ModelMBean that is configured to manage this resource */
  private ModelMBean modelMBean;

  @Override
  public String getMBeanName() {
    return mbeanName;
  }

  @Override
  public ModelMBean getModelMBean() {
    return modelMBean;
  }

  @Override
  public void setModelMBean(ModelMBean modelMBean) {
    this.modelMBean = modelMBean;
  }

  @Override
  public ObjectName getObjectName() {
    return objectName;
  }

  @Override
  public ManagedResourceType getManagedResourceType() {
    return ManagedResourceType.STATISTIC_RESOURCE;
  }

  @Override
  public void cleanupResource() {
    modelMBean = null;
    member = null;
    statistics = null;
    statResource = null;
  }

  /**
   * Checks equality of the given object with this based on the type (Class) and the
   * MBean Name returned by getMBeanName() methods.
   *
   * @param obj object to check equality with
   * @return true if the given object is if the same type and its MBean Name is same as
   *         this object's MBean Name, false otherwise
   */
  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof StatisticResourceJmxImpl)) {
      return false;
    }

    StatisticResourceJmxImpl other = (StatisticResourceJmxImpl) obj;

    return getMBeanName().equals(other.getMBeanName());
  }

  /**
   * Returns hash code for this object which is based on the MBean Name generated.
   *
   * @return hash code for this object
   */
  @Override
  public int hashCode() {
    return getMBeanName().hashCode();
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright [2016] [zhi]
  ~
  ~ 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.
  ~
  -->

<resources>
    <item name="nav" type="id"/>
    <item name="drawer" type="id"/>
    <item name="content" type="id"/>
    <item name="appbar" type="id"/>
    <item name="toolbar" type="id"/>
    <item name="fab" type="id"/>
    <item name="pager" type="id"/>
    <item name="container" type="id"/>
    <item name="list" type="id"/>
    <item name="tab" type="id"/>
    <item name="email" type="id"/>
    <item name="password" type="id"/>
    <item name="display_name" type="id"/>
    <item name="avatar" type="id"/>
    <item name="title" type="id"/>
</resources>


text:
package futureevent

import (
	"time"
)

// Event represents a cancelable event that occurs sometime in future.
type Event interface {
	// Chan returns a channel which this Event notifies of the occurrence.
	// The time.Time value represents the time of the occurrence.
	//
	// Remember that the event may be canceled, in which case the channel
	// gets closed and empty. The listeners can detect the cancelation by
	// checking the boolean result of a receive operation.
	Chan() <-chan time.Time

	// Cancel cancels the event.
	//
	// Cancel clears and closes the event notifier channel, thus must not be
	// called more than once.
	Cancel()
}

// Factory creates a new Event raised when the provided time t comes.
type Factory func(t time.Time) Event

// DefaultFactory uses the real clock.
var DefaultFactory Factory = NewRealClockEvent


text:
from mlflow.exceptions import MlflowException
from mlflow.protos import databricks_pb2
from mlflow.tracking.client import MlflowClient
from mlflow.tracking.default_experiment.abstract_context import DefaultExperimentProvider
from mlflow.utils import databricks_utils
from mlflow.utils.mlflow_tags import (
    MLFLOW_EXPERIMENT_SOURCE_TYPE,
    MLFLOW_EXPERIMENT_SOURCE_ID,
)

class DatabricksNotebookExperimentProvider(DefaultExperimentProvider):
    def in_context(self):
        return databricks_utils.is_in_databricks_notebook()

    def get_experiment_id(self):
        return databricks_utils.get_notebook_id()

class DatabricksRepoNotebookExperimentProvider(DefaultExperimentProvider):
    _resolved_repo_notebook_experiment_id = None

    def in_context(self):
        return databricks_utils.is_in_databricks_repo_notebook()

    def get_experiment_id(self):
        if DatabricksRepoNotebookExperimentProvider._resolved_repo_notebook_experiment_id:
            return DatabricksRepoNotebookExperimentProvider._resolved_repo_notebook_experiment_id

        source_notebook_id = databricks_utils.get_notebook_id()
        source_notebook_name = databricks_utils.get_notebook_path()
        tags = {
            MLFLOW_EXPERIMENT_SOURCE_TYPE: "REPO_NOTEBOOK",
            MLFLOW_EXPERIMENT_SOURCE_ID: source_notebook_id,
        }

        # With the presence of the above tags, the following is a get or create in which it will
        # return the corresponding experiment if one exists for the repo notebook.
        # If no corresponding experiment exist, it will create a new one and return
        # the newly created experiment ID.
        try:
            experiment_id = MlflowClient().create_experiment(source_notebook_name, None, tags)
        except MlflowException as e:
            if e.error_code == databricks_pb2.ErrorCode.Name(
                databricks_pb2.INVALID_PARAMETER_VALUE
            ):
                # If repo notebook experiment creation isn't enabled, fall back to
                # using the notebook ID
                experiment_id = source_notebook_id
            else:
                raise e

        DatabricksRepoNotebookExperimentProvider._resolved_repo_notebook_experiment_id = (
            experiment_id
        )

        return experiment_id


text: module.exports = require('./script_sanitize');


text:
简单封装了下RecyclerViewAdapter,避免每次都要写一堆重复代码

---
1. 设置空布局 setEmptyView();
2. 设置点击监听 setOnItemClickListener();

---

#### 用法
    public class MovieQuickAdapter extends BaseQuickAdapter<MovieEntity.SubjectsBean> {
    private Context mContext;

    public MovieQuickAdapter(Context context, List<MovieEntity.SubjectsBean> data) {
        super(context, R.layout.rcv_item, data);
        mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder holder, MovieEntity.SubjectsBean item) {
        //set TextView
        holder.setText(R.id.title, "片名:" + item.getTitle())
                .setText(R.id.score, "评分:" + item.getRating().getAverage())
                .setText(R.id.director, "导演:" + item.getDirectors().get(0).getName())
                .setText(R.id.actor, "主演:" + item.getCasts().get(0).getName())
                .setText(R.id.type, "类型:" + item.getGenres().toString())
                .setText(R.id.year, "年份:" + item.getYear());
        //setImageView
        Glide.with(mContext).load(item.getImages().getMedium()).into((ImageView) holder.getView(R.id.iv));
    }
    }
---
![](https://github.com/piscessu/BaseQuickAdapter/blob/master/screenshots/1.png)
![](https://github.com/piscessu/BaseQuickAdapter/blob/master/screenshots/2.png)
![](https://github.com/piscessu/BaseQuickAdapter/blob/master/screenshots/3.png)
---

#### 2017-06-14更新
1. 加入分页加载功能

---
**持续改进中。。。**


text:
A pure JS library for accepting mobile confirmations. This is a better, more updated version of [GaletskyIvan's older module](https://github.com/GaletskyIvan/steamcommunity-mobile-confirmations).

**Currently a work-in-progress.**

## Functionality
This will aim to:

* Fetch mobile confirmations
* Accept / Deny confirmations
* Accept / Deny multi-confirmations
* ...have good documentation

## Installation
In the near future, you'll be able to do this:
`npm install steam-mobile-confirmations`

## Usage
Instantiate a SteamMobileConfirmations object, with the required defaults (keep reading for more detail):
```js
var SteamMobileConfirmations = require('steam-mobile-confirmations');
var steamConfirmations = new SteamMobileConfirmations({
  steamId: steamId64,
  identitySecret: identitySecret,
  webCookie: webCookie
});
```

Obtain session information with [node-steam](https://github.com/seishun/node-steam) and its plugin [steam-weblogon](https://github.com/Alex7Kom/node-steam-weblogon)

## Examples
Coming soon.

## Methods
The `options` param of all methods is an object. All callbacks are supplied with `Error` as the first argument, or `null` if no errors occurred.

## constructor(options)
This sets up all final values, and should only be called **once**.

Options:
* `steamId` is a valid SteamID64
* `identitySecret` is the secret key used for generating confirmation codes. (_not_ the one used for generating login codes)
* `webCookie` is the cookies we need for interacting with steam. Fetch them from the modules mentioned above.
* `deviceId` (optional) is the device id used for all calls. Starts with `android:` - one will be generated if you do not provide one.
* `steamOffset` (optional) is the time offset between you and steam. This is **highly recommended** to be provided, as _not_ providing it can cause avoidable errors. You can find this by running `getTimeOffset()` from the [node-steam-totp](https://github.com/DoctorMcKay/node-steam-totp) module. (Use the returned `offset` value)
* `waitTime` (optional) is how long (in milliseconds) the module will wait if it encounters an error before trying again. (Defaults to `10000`)

### updateCookies(webCookie)
This method updates the current session / cookies currently in use. Run this after the error `needsNewSession` is emitted.

`webCookie` can be obtained using [node-steam](https://github.com/seishun/node-steam) and its plugin [steam-weblogon](https://github.com/Alex7Kom/node-steam-weblogon)

### fetchConfirmations(callback)
Returns all currently outstanding (active) confirmations.

The second argument to `callback` will be an array of [Confirmation](https://github.com/luop90/node-steam-mobile-confirmations/wiki/CConfirmation) objects.

### acceptConfirmation(confirmation, callback)
This accepts a confirmation (or array of confirmations) from the fetchConfirmations() call. If an error occurs while accepting, it tries once more before erroring.

The second argument to `callback` will be a success boolean. (`true` for confirmed, `false` for error.)

### getConfirmationTradeId(confirmation, callback)
**You will likely not need to use this**, since the trade offer ID is already included in the [Confirmation](https://github.com/luop90/node-steam-mobile-confirmations/wiki/CConfirmation) object.

This will only fetch the confirmation information again, and then return the trade offer ID.

The second argument to `callback` will be the tradeId, fetched from Valve.

## Events
### 'needsNewSession'
This is called when Steam returns a specific error, and your Steam Community session needs to be re-connected. Re-run [steam-weblogon](https://github.com/Alex7Kom/node-steam-weblogon), and then call `updateCookies()` with the new cookies.

No calls will be made to Steam until you have called `updateCookies()`

## License
MIT


text:
/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.stub;

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.component.vm.VmComponentConfigurer;

/**
 * Generated by camel build tools - do NOT edit this file!
 */
@SuppressWarnings("unchecked")
public class StubComponentConfigurer extends VmComponentConfigurer implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private static final Map<String, Object> ALL_OPTIONS;
    static {
        Map<String, Object> map = new CaseInsensitiveMap();
        map.put("bridgeErrorHandler", boolean.class);
        map.put("concurrentConsumers", int.class);
        map.put("defaultBlockWhenFull", boolean.class);
        map.put("defaultDiscardWhenFull", boolean.class);
        map.put("defaultOfferTimeout", long.class);
        map.put("lazyStartProducer", boolean.class);
        map.put("basicPropertyBinding", boolean.class);
        map.put("defaultQueueFactory", org.apache.camel.component.seda.BlockingQueueFactory.class);
        map.put("queueSize", int.class);
        ALL_OPTIONS = map;
        ConfigurerStrategy.addConfigurerClearer(StubComponentConfigurer::clearConfigurers);
    }

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>DB_TXN->commit()</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
    <link rel="up" href="txn.html" title="Chapter 12.  The DB_TXN Handle" />
    <link rel="prev" href="txncheckpoint.html" title="DB_ENV->txn_checkpoint()" />
    <link rel="next" href="txndiscard.html" title="DB_TXN->discard()" />

          DB_TXN->commit()

          Prev
          Chapter 12.
                The DB_TXN Handle

           Next

DB_TXN->commit()

#include <db.h>

int
DB_TXN->commit(DB_TXN *tid, u_int32_t flags);

        The DB_TXN->commit() method ends the transaction.

         In the case of nested transactions, if the transaction is a parent
         transaction, committing the parent transaction causes all unresolved
         children of the parent to be committed.  In the case of nested
         transactions, if the transaction is a child transaction, its locks are
         not released, but are acquired by its parent.  Although the commit of
         the child transaction will succeed, the actual resolution of the child
         transaction is postponed until the parent transaction is committed or
         aborted; that is, if its parent transaction commits, it will be
         committed; and if its parent transaction aborts, it will be aborted.

         All cursors opened within the transaction must be closed before the
         transaction is committed.

         After DB_TXN->commit() has been called, regardless of its return, the
         DB_TXN  handle may not be
         accessed again.  If DB_TXN->commit() encounters an error, the
         transaction and all child transactions of the transaction are aborted.

         The DB_TXN->commit()

                  method returns a non-zero error value on failure and 0 on success.

Parameters

flags

                          The flags parameter must be set to 0
                          or one of the following values:

                  DB_TXN_NOSYNC

                 Do not synchronously flush the log.  This means the transaction will
                 exhibit the ACI (atomicity, consistency, and isolation) properties,
                 but not D (durability); that is, database integrity will be
                 maintained, but it is possible that this transaction may be undone
                 during recovery.

                 This behavior may be set for a Berkeley DB environment using the
                 DB_ENV->set_flags()
                 method or for a single transaction using the
                 DB_ENV->txn_begin()  method.
                 Any value specified to this method overrides both of those settings.

                  DB_TXN_SYNC

                 Synchronously flush the log.  This means the transaction will exhibit
                 all of the ACID (atomicity, consistency, isolation, and durability)
                 properties.

                 This behavior is the default for Berkeley DB environments unless the
                 DB_TXN_NOSYNC
                 flag was specified to the DB_ENV->set_flags()  method.
                  This behavior may also be set for a single transaction using the
                 DB_ENV->txn_begin()
                 method.  Any value specified to this method overrides both of those
                 settings.

Class

                 DB_ENV, DB_TXN

See Also

                     Transaction Subsystem and Related Methods

          Prev

            Up

           Next

          DB_ENV->txn_checkpoint()

            Home

           DB_TXN->discard()


text:
package com.openvraas.services.healthchecker;

import com.openvraas.services.cdi.WeldContext;

public class Starter {

    public static void main(String[] args) {

        WeldContext.INSTANCE.getBean(HealthChecker.class);

    }

}


text:
/*  This file is ALSO:
 *  Copyright 2001-2004 David Abrahams.
 *  Distributed under the Boost Software License, Version 1.0.
 *  (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 */

/*
 * command.c - maintain lists of commands
 */

#include "jam.h"
#include "command.h"

#include "lists.h"
#include "rules.h"

#include <assert.h>

/*
 * cmd_new() - return a new CMD.
 */

CMD * cmd_new( RULE * rule, LIST * targets, LIST * sources, LIST * shell )
{
    CMD * cmd = (CMD *)BJAM_MALLOC( sizeof( CMD ) );
    FRAME frame[ 1 ];

    assert( cmd );
    cmd->rule = rule;
    cmd->shell = shell;
    cmd->next = 0;
    cmd->noop = 0;

    lol_init( &cmd->args );
    lol_add( &cmd->args, targets );
    lol_add( &cmd->args, sources );
    string_new( cmd->buf );

    frame_init( frame );
    frame->module = rule->module;
    lol_init( frame->args );
    lol_add( frame->args, list_copy( targets ) );
    lol_add( frame->args, list_copy( sources ) );
    function_run_actions( rule->actions->command, frame, stack_global(),
        cmd->buf );
    frame_free( frame );

    return cmd;
}

/*
 * cmd_free() - free a CMD
 */

void cmd_free( CMD * cmd )
{
    lol_free( &cmd->args );
    list_free( cmd->shell );
    string_free( cmd->buf );
    BJAM_FREE( (void *)cmd );
}

/*
 * cmd_release_targets_and_shell()
 *
 *   Makes the CMD release its hold on its targets & shell lists and forget
 * about them. Useful in case caller still has references to those lists and
 * wants to reuse them after freeing the CMD object.
 */

void cmd_release_targets_and_shell( CMD * cmd )
{
    cmd->args.list[ 0 ] = L0;  /* targets */
    cmd->shell = L0;           /* shell   */
}


text:
package org.apache.camel.reifier;

import org.apache.camel.Processor;
import org.apache.camel.Route;
import org.apache.camel.model.PipelineDefinition;
import org.apache.camel.model.ProcessorDefinition;

public class PipelineReifier extends ProcessorReifier<PipelineDefinition> {

    public PipelineReifier(Route route, ProcessorDefinition<?> definition) {
        super(route, PipelineDefinition.class.cast(definition));
    }

    @Override
    public Processor createProcessor() throws Exception {
        return this.createChildProcessor(true);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Tentam. Fl. German. 1: 559 (1788)

#### Original name
Monilia nidulans Roth

### Remarks
null