text:
package com.teamlans.lepta.service.user;

import com.teamlans.lepta.service.exceptions.LeptaServiceException;

/**
 * The Credentials class wraps user name and password entered in an instance of SignUpForm.
 */
public final class Credentials {

  private final String name;
  private final String password;

  public Credentials(String name, String password) throws LeptaServiceException {
    if (name == null || name.length() == 0) {
      throw new LeptaServiceException("Invalid username.");
    } else if (password == null || password.length() < 8) {
      throw new LeptaServiceException("Password too short, must have at least 8 characters.");
    }
    this.name = name;
    this.password = password;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof Credentials)) return false;

    Credentials that = (Credentials) o;

    return name.equals(that.name);

  }

  @Override
  public int hashCode() {
    return name.hashCode();
  }

  public String getName() {
    return name;
  }

  public String getPassword() {
    return password;
  }
}

redpajama_set_name: RedPajamaGithub


text:
set -o nounset
set -o errexit

KX_BASE="$(cd $(dirname "$0")/..; pwd -P)"
. "${KX_BASE}/shinc/common_functions.shinc"
. "${KX_BASE}/shinc/definitions.shinc"
kx_ensure_runas_kaarpux

kx_echo "Test compiling"

cd /tmp
TEST_DIR="tool_chain_2_check"
rm -rf "${TEST_DIR}"
mkdir "${TEST_DIR}"
cd "${TEST_DIR}"
echo 'main(){}' > dummy.c
cc dummy.c

kx_echo "Verifying compilation"

readelf -l a.out | grep 'Requesting program interpreter' > check1.txt || kx_error_exit "No program interpreter"
cat check1.txt
grep "Requesting program interpreter: /tools/lib" check1.txt > /dev/null || kx_error_exit "Wrong program interpreter"

echo ""
kx_echo "OK"


text:
"""Boltzmann Policy Iteration."""

from open_spiel.python import policy as policy_lib
from open_spiel.python.mfg.algorithms import mirror_descent

class BoltzmannPolicyIteration(mirror_descent.MirrorDescent):
  """Boltzmann Policy Iteration algorithm.

  In this algorithm, at each iteration, we update the policy by first computing
  the Q-function that evaluates the current policy, and then take a softmax.
  This corresponds to using Online Mirror Descent algorithm without summing
  Q-functions but simply taking the latest Q-function.
  """

  def get_projected_policy(self) -> policy_lib.Policy:
    """Returns the projected policy."""
    return mirror_descent.ProjectedPolicy(
        self._game,
        list(range(self._game.num_players())),
        self._state_value,
        coeff=self._lr)


text:
<?php

declare(strict_types=1);

namespace Tests\SensioLabs\Deptrac\DependencyEmitter;

use PHPUnit\Framework\TestCase;
use SensioLabs\Deptrac\DependencyEmitter\InheritanceDependencyEmitter;

final class InheritanceDependencyEmitterTest extends TestCase
{
    use EmitterTrait;

    public function testGetName(): void
    {
        self::assertEquals('InheritanceDependencyEmitter', (new InheritanceDependencyEmitter())->getName());
    }

    public function testApplyDependencies(): void
    {
        $deps = $this->getDeps(
            new InheritanceDependencyEmitter(),
            __DIR__.'/Fixtures/Foo.php'
        );

        self::assertCount(4, $deps);
        self::assertContains('Foo\Bar:6 on Foo\BarExtends', $deps);
        self::assertContains('Foo\Bar:6 on Foo\BarInterface1', $deps);
        self::assertContains('Foo\Bar:6 on BarInterface2', $deps);
        self::assertContains('Foo\Bar:8 on Foo\SomeTrait', $deps);
    }
}


text:
class BeFalseMatcher
  def matches?(actual)
    @actual = actual
    @actual == false
  end

  def failure_message
    ["Expected #{@actual.inspect}", "to be false"]
  end

  def negative_failure_message
    ["Expected #{@actual.inspect}", "not to be false"]
  end
end

class Object
  def be_false
    BeFalseMatcher.new
  end
end


text:
const {assign, isArray} = require('lodash');

const Relation = require('./Relation');
const MorphTo = require('./MorphTo');

class MorphMany extends Relation {
  constructor(ownerTable, toTable, inverse) {
    if (!(inverse instanceof MorphTo)) {
      throw new Error('inverse should be a MorphTo relation');
    }

    super(ownerTable);
    assign(this, {fromTable: ownerTable.fork(), toTable, inverse});
  }

  initRelation(fromModels) {
    return fromModels.map((m) => assign(m, {[this.relationName]: []}));
  }

  getRelated(...args) {
    if (args.length === 0) {
      if (this.activeModel !== null) {
        return this.getRelated([this.activeModel]);
      } else {
        return Promise.resolve([]);
      }
    }

    const [fromModels] = args;
    const {fromTable, inverse} = this;
    const toTable = this.constraints.apply(this.toTable.fork());

    const {foreignKey, typeField} = inverse;
    const typeValue = fromTable.tableName();

    return toTable.where({[typeField]: typeValue})
      .whereIn(foreignKey, fromModels.map((m) => m[fromTable.key()]))
      .all()
    ;
  }

  matchModels(fromModels=[], relatedModels=[]) {
    const {relationName, fromTable, inverse} = this;
    const {foreignKey} = inverse;

    const keyDict = relatedModels.reduce((dict, m) => {
      const key = m[foreignKey];

      if (!isArray(dict[key])) {
        return assign(dict, {[key]: [m]});
      } else {
        return assign(dict, {[key]: dict[key].concat(m)});
      }
    }, {});

    return fromModels.map((m) => assign(m, {
      [relationName]: isArray(keyDict[m[fromTable.key()]]) ?
        keyDict[m[fromTable.key()]] : []
    }));
  }

  insert(...args) {
    if (args.length === 0) {
      throw new Error('bad method call');
    }

    if (args.length === 1) {
      return this.insert(this.activeModel, ...args);
    }

    const [fromModel, values] = args;
    const {fromTable, toTable, inverse} = this;
    const {foreignKey, typeField} = inverse;

    return toTable.insert((() => {
      if (isArray(values)) {
        return values.map((v) => assign(v, {
          [foreignKey]: fromModel[fromTable.key()],
          [typeField]: fromTable.tableName()
        }));
      } else {
        return assign(values, {
          [foreignKey]: fromModel[this.key],
          [typeField]: fromTable.tableName()
        });
      }
    })());
  }

  update(...args) {
    if (args.length === 0) {
      throw new Error('bad method call');
    }

    if (args.length === 1) {
      return this.update(this.activeModel, ...args);
    }

    const [fromModel, values] = args;
    const {fromTable, toTable, inverse} = this;
    const {foreignKey, typeField} = inverse;

    return this.constraints.apply(toTable.fork())
      .where(typeField, fromTable.tableName())
      .where(foreignKey, fromModel[fromTable.key()])
      .update(assign(values, {
        [foreignKey]: fromModel[fromTable.key()],
        [typeField]: fromTable.tableName()
      }));
  }

  del(...args) {
    if (args.length === 0) {
      return this.del(this.activeModel);
    }

    const [fromModel] = args;
    const {fromTable, toTable, inverse} = this;
    const {foreignKey, typeField} = inverse;

    return this.constraints.apply(toTable.fork())
      .where(typeField, fromTable.tableName())
      .where(foreignKey, fromModel[fromTable.key()])
      .del()
    ;
  }

  join(joiner=(() => {}), label=null) {
    label = this.jointLabel(label, {});
    const {fromTable, toTable, inverse} = this;
    const {foreignKey, typeField} = inverse;

    if (this.ownerTable.scopeTrack.hasJoint(label)) {
      return this.ownerTable;
    } else {
      return this.ownerTable.joint((q) => {
        q.join(toTable.tableName(), (j) => {
          j.on(toTable.c(typeField), '=', fromTable.orm.raw('?', [fromTable.tableName()]))
           .on(toTable.c(foreignKey), '=', fromTable.keyCol());

          joiner(j);
        });
      }, label);
    }
  }

  leftJoin(joiner=(() => {}), label=null) {
    label = this.jointLabel(label, {isLeftJoin: true});
    const {fromTable, toTable, inverse} = this;
    const {foreignKey, typeField} = inverse;

    if (this.ownerTable.scopeTrackhasJoint(label)) {
      return this.ownerTable;
    } else {
      return this.ownerTable.joint((q) => {
        q.leftJoin(toTable.tableName(), (j) => {
          j.on(toTable.c(typeField), '=', fromTable.orm.raw('?', [fromTable.tableName()]))
           .on(toTable.c(foreignKey), '=', fromTable.keyCol());

          joiner(j);
        });
      }, label);
    }
  }
}

module.exports = MorphMany;


text:
<?php

namespace Apigee\Edge\Api\Monetization\Denormalizer;

use Apigee\Edge\Api\Monetization\Entity\CompanyReportDefinition;
use Apigee\Edge\Api\Monetization\NameConverter\CompanyReportDefinitionNameConverter;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;

class CompanyReportDefinitionDenormalizer extends ReportDefinitionDenormalizer
{
    /**
     * Fully qualified class name of the company report definition entity.
     *
     * @var string
     */
    protected $companyReportDefinitionClass = CompanyReportDefinition::class;

    /**
     * CompanyReportDefinitionDenormalizer constructor.
     *
     * @param \Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface|null $classMetadataFactory
     * @param \Symfony\Component\Serializer\NameConverter\NameConverterInterface|null $nameConverter
     * @param \Symfony\Component\PropertyAccess\PropertyAccessorInterface|null $propertyAccessor
     * @param \Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface|null $propertyTypeExtractor
     */
    public function __construct(?ClassMetadataFactoryInterface $classMetadataFactory = null, ?NameConverterInterface $nameConverter = null, ?PropertyAccessorInterface $propertyAccessor = null, ?PropertyTypeExtractorInterface $propertyTypeExtractor = null)
    {
        $nameConverter = $nameConverter ?? new CompanyReportDefinitionNameConverter();
        parent::__construct($classMetadataFactory, $nameConverter, $propertyAccessor, $propertyTypeExtractor);
    }

    /**
     * {@inheritdoc}
     */
    public function denormalize($data, $type, $format = null, array $context = [])
    {
        return parent::denormalize($data, $this->companyReportDefinitionClass, $format, $context);
    }

    /**
     * {@inheritdoc}
     */
    public function supportsDenormalization($data, $type, $format = null)
    {
        if (parent::supportsDenormalization($data, $type, $format)) {
            // Non-developer specific reports API also returns the developer
            // property, but it is always NULL.
            return is_object($data->developer) && $data->developer->isCompany;
        }

        return false;
    }
}


text:
package cz.cvut.fit.ortstepa.universalbookingsystem.dao.hbn;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import cz.cvut.fit.ortstepa.universalbookingsystem.dao.ReservationDao;
import cz.cvut.fit.ortstepa.universalbookingsystem.domain.Account;
import cz.cvut.fit.ortstepa.universalbookingsystem.domain.Reservation;
import cz.cvut.fit.ortstepa.universalbookingsystem.domain.Schedule;

@Repository
public class HbnReservationDao extends AbstractHbnDao<Reservation> implements
		ReservationDao {

	@Override
	public Reservation find(Account account, Schedule schedule) {
		Criteria crt = getSession().createCriteria(Reservation.class);
		crt.add(Restrictions.eq("account", account));
		crt.add(Restrictions.eq("schedule", schedule));
		List<Reservation> l = crt.list();
		if (l.isEmpty()) return null;
		return l.get(0);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!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"/>
<meta name="copyright" content="(C) Copyright 2005"/>
<meta name="DC.rights.owner" content="(C) Copyright 2005"/>
<meta name="DC.Type" content="reference"/>
<meta name="DC.Title" content="C++ Native Functions: com.ibm.streamsx.network.mac"/>
<meta name="DC.Format" content="XHTML"/>
<meta name="DC.Identifier" content="spldoc_functions"/>
<link rel="stylesheet" type="text/css" href="../../html/commonltr.css"/>
<link rel="stylesheet" type="text/css" href="../../html/spldoc.css"/>
<title>C++ Native Functions: com.ibm.streamsx.network.mac</title>

C++ Native Functions: <tt class="ph tt">com.ibm.streamsx.network.mac</tt>

IBMStreams com.ibm.streamsx.network Toolkit > com.ibm.streamsx.network 3.4.3 > com.ibm.streamsx.network.mac > C++ Native Functions

This page documents native functions that can be invoked from SPL, including the SPL interfaces that can be used to invoke each of the native functions.

Functions

<tt class="ph tt">      public rstring convertMACAddressNumericToString(list<uint8>[6] macAddressNumeric)      </tt>

This function converts an ethernet MAC address from a six-byte binary value to a string representation.

<tt class="ph tt">      public list<uint8>[6] convertMACAddressStringToNumeric(rstring macAddressString)      </tt>

This function converts an ethernet MAC address from a string representation to a six-byte binary value.


text:
import _ from 'underscore';
import Backbone from 'backbone';
import Marionette from 'backbone.marionette';
import Syphon from 'backbone.syphon';

import {Page} from '../../base/behaviors/page';
import {Loading} from '../../base/behaviors/loader';

import {EmptyView, LoaderView} from '../../base/views/loader';

import {SetList} from '../../sets/collections/sets';

import {SetListView} from './set';

export const ExerciseContainerView = Marionette.View.extend({
  className: 'col-lg-4',
  template: require('../templates/exercises/container.html'),

  regions: {
    sets: {
      selector: '.set-list-hook',
      replaceElement: true
    }
  },

  onRender: function() {
    this.showChildView('sets', new SetListView({
      collection: this.collection
    }));
  },

  templateContext: function() {
    const panelIndexes = {
      0: 'info',
      1: 'danger',
      2: 'warning',
      3: 'success',
      4: 'default'
    };
    const length = _.keys(panelIndexes).length;
    return {
      panel: () => panelIndexes[this.getOption('index') % length]
    };
  }
});

const ExerciseListView = Marionette.CollectionView.extend({
  className: 'row',
  childView: ExerciseContainerView,

  childViewOptions: function(model, index) {
    return {
      index: index,
      collection: model.getSetSummary(SetList)
    };
  }
});

export const ExerciseLayoutView = Marionette.View.extend({
  behaviors: {
    page: Page,
    loader: {
      behaviorClass: Loading,
      collectionView: ExerciseListView,
      loadView: LoaderView,
      emptyView: EmptyView
    }
  },

  className: 'col-md-12 col-lg-10 col-lg-offset-1',
  template: require('../templates/exercises/layout.html'),

  regions: {
    list: {
      selector: '.exercise-list-hook',
      replaceElement: true
    }
  },

  ui: {
    search: '.exercise_name',
    create: '.start-session'
  },

  events: {
    'input @ui.search': 'filterExercises',
    'click @ui.create': 'showCreate'
  },

  filterExercises: _.debounce(function() {
    this.model.set(Syphon.serialize(this));
    this.collection.fetch();
  }, 300),

  showCreate: function(e) {
    e.preventDefault();
    Backbone.history.navigate('workout/create', {trigger: true});
  }
});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>src/equations/Equation.js - cannon</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">

            API Docs for: 0.6.1

APIs

Classes

Modules

                            <input type="search" id="api-filter" placeholder="Type to filter APIs">

AABB

ArrayCollisionMatrix

Body

Box

Broadphase

ConeEquation

ConeTwistConstraint

Constraint

ContactEquation

ContactMaterial

ConvexPolyhedron

Cylinder

Demo

DistanceConstraint

Equation

EventTarget

FrictionEquation

GridBroadphase

GSSolver

Heightfield

HingeConstraint

JacobianElement

LockConstraint

Mat3

Material

NaiveBroadphase

Narrowphase

ObjectCollisionMatrix

Octree

OctreeNode

Particle

Plane

PointToPointConstraint

Pool

Quaternion

Ray

RaycastResult

RaycastVehicle

RigidVehicle

RotationalEquation

RotationalMotorEquation

SAPBroadphase

Shape

Solver

Sphere

SPHSystem

SplitSolver

Spring

Transform

Trimesh

TupleDictionary

Vec3

Vec3Pool

WheelInfo

World

                    Show:

                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited

                        <input type="checkbox" id="api-show-protected">
                        Protected

                        <input type="checkbox" id="api-show-private">
                        Private

                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated

File: src/equations/Equation.js

module.exports = Equation;

var JacobianElement = require('../math/JacobianElement'),
    Vec3 = require('../math/Vec3');

/**
 * Equation base class
 * @class Equation
 * @constructor
 * @author schteppe
 * @param {Body} bi
 * @param {Body} bj
 * @param {Number} minForce Minimum (read: negative max) force to be applied by the constraint.
 * @param {Number} maxForce Maximum (read: positive max) force to be applied by the constraint.
 */
function Equation(bi,bj,minForce,maxForce){
    this.id = Equation.id++;

    /**
     * @property {number} minForce
     */
    this.minForce = typeof(minForce)==="undefined" ? -1e6 : minForce;

    /**
     * @property {number} maxForce
     */
    this.maxForce = typeof(maxForce)==="undefined" ? 1e6 : maxForce;

    /**
     * @property bi
     * @type {Body}
     */
    this.bi = bi;

    /**
     * @property bj
     * @type {Body}
     */
    this.bj = bj;

    /**
     * SPOOK parameter
     * @property {number} a
     */
    this.a = 0.0;

    /**
     * SPOOK parameter
     * @property {number} b
     */
    this.b = 0.0;

    /**
     * SPOOK parameter
     * @property {number} eps
     */
    this.eps = 0.0;

    /**
     * @property {JacobianElement} jacobianElementA
     */
    this.jacobianElementA = new JacobianElement();

    /**
     * @property {JacobianElement} jacobianElementB
     */
    this.jacobianElementB = new JacobianElement();

    /**
     * @property {boolean} enabled
     * @default true
     */
    this.enabled = true;

    // Set typical spook params
    this.setSpookParams(1e7,4,1/60);
}
Equation.prototype.constructor = Equation;

Equation.id = 0;

/**
 * Recalculates a,b,eps.
 * @method setSpookParams
 */
Equation.prototype.setSpookParams = function(stiffness,relaxation,timeStep){
    var d = relaxation,
        k = stiffness,
        h = timeStep;
    this.a = 4.0 / (h * (1 + 4 * d));
    this.b = (4.0 * d) / (1 + 4 * d);
    this.eps = 4.0 / (h * h * k * (1 + 4 * d));
};

/**
 * Computes the RHS of the SPOOK equation
 * @method computeB
 * @return {Number}
 */
Equation.prototype.computeB = function(a,b,h){
    var GW = this.computeGW(),
        Gq = this.computeGq(),
        GiMf = this.computeGiMf();
    return - Gq * a - GW * b - GiMf*h;
};

/**
 * Computes G*q, where q are the generalized body coordinates
 * @method computeGq
 * @return {Number}
 */
Equation.prototype.computeGq = function(){
    var GA = this.jacobianElementA,
        GB = this.jacobianElementB,
        bi = this.bi,
        bj = this.bj,
        xi = bi.position,
        xj = bj.position;
    return GA.spatial.dot(xi) + GB.spatial.dot(xj);
};

var zero = new Vec3();

/**
 * Computes G*W, where W are the body velocities
 * @method computeGW
 * @return {Number}
 */
Equation.prototype.computeGW = function(){
    var GA = this.jacobianElementA,
        GB = this.jacobianElementB,
        bi = this.bi,
        bj = this.bj,
        vi = bi.velocity,
        vj = bj.velocity,
        wi = bi.angularVelocity || zero,
        wj = bj.angularVelocity || zero;
    return GA.multiplyVectors(vi,wi) + GB.multiplyVectors(vj,wj);
};

/**
 * Computes G*Wlambda, where W are the body velocities
 * @method computeGWlambda
 * @return {Number}
 */
Equation.prototype.computeGWlambda = function(){
    var GA = this.jacobianElementA,
        GB = this.jacobianElementB,
        bi = this.bi,
        bj = this.bj,
        vi = bi.vlambda,
        vj = bj.vlambda,
        wi = bi.wlambda || zero,
        wj = bj.wlambda || zero;
    return GA.multiplyVectors(vi,wi) + GB.multiplyVectors(vj,wj);
};

/**
 * Computes G*inv(M)*f, where M is the mass matrix with diagonal blocks for each body, and f are the forces on the bodies.
 * @method computeGiMf
 * @return {Number}
 */
var iMfi = new Vec3(),
    iMfj = new Vec3(),
    invIi_vmult_taui = new Vec3(),
    invIj_vmult_tauj = new Vec3();
Equation.prototype.computeGiMf = function(){
    var GA = this.jacobianElementA,
        GB = this.jacobianElementB,
        bi = this.bi,
        bj = this.bj,
        fi = bi.force,
        ti = bi.torque,
        fj = bj.force,
        tj = bj.torque,
        invMassi = bi.invMassSolve,
        invMassj = bj.invMassSolve;

    if(bi.invInertiaWorldSolve){ bi.invInertiaWorldSolve.vmult(ti,invIi_vmult_taui); }
    else { invIi_vmult_taui.set(0,0,0); }
    if(bj.invInertiaWorldSolve){ bj.invInertiaWorldSolve.vmult(tj,invIj_vmult_tauj); }
    else { invIj_vmult_tauj.set(0,0,0); }

    fi.mult(invMassi,iMfi);
    fj.mult(invMassj,iMfj);

    return GA.multiplyVectors(iMfi,invIi_vmult_taui) + GB.multiplyVectors(iMfj,invIj_vmult_tauj);
};

/**
 * Computes G*inv(M)*G'
 * @method computeGiMGt
 * @return {Number}
 */
var tmp = new Vec3();
Equation.prototype.computeGiMGt = function(){
    var GA = this.jacobianElementA,
        GB = this.jacobianElementB,
        bi = this.bi,
        bj = this.bj,
        invMassi = bi.invMassSolve,
        invMassj = bj.invMassSolve,
        invIi = bi.invInertiaWorldSolve,
        invIj = bj.invInertiaWorldSolve,
        result = invMassi + invMassj;

    if(invIi){
        invIi.vmult(GA.rotational,tmp);
        result += tmp.dot(GA.rotational);
    }

    if(invIj){
        invIj.vmult(GB.rotational,tmp);
        result += tmp.dot(GB.rotational);
    }

    return  result;
};

var addToWlambda_temp = new Vec3(),
    addToWlambda_Gi = new Vec3(),
    addToWlambda_Gj = new Vec3(),
    addToWlambda_ri = new Vec3(),
    addToWlambda_rj = new Vec3(),
    addToWlambda_Mdiag = new Vec3();

/**
 * Add constraint velocity to the bodies.
 * @method addToWlambda
 * @param {Number} deltalambda
 */
Equation.prototype.addToWlambda = function(deltalambda){
    var GA = this.jacobianElementA,
        GB = this.jacobianElementB,
        bi = this.bi,
        bj = this.bj,
        temp = addToWlambda_temp;

    // Add to linear velocity
    // v_lambda += inv(M) * delta_lamba * G
    GA.spatial.mult(bi.invMassSolve * deltalambda,temp);
    bi.vlambda.vadd(temp, bi.vlambda);

    GB.spatial.mult(bj.invMassSolve * deltalambda,temp);
    bj.vlambda.vadd(temp, bj.vlambda);

    // Add to angular velocity
    if(bi.invInertiaWorldSolve){
        bi.invInertiaWorldSolve.vmult(GA.rotational,temp);
        temp.mult(deltalambda,temp);
        bi.wlambda.vadd(temp,bi.wlambda);
    }

    if(bj.invInertiaWorldSolve){
        bj.invInertiaWorldSolve.vmult(GB.rotational,temp);
        temp.mult(deltalambda,temp);
        bj.wlambda.vadd(temp,bj.wlambda);
    }
};

/**
 * Compute the denominator part of the SPOOK equation: C = G*inv(M)*G' + eps
 * @method computeInvC
 * @param  {Number} eps
 * @return {Number}
 */
Equation.prototype.computeC = function(){
    return this.computeGiMGt() + this.eps;
};


text:
package org.diorite.material.items.mob;

import java.util.Map;

import org.diorite.material.ItemMaterialData;
import org.diorite.utils.collections.maps.CaseInsensitiveMap;

import gnu.trove.map.TShortObjectMap;
import gnu.trove.map.hash.TShortObjectHashMap;

@SuppressWarnings("MagicNumber")
public class LeatherMat extends ItemMaterialData
{
    /**
     * Sub-ids used by diorite/minecraft by default
     */
    public static final int USED_DATA_VALUES = 1;

    public static final LeatherMat LEATHER = new LeatherMat();

    private static final Map<String, LeatherMat>     byName = new CaseInsensitiveMap<>(USED_DATA_VALUES, SMALL_LOAD_FACTOR);
    private static final TShortObjectMap<LeatherMat> byID   = new TShortObjectHashMap<>(USED_DATA_VALUES, SMALL_LOAD_FACTOR, Short.MIN_VALUE);

    protected LeatherMat()
    {
        super("LEATHER", 334, "minecraft:leather", "LEATHER", (short) 0x00);
    }

    protected LeatherMat(final String enumName, final int id, final String minecraftId, final String typeName, final short type)
    {
        super(enumName, id, minecraftId, typeName, type);
    }

    protected LeatherMat(final String enumName, final int id, final String minecraftId, final int maxStack, final String typeName, final short type)
    {
        super(enumName, id, minecraftId, maxStack, typeName, type);
    }

    @Override
    public LeatherMat getType(final int type)
    {
        return getByID(type);
    }

    @Override
    public LeatherMat getType(final String type)
    {
        return getByEnumName(type);
    }

    /**
     * Returns one of Leather sub-type based on sub-id, may return null
     *
     * @param id sub-type id
     *
     * @return sub-type of Leather or null
     */
    public static LeatherMat getByID(final int id)
    {
        return byID.get((short) id);
    }

    /**
     * Returns one of Leather sub-type based on name (selected by diorite team), may return null
     * If block contains only one type, sub-name of it will be this same as name of material.
     *
     * @param name name of sub-type
     *
     * @return sub-type of Leather or null
     */
    public static LeatherMat getByEnumName(final String name)
    {
        return byName.get(name);
    }

    /**
     * Register new sub-type, may replace existing sub-types.
     * Should be used only if you know what are you doing, it will not create fully usable material.
     *
     * @param element sub-type to register
     */
    public static void register(final LeatherMat element)
    {
        byID.put(element.getType(), element);
        byName.put(element.getTypeName(), element);
    }

    @Override
    public LeatherMat[] types()
    {
        return LeatherMat.leatherTypes();
    }

    /**
     * @return array that contains all sub-types of this block.
     */
    public static LeatherMat[] leatherTypes()
    {
        return byID.values(new LeatherMat[byID.size()]);
    }

    static
    {
        LeatherMat.register(LEATHER);
    }
}


text:
/**
 * Created by sakura on 16/4/5.
 */
$("#make-search").click(function() {
    $(".type, .year, .price").hide();
    $(".make").fadeToggle();
});

$("#type-search").click(function() {
    $(".make, .year, .price").hide();
    $(".type").fadeToggle();
});

$("#year-search").click(function() {
    $(".make, .type, .price").hide();
    $(".year").fadeToggle();
});

$("#price-search").click(function() {
    $(".make, .type, .year").hide();
    $(".price").fadeToggle();
});
//
// $("#make-btn").click(function() {
//     // if ($("#make-collapse"))
//     // $("#make-collapse").toggle();
//     $("#model-collapse, #year-collapse, #price-collapse").collapse('hide');
//     // $("#make-collapse").collapse("toggle");
// });
//
// $("#model-btn").click(function() {
//     // $("#model-collapse").toggle();
//     $("#make-collapse, #year-collapse, #price-collapse").collapse('hide');
//     // $("#model-collapse").collapse("toggle");
// });
//
// $("#year-btn").click(function() {
//     $("#make-collapse, #model-collapse, #price-collapse").collapse('hide');
// });
//
// $("#price-btn").click(function() {
//     $("#make-collapse, #model-collapse, #year-collapse").collapse('hide');
// });


text:
using System;
using System.Linq;

namespace AllGreen.Core
{
    public interface IFileLocationParser
    {
        FileLocation Parse(string fileLocationText);
    }
}


text:
% Application Structure

Before choosing your first pattern, determine the structure of your application
(flat or hierarchical) and then review the articles on [Application
Layers](app-structure/app-layers.html) and [Panel
Structure](app-structure/panel-structure.html).  You should then be able to
[choose your first pattern](app-structure/panel-patterns.html) (Always Viewing
or Activity), which will set the scope for your application.

## Flat Applications

### General Structure

A flat application structure is used to present a single activity in a single
view, or multiple activities that exist as peers (i.e., each activity has direct
access to the other activities).

![](../../assets/dg-app-structure-flat.png)

### How to Use

#### Single Activity

Single Activity applications, such as a Clock, Calculator, or Calendar, are not
common on the TV.  These apps tend to be more appropriate for personal computing
devices such as phones, tablets, or computers.  However, there are some fun
single activity applications that can be created for TV, such as the Yule Log,
Weather, or simple games like Mahjong.

![](../../assets/dg-yule-log.jpg)

Related Patterns: Full Screen Basement, Popup, Playback Controls

## Hierarchical Applications

### General Structure

A hierarchical application structure supports multiple activities with deep
navigation, where each level in the hierarchy has a different level of detail.
Switching activities requires navigating to a higher level (in most cases, the
top level).

![](../../assets/dg-app-structure-hierarchical.png)

### How to Use

#### Top Level

The Top Level (Panel 1) of your application is commonly used as a launch pad for
users to explore new items in different categories of the application, featured
content, and/or promotions.  Only information of the greatest importance to the
user should be displayed here, along with the means to navigate the
application's main menu.  This is where first impressions are made, so keep the
content and layout visually rich and engaging.

![_Rdio Top Level Page_](../../assets/dg-rdio-top-level.jpg)

Related Patterns: [Hub and Spoke](navigation/hub-and-spoke.html), [Displaying
Data](displaying-data.html), [Panel Patterns](app-structure/panel-patterns.html)

#### Category Views

Category Views provide a slightly zoomed out view on an entire category of the
application.  This view commonly takes the form of a list with minimal details
for each list item.  When appropriate, the list should be organized with a
dynamically interesting layout, while remaining intuitive and easy to navigate.

![_Rdio Category View Page_](../../assets/dg-rdio-category-view.jpg)

Related Patterns: [Displaying Data](displaying-data.html), Lists and Grids,
[Acting on Data](acting-on-data.html), [Panel
Patterns](app-structure/panel-patterns.html)

#### Detail Pages

The Detail Page is either the final destination in the app or the launching pad
to the final destination.  While the layout will vary depending on the content
type, it should follow a simple pattern of displaying the most important
information on top, with all other information easily navigable through simple
scrolling.  Complex detail pages should group different detail types into
sections that only display a preview or subset of the data, along with a
**More** button to expand the section either inline or in the next panel.
Detail pages are also the best location for editing object-specific data (e.g.,
name, contact info, etc.).

![_Rdio Detail Page_](../../assets/dg-rdio-detail-page.jpg)

Related Patterns: [Displaying Data](displaying-data.html), [Detail
Pages](displaying-data/detail-pages.html), Jump to Anchor, [Edit
Mode](acting-on-data/edit-mode.html), [Panel
Patterns](app-structure/panel-patterns.html)

#### Full Screen Basement

TV applications should take full advantage of the immersive experience the large
screen affords the user.  Whether the user is viewing a single video or photo,
or participating in a video chat, the default/primary experience should be
full-screen.  The Always Viewing Pattern makes the most of this by always
showing the basement and always loading selected content directly into the full
screen basement.

![_Rdio Full Screen Basement_](../../assets/dg-rdio-full-screen-basement.jpg)

Related Patterns: Video Playback, Slideshows


text:
using DateTimeExtensions.WorkingDays;
using DateTimeExtensions.WorkingDays.CultureStrategies;

namespace TrafikverketFarjor.DateTimeExtensions
{
    public class SV_SEHolidayStrategyWithEvenings : SV_SEHolidayStrategy
    {
        public SV_SEHolidayStrategyWithEvenings()
        {
            InnerHolidays.Add(GlobalHolidays.MidsummerEve);
            InnerHolidays.Add(ChristianHolidays.ChristmasEve);
            InnerHolidays.Add(GlobalHolidays.NewYearsEve);
        }
    }
}


text:
<!doctype html>

  On
  Off

  Non-hidden descendant content
  On
  Off


text:
function tocode(g::ExGraph, evalmod::Module=Main)

    valueof(n::ExNode, child::ExNode) = n.val
    valueof(n::NFor,   child::ExNode) = valueof(n.val[child], n)

    translate(n::NConst) = isa(n.main, DataType) ? Symbol(n.main) : n.main
    translate(n::NComp)  = Expr(:comparison,
                                valueof(n.parents[1],n),
                                n.main,
                                valueof(n.parents[2],n) )

    translate(n::NRef)   = Expr(:ref, Any[ valueof(x,n) for x in n.parents ]...)
    translate(n::NDot)   = Expr(:(.), valueof(n.parents[1],n), n.main)

    function translate(n::NIn)
        isa(n.parents[1], NFor) && return n.parents[1].val[n]
        return n.parents[1].val
    end

    function translate(n::NCall)
        # special translation cases
        op = n.parents[1].main
        if op == vcat
            return Expr(      :vect, Any[ valueof(x,n) for x in n.parents[2:end] ]...)
        elseif op == :(:)
            return Expr(       :(:), Any[ valueof(x,n) for x in n.parents[2:end] ]...)
        elseif op == transpose
            return Expr(Symbol("'"),                 valueof(n.parents[2], n) )
        elseif op == tuple
            return Expr(     :tuple, Any[ valueof(x,n) for x in n.parents[2:end] ]...)
        end

        # Expr(:call, mexpr( mt ), Any[ valueof(x,n) for x in n.parents[2:end] ]...)
        Expr(:call, relative_name(op, evalmod),
             Any[ valueof(x,n) for x in n.parents[2:end] ]...)
    end

    function translate(n::NExt)
        hasnode(g.exti, n)  || return n.main
        sym = g.exti[n]  # should be equal to n.main but just to be sure..
        hassym(g.exto, sym) || return n.main
        return getnode(g.exto, sym).val  # return node val in parent graph
    end

    function translate(n::NSRef)
        np = n.parents
        (length(np) == 2) && return :( $(valueof(np[1],n)) = $(valueof(np[2],n)) )

        :( $(Expr(:ref, valueof(np[1],n), Any[ valueof(x,n) for x in np[3:end]]...)) = $(valueof(np[2],n)) )
    end

    function translate(n::NSDot)
        np = n.parents
        :( $(Expr(:., valueof(np[1],n), n.main)) = $(valueof(np[2],n)) )
    end

    translate(n::NFor) = Expr(:for,
                              Expr(:(=), n.main[1], valueof(n.parents[1],n)),
                              tocode(n.main[2], evalmod))

    ### do a precount of nodes references for speedup
    nref1 = Dict(zip(g.nodes, zeros(Int, length(g.nodes))))
    for n in g.nodes
        for p in n.parents
            nref1[p] += 1
        end
    end

    ### do a precount of nodes references by NFor or setfield/index or getfield/index
    nref2 = Dict(zip(g.nodes, falses(length(g.nodes))))
    for n in g.nodes
        if isa(n, NFor)
            for p in n.parents[2:end]  # ignore index range
                nref2[p] = true
            end
        end
    end

    ### do a precount of nodes references setfield/index or getfield/index
    nref3 = Dict(zip(g.nodes, falses(length(g.nodes))))
    for n in g.nodes
        if isa(n, Union{NSRef, NSDot, NRef, NDot})
            nref3[n.parents[1]] = true
        end
    end

    evalsort!(g)
    out = Any[]
    for n in g.nodes
        n.val = translate(n)       # translate to Expr
        stat, lhs = ispivot(n, g, nref1, nref2, nref3)

        if stat && isa(n, Union{NSRef, NSDot})
            push!(out, n.val)
            n.val = n.parents[1].val
            if getname(n,g) == nothing && n == g.nodes[end] # add explicit var ref
                push!(out, :( $(n.val) ))
            end

        elseif stat && isa(n, NFor)
            push!(out, n.val)

            g2 = n.main[2]
            valdict = Dict()
            for (k, sym) in g2.seto
              valdict[k] = getnode(g2.seti, sym).val
            end
            n.val = valdict

        elseif stat && (lhs != n.val)
            if lhs == nothing && n == g.nodes[end] # last statement without assignment
                push!(out, :( $(n.val) ))

            else
                ( lhs in [ nosym, nothing] ) && ( lhs = newvar() )
                push!(out, :( $lhs = $(n.val) ))
            end

            n.val = lhs

        end

    end

    return Expr(:block, out...)
end

#####################################################################
#  variable name assigned to this node
#####################################################################
const nosym = 0x7c883061f2344364  # code for no Symbol associated

function getname(n::ExNode, g::ExGraph)
    if hasnode(g.seti, n)
        sym = g.seti[n]
        hassym(g.exto, sym) || return sym
        return getnode(g.exto, sym).val
    elseif hasnode(g.exti, n)
        sym = g.exti[n]
        hassym(g.exto, sym) || return sym
        return getnode(g.exto, sym).val
    else
        return nosym
    end

end

#####################################################################
#  tells if an assignment should be created for this node
#####################################################################

# always print nodes that change a variable's state
ispivot(n::Union{NSRef, NSDot, NFor},
        g::ExGraph, nref1, nref2, nref3) = (true, nothing)

# print only if names are linked
function ispivot(n::Union{NExt, NRef, NDot}, g::ExGraph,
                 nref1, nref2, nref3)
    sym = getname(n, g)
    sym != nosym && return (true, sym)

    # it is in the precedence of another node and is (by another path) a parent of an exitnode
    ps = filter(x -> (n in x.precedence), g.nodes)
    if length(ps) > 0
        sv = collect(nodes(g.seti))
        isancestor(n, sv, g, ps) && return (true, nosym)
    end

    # otherwise do not create assignment
    return (false, nothing)
end

# print constants that are named or modified by a for loop
function ispivot(n::NConst, g::ExGraph,
                 nref1, nref2, nref3)
    sym = getname(n, g)
    sym != nosym && return (true, sym)

    # it is used in a setfield/index or getfield/index
    nref3[n] && return (true, nosym)

    for x in filter(x -> isa(x, NFor) && n in x.parents[2:end], g.nodes)
        fg = x.main[2]
        isym = fg.exto[n]
        hassym(fg.exti, isym) && hassym(fg.exti, isym) && return (true, nosym)
    end

    (false, nothing)
end

# print only if used in For loop
function ispivot(n::NIn, g::ExGraph, nref1, nref2, nref3)
    sym = getname(n, g)
    sym != nosym && return (true, sym)

    # it is used in a for loop (except index range)
    nref2[n] && return (true, nosym)

    # it is in the precedence of another node and is (by another path) a parent of an exitnode
    ps = filter(x -> (n in x.precedence), g.nodes)
    if length(ps) > 0
        sv = collect(nodes(g.seti))
        isancestor(n, sv, g, ps) && return (true, nosym)
    end

    (false, nothing)
end

function ispivot(n::Union{NCall, NComp}, g::ExGraph, nref1, nref2, nref3)
    sym = getname(n, g)

    # it has a name assigned
    sym != nosym && return (true, sym)

    # it is used in a for loop (except index range)
    # any(x -> isa(x, NFor) && n in x.parents[2:end], g.nodes) &&
    #   return (true, nosym)
    nref2[n] && return (true, nosym)

    # it is used in a setfield/index or getfield/index
    # any(x -> isa(x, Union{NSRef, NSDot, NRef, NDot}) && n == x.parents[1], g.nodes) &&
    #   return (true, nosym)
    nref3[n] && return (true, nosym)

    # it is used more than once
    # (sum(x -> sum(n .== x.parents), g.nodes) > 1) && return (true, nosym)
    (nref1[n] > 1) && return (true, nosym)

    # it is in the precedence of another node and is (by another path) a parent of an exitnode
    ps = filter(x -> (n in x.precedence), g.nodes)
    if length(ps) > 0
        sv = collect(nodes(g.seti))
        isancestor(n, sv, g, ps) && return (true, nosym)
    end

    # otherwise do not create assignment
    return (false, nothing)
end

# generates expr that binds to the object given, from module emod
function relative_name(o::Union{Function,DataType}, emod::Module=Main)
  mexpr(ns) = length(ns) == 1 ?
                ns[1] :
                Expr(:., mexpr(ns[1:end-1]), QuoteNode(ns[end]) )

  fs, mf = isa(o, Function) ?
            (nameof(o),   parentmodule(o)) :
            (o.name.name, Base.datatype_module(o))

  mfn = mf==Main ? (Main,) : fullname(mf)

  if mf == emod # function defined in eval module
    return mexpr((fs,))
  elseif isdefined(emod, fs) && getfield(emod,fs)==getfield(mf,fs)
    return mexpr((fs,))
  else
    return mexpr(tuple(mfn..., fs))
  end
end


text:
package com.comandante.creeper.server.telnet;

import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.DefaultChannelPipeline;
import org.jboss.netty.handler.codec.frame.Delimiters;
import org.jboss.netty.handler.codec.string.StringEncoder;

public class CreeperServerPipelineFactory implements ChannelPipelineFactory {

    private final ChannelHandler handler;

    public CreeperServerPipelineFactory(ChannelHandler handler) {
        this.handler = handler;
    }

    public ChannelPipeline getPipeline() {
        ChannelPipeline pipeline = new DefaultChannelPipeline();
        pipeline.addLast("framer", new CreeperDelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));
        pipeline.addLast("decoder", new CreeperStringDecoder());
        pipeline.addLast("encoder", new StringEncoder());
        pipeline.addLast("handler", handler);
        return pipeline;
    }
}


text:
package com.github.takuji31.yapcasiaviewer;

import com.github.takuji31.appbase.app.BaseDialogFragment;

public class YAVDialogFragment extends
		BaseDialogFragment<YapcAsiaViewer, YAVActivity> {

}


text:
package com.valkryst.VTerminal.component;

import com.valkryst.VTerminal.image.SequentialOp;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import javax.swing.*;
import java.awt.*;

public class VPanelTest {
	@Test
	public void canCreatePanel() throws NoSuchFieldException, IllegalAccessException {
		final int panelWidth = 10;
		final int panelHeight = 15;

		final var panel = new VPanel(panelWidth, panelHeight);
		Assertions.assertNotNull(panel);

		final var panelClass = panel.getClass();
		final var codePointsField = panelClass.getDeclaredField("codePoints");
		final var backgroundColorsField = panelClass.getDeclaredField("backgroundColors");
		final var foregroundColorsField = panelClass.getDeclaredField("foregroundColors");
		final var sequentialImageOpsField = panelClass.getDeclaredField("sequentialImageOps");

		codePointsField.setAccessible(true);
		backgroundColorsField.setAccessible(true);
		foregroundColorsField.setAccessible(true);
		sequentialImageOpsField.setAccessible(true);

		final var codePoints = (int[][]) codePointsField.get(panel);
		Assertions.assertEquals(panelHeight, codePoints.length);
		Assertions.assertEquals(panelWidth, codePoints[0].length);

		final var backgroundColors = (Color[][]) backgroundColorsField.get(panel);
		Assertions.assertEquals(panelHeight, backgroundColors.length);
		Assertions.assertEquals(panelWidth, backgroundColors[0].length);

		final var foregroundColors = (Color[][]) foregroundColorsField.get(panel);
		Assertions.assertEquals(panelHeight, foregroundColors.length);
		Assertions.assertEquals(panelWidth, foregroundColors[0].length);

		final var sequentialImageOps = (SequentialOp[][]) sequentialImageOpsField.get(panel);
		Assertions.assertEquals(panelHeight, sequentialImageOps.length);
		Assertions.assertEquals(panelWidth, sequentialImageOps[0].length);

		final var panelBackgroundColor = panel.getBackground();
		final var panelForegroundColor = panel.getForeground();
		for (int y = 0 ; y < panelHeight ; y++) {
			for (int x = 0 ; x < panelWidth ; x++) {
				Assertions.assertEquals(' ', codePoints[y][x]);
				Assertions.assertEquals(panelBackgroundColor, backgroundColors[y][x]);
				Assertions.assertEquals(panelForegroundColor, foregroundColors[y][x]);
				Assertions.assertNull(sequentialImageOps[y][x]);
			}
		}
	}

	@Test
	public void cannotCreatePanelWithNonPositiveWidth() {
		Assertions.assertThrows(IllegalArgumentException.class, () -> {
			new VPanel(0, 1);
		});
	}

	@Test
	public void cannotCreatePanelWithNonPositiveHeight() {
		Assertions.assertThrows(IllegalArgumentException.class, () -> {
			new VPanel(1, 0);
		});
	}

	@Test
	public void canSetBackgroundColor() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		panel.setBackground(Color.MAGENTA);

		final var backgroundColorsField = panel.getClass().getDeclaredField("backgroundColors");
		backgroundColorsField.setAccessible(true);
		final var backgroundColors = (Color[][]) backgroundColorsField.get(panel);

		for (int y = 0 ; y < panel.getHeightInTiles() ; y ++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertEquals(Color.MAGENTA, backgroundColors[y][x]);

			}
		}
	}

	@Test
	public void canReset() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				panel.setBackgroundAt(x, y, Color.MAGENTA);
				panel.setCodePointAt(x, y, '~');
				panel.setForegroundAt(x, y, Color.GREEN);
				panel.setSequentialImageOpAt(x, y, new SequentialOp());
			}
		}

		final var backgroundColorsField = panel.getClass().getDeclaredField("backgroundColors");
		backgroundColorsField.setAccessible(true);
		final var backgroundColors = (Color[][]) backgroundColorsField.get(panel);

		final var codePointsField = panel.getClass().getDeclaredField("codePoints");
		codePointsField.setAccessible(true);
		final var codePoints = (int[][]) codePointsField.get(panel);

		final var foregroundColorsField = panel.getClass().getDeclaredField("foregroundColors");
		foregroundColorsField.setAccessible(true);
		final var foregroundColors = (Color[][]) foregroundColorsField.get(panel);

		final var sequentialImageOpsField = panel.getClass().getDeclaredField("sequentialImageOps");
		sequentialImageOpsField.setAccessible(true);
		final var sequentialImageOps = (SequentialOp[][]) sequentialImageOpsField.get(panel);

		panel.reset();
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertNotEquals(Color.MAGENTA, backgroundColors[y][x]);
				Assertions.assertNotEquals('~', codePoints[y][x]);
				Assertions.assertNotEquals(Color.GREEN, foregroundColors[y][x]);
				Assertions.assertNull(sequentialImageOps[y][x]);
			}
		}
	}

	@Test
	public void canResetBackgroundColors() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				panel.setBackgroundAt(x, y, Color.MAGENTA);
			}
		}

		final var backgroundColorsField = panel.getClass().getDeclaredField("backgroundColors");
		backgroundColorsField.setAccessible(true);
		final var backgroundColors = (Color[][]) backgroundColorsField.get(panel);

		panel.resetBackgroundColors();
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertNotEquals(Color.MAGENTA, backgroundColors[y][x]);
			}
		}
	}

	@Test
	public void canResetCodePoints() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				panel.setCodePointAt(x, y, '~');
			}
		}

		final var codePointsField = panel.getClass().getDeclaredField("codePoints");
		codePointsField.setAccessible(true);
		final var codePoints = (int[][]) codePointsField.get(panel);

		panel.resetCodePoints();
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertNotEquals('~', codePoints[y][x]);
			}
		}
	}

	@Test
	public void canResetForegroundColors() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				panel.setForegroundAt(x, y, Color.MAGENTA);
			}
		}

		final var foregroundColorsField = panel.getClass().getDeclaredField("foregroundColors");
		foregroundColorsField.setAccessible(true);
		final var foregroundColors = (Color[][]) foregroundColorsField.get(panel);

		panel.resetForegroundColors();
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertNotEquals(Color.MAGENTA, foregroundColors[y][x]);
			}
		}
	}

	@Test
	public void canResetSequentialImageOps() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				panel.setSequentialImageOpAt(x, y, new SequentialOp());
			}
		}

		final var sequentialImageOpsField = panel.getClass().getDeclaredField("sequentialImageOps");
		sequentialImageOpsField.setAccessible(true);
		final var sequentialImageOps = (SequentialOp[][]) sequentialImageOpsField.get(panel);

		panel.resetSequentialImageOps();
		for (int y = 0 ; y < panel.getHeightInTiles() ; y++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertNull(sequentialImageOps[y][x]);
			}
		}
	}

	@Test
	public void canSetBackgroundColorWithNullColor() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		panel.setBackground(Color.MAGENTA);

		final var backgroundColorsField = panel.getClass().getDeclaredField("backgroundColors");
		backgroundColorsField.setAccessible(true);
		final var backgroundColors = (Color[][]) backgroundColorsField.get(panel);

		panel.setBackground(null);
		final var defaultColor = UIManager.getColor("Panel.background");
		for (int y = 0 ; y < panel.getHeightInTiles() ; y ++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertEquals(defaultColor, backgroundColors[y][x]);

			}
		}
	}

	@Test
	public void canSetBackgroundColorAtLocation() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(1, 1);
		panel.setBackgroundAt(0, 0, Color.MAGENTA);

		final var backgroundColorsField = panel.getClass().getDeclaredField("backgroundColors");
		backgroundColorsField.setAccessible(true);
		final var backgroundColors = (Color[][]) backgroundColorsField.get(panel);

		Assertions.assertEquals(Color.MAGENTA, backgroundColors[0][0]);
	}

	@Test
	public void canSetBackgroundColorAtLocationWithNullColor() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(1, 1);
		panel.setBackgroundAt(0, 0, Color.MAGENTA);

		final var backgroundColorsField = panel.getClass().getDeclaredField("backgroundColors");
		backgroundColorsField.setAccessible(true);
		final var backgroundColors = (Color[][]) backgroundColorsField.get(panel);

		panel.setBackgroundAt(0, 0, null);
		Assertions.assertEquals(UIManager.getColor("Panel.background"), backgroundColors[0][0]);
	}

	@Test
	public void canSetBackgroundColorAtLocationWithOutOfBoundsLocation() {
		Assertions.assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
			new VPanel(1, 1).setBackgroundAt(-1, -1, Color.MAGENTA);
		});
	}

	@Test
	public void canSetCodePointAtLocation() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(1, 1);
		panel.setCodePointAt(0, 0, '~');

		final var codePointsField = panel.getClass().getDeclaredField("codePoints");
		codePointsField.setAccessible(true);
		final var codePoints = (int[][]) codePointsField.get(panel);

		Assertions.assertEquals('~', codePoints[0][0]);
	}

	@Test
	public void canSetCodePointAtOutOfBoundsLocation() {
		Assertions.assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
			new VPanel(1, 1).setCodePointAt(-1, -1, '~');
		});
	}

	@Test
	public void canSetForegroundColor() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		panel.setForeground(Color.MAGENTA);

		final var foregroundColorsField = panel.getClass().getDeclaredField("foregroundColors");
		foregroundColorsField.setAccessible(true);
		final var foregroundColors = (Color[][]) foregroundColorsField.get(panel);

		for (int y = 0 ; y < panel.getHeightInTiles() ; y ++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertEquals(Color.MAGENTA, foregroundColors[y][x]);
			}
		}
	}

	@Test
	public void canSetForegroundColorWithNullColor() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(2, 2);
		panel.setForeground(Color.MAGENTA);

		final var foregroundColorsField = panel.getClass().getDeclaredField("foregroundColors");
		foregroundColorsField.setAccessible(true);
		final var foregroundColors = (Color[][]) foregroundColorsField.get(panel);

		panel.setForeground(null);
		final var defaultColor = UIManager.getColor("Panel.foreground");
		for (int y = 0 ; y < panel.getHeightInTiles() ; y ++) {
			for (int x = 0 ; x < panel.getWidthInTiles() ; x++) {
				Assertions.assertEquals(defaultColor, foregroundColors[y][x]);

			}
		}
	}

	@Test
	public void canSetForegroundColorAtLocation() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(1, 1);
		panel.setForegroundAt(0, 0, Color.MAGENTA);

		final var foregroundColorsField = panel.getClass().getDeclaredField("foregroundColors");
		foregroundColorsField.setAccessible(true);
		final var foregroundColors = (Color[][]) foregroundColorsField.get(panel);

		Assertions.assertEquals(Color.MAGENTA, foregroundColors[0][0]);
	}

	@Test
	public void canSetForegroundColorAtLocationWithNullColor() throws NoSuchFieldException, IllegalAccessException {
		final var panel = new VPanel(1, 1);
		panel.setForegroundAt(0, 0, Color.MAGENTA);

		final var foregroundColorsField = panel.getClass().getDeclaredField("foregroundColors");
		foregroundColorsField.setAccessible(true);
		final var foregroundColors = (Color[][]) foregroundColorsField.get(panel);

		panel.setForegroundAt(0, 0, null);
		Assertions.assertEquals(UIManager.getColor("Panel.foreground"), foregroundColors[0][0]);
	}

	@Test
	public void canSetForegroundColorAtLocationWithOutOfBoundsLocation() {
		Assertions.assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
			new VPanel(1, 1).setForegroundAt(-1, -1, Color.MAGENTA);
		});
	}
}


text:
package org.apache.accumulo.core.conf;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.impl.Tables;
import org.apache.log4j.Logger;

public abstract class AccumuloConfiguration implements Iterable<Entry<String,String>> {
  private static final Logger log = Logger.getLogger(AccumuloConfiguration.class);

  public abstract String get(Property property);

  public abstract Iterator<Entry<String,String>> iterator();

  private void checkType(Property property, PropertyType type) {
    if (!property.getType().equals(type)) {
      String msg = "Configuration method intended for type " + type + " called with a " + property.getType() + " argument (" + property.getKey() + ")";
      IllegalArgumentException err = new IllegalArgumentException(msg);
      log.error(msg, err);
      throw err;
    }
  }

  /**
   * This method returns all properties in a map of string->string under the given prefix property.
   *
   * @param property
   *          the prefix property, and must be of type PropertyType.PREFIX
   * @return a map of strings to strings of the resulting properties
   */
  public Map<String,String> getAllPropertiesWithPrefix(Property property) {
    checkType(property, PropertyType.PREFIX);

    Map<String,String> propMap = new HashMap<String,String>();

    for (Entry<String,String> entry : this) {
      if (entry.getKey().startsWith(property.getKey())) {
        propMap.put(entry.getKey(), entry.getValue());
      }
    }

    return propMap;
  }

  public long getMemoryInBytes(Property property) {
    checkType(property, PropertyType.MEMORY);

    String memString = get(property);
    return getMemoryInBytes(memString);
  }

  static public long getMemoryInBytes(String str) {
    int multiplier = 0;
    char lastChar = str.charAt(str.length() - 1);

    if (lastChar == 'b') {
      log.warn("The 'b' in " + str + " is being considered as bytes. " + "Setting memory by bits is not supported");
    }
    try {
      switch (Character.toUpperCase(lastChar)) {
        case 'G':
          multiplier += 10;
        case 'M':
          multiplier += 10;
        case 'K':
          multiplier += 10;
        case 'B':
          return Long.parseLong(str.substring(0, str.length() - 1)) << multiplier;
        default:
          return Long.parseLong(str);
      }
    } catch (Exception ex) {
      throw new IllegalArgumentException("The value '" + str + "' is not a valid memory setting. A valid value would a number "
          + "possibily followed by an optional 'G', 'M', 'K', or 'B'.");
    }
  }

  public long getTimeInMillis(Property property) {
    checkType(property, PropertyType.TIMEDURATION);

    return getTimeInMillis(get(property));
  }

  static public long getTimeInMillis(String str) {
    int multiplier = 1;
    switch (str.charAt(str.length() - 1)) {
      case 'd':
        multiplier *= 24;
      case 'h':
        multiplier *= 60;
      case 'm':
        multiplier *= 60;
      case 's':
        multiplier *= 1000;
        if (str.length() > 1 && str.endsWith("ms")) // millis
          // case
          return Long.parseLong(str.substring(0, str.length() - 2));
        return Long.parseLong(str.substring(0, str.length() - 1)) * multiplier;
      default:
        return Long.parseLong(str) * 1000;
    }
  }

  public boolean getBoolean(Property property) {
    checkType(property, PropertyType.BOOLEAN);
    return Boolean.parseBoolean(get(property));
  }

  public double getFraction(Property property) {
    checkType(property, PropertyType.FRACTION);

    return getFraction(get(property));
  }

  public double getFraction(String str) {
    if (str.charAt(str.length() - 1) == '%')
      return Double.parseDouble(str.substring(0, str.length() - 1)) / 100.0;
    return Double.parseDouble(str);
  }

  public int getPort(Property property) {
    checkType(property, PropertyType.PORT);

    String portString = get(property);
    int port = Integer.parseInt(portString);
    if (port != 0) {
      if (port < 1024 || port > 65535) {
        log.error("Invalid port number " + port + "; Using default " + property.getDefaultValue());
        port = Integer.parseInt(property.getDefaultValue());
      }
    }
    return port;
  }

  public int getCount(Property property) {
    checkType(property, PropertyType.COUNT);

    String countString = get(property);
    return Integer.parseInt(countString);
  }

  public static synchronized DefaultConfiguration getDefaultConfiguration() {
    return DefaultConfiguration.getInstance();
  }

  // Only here for Shell option-free start-up
  /**
   *
   * @deprecated not for client use
   */
  @Deprecated
  public static synchronized AccumuloConfiguration getSiteConfiguration() {
    return SiteConfiguration.getInstance(getDefaultConfiguration());
  }

  public static AccumuloConfiguration getTableConfiguration(Connector conn, String tableId) throws TableNotFoundException, AccumuloException {
    String tableName = Tables.getTableName(conn.getInstance(), tableId);
    return new ConfigurationCopy(conn.tableOperations().getProperties(tableName));
  }

  public int getMaxFilesPerTablet() {
    int maxFilesPerTablet = getCount(Property.TABLE_FILE_MAX);
    if (maxFilesPerTablet <= 0) {
      maxFilesPerTablet = getCount(Property.TSERV_SCAN_MAX_OPENFILES) - 1;
      log.debug("Max files per tablet " + maxFilesPerTablet);
    }

    return maxFilesPerTablet;
  }

  public void invalidateCache() {
    // overridden in ZooConfiguration
  }
}


text:
<bill session="115" type="hj" number="54" updated="2017-05-03T23:49:50Z">
  <state datetime="2017-01-31">REFERRED</state>
  <status>
    <introduced datetime="2017-01-31"/>
  </status>
  <introduced datetime="2017-01-31"/>
  <titles>
    <title type="official" as="introduced">Disapproving the rule submitted by the Department of the Treasury and the Internal Revenue Service relating to documentation requirements for certain related-party interests in a corporation to be treated as indebtedness.</title>
    <title type="display">Disapproving the rule submitted by the Department of the Treasury and the Internal Revenue Service relating to documentation requirements for certain related-party interests in a corporation to be treated as indebtedness.</title>
  </titles>
  <sponsor bioguide_id="R000592"/>
  <cosponsors>
    <cosponsor bioguide_id="B001299" joined="2017-03-15"/>
  </cosponsors>
  <actions>
    <action datetime="2017-01-31">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-01-31" state="REFERRED">
      <text>Referred to the House Committee on Ways and Means.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSWM" name="House Ways and Means" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Taxation"/>
    <term name="Administrative law and regulatory procedures"/>
    <term name="Congressional oversight"/>
    <term name="Corporate finance and management"/>
    <term name="Department of the Treasury"/>
    <term name="Internal Revenue Service (IRS)"/>
    <term name="Securities"/>
    <term name="Tax administration and collection, taxpayers"/>
  </subjects>
  <amendments/>
  <summary date="2017-01-31T05:00:00Z" status="Introduced in House">This joint resolution nullifies rules submitted by the Department of the Treasury and the Internal Revenue Service on October 21, 2016, relating to documentation requirements that must be satisfied for certain related-party interests in a corporation to be treated as indebtedness for federal tax purposes.</summary>
  <committee-reports/>
</bill>


text:
<?php

namespace backend\tests\functional\user;

use backend\modules\user\controllers\CustomerController;
use backend\tests\Step\Functional\IssueManager;
use backend\tests\Step\Functional\Manager;
use common\fixtures\helpers\UserFixtureHelper;
use common\models\user\User;

/**
 * Class CustomerViewCest
 *
 */
class CustomerViewCest {

	/**
	 * @see CustomerController
	 */
	protected const ROUTE = 'user/customer/view';

	/**
	 * Load fixtures before db transaction begin
	 * Called in _before()
	 *
	 * @return array
	 * @see \Codeception\Module\Yii2::loadFixtures()
	 * @see \Codeception\Module\Yii2::_before()
	 */
	public function _fixtures(): array {
		return array_merge([
			'customer' => UserFixtureHelper::customer(),
			'customer-traits' => UserFixtureHelper::customerTraits(),
			'trait' => UserFixtureHelper::traits(),
		], UserFixtureHelper::profile(UserFixtureHelper::CUSTOMER));
	}

	public function checkLinks(Manager $I): void {
		$I->amLoggedIn();
		$I->amOnPage([static::ROUTE, 'id' => UserFixtureHelper::CUSTOMER_JOHN_WAYNE_ID]);
		$I->seeLink('Update');
		$I->dontSeeLink('Add issue');
		$I->dontSeeLink('Link to issue');
	}

	public function checkUpdateLink(Manager $I): void {
		$I->amLoggedIn();
		$I->amOnPage([static::ROUTE, 'id' => UserFixtureHelper::CUSTOMER_JOHN_WAYNE_ID]);
		$I->seeLink('Update');
		$I->click('Update');
		$I->see('Update customer');
	}

	public function checkLinkToIssueLinkPermission(IssueManager $I): void {
		$I->amLoggedIn();
		$I->amOnPage([static::ROUTE, 'id' => UserFixtureHelper::CUSTOMER_JOHN_WAYNE_ID]);
		$I->seeLink('Link to issue');
		$I->click('Link to issue');
		$I->see('Link Wayne John to issue');
	}

	public function checkBaseInfo(Manager $I): void {
		$I->amLoggedIn();
		$I->amOnPage([static::ROUTE, 'id' => UserFixtureHelper::CUSTOMER_JOHN_WAYNE_ID]);
		$I->see('Wayne John', 'h1');
		$I->see('john@wayne.com');
		$I->see('+48 673 222 110');
		$I->see('customer.wayne');
		$I->see(User::getStatusesNames()[User::STATUS_ACTIVE]);
		$I->wantTo('Check Trait Visible');
		$I->see('Bailiff');
		$I->dontSee('Antyvindication');

		$I->amOnPage([static::ROUTE, 'id' => UserFixtureHelper::CUSTOMER_ERIKA_LARSON_ID]);
		$I->see('Larson Erika', 'h1');
	}

	public function checkIssue(Manager $I): void {
		$I->amLoggedIn();
		$I->amOnPage([static::ROUTE, 'id' => UserFixtureHelper::CUSTOMER_JOHN_WAYNE_ID]);
		$I->see('Issues', 'legend');
		$I->see('Issue');
		$I->see('Signature act');
		$I->see('As role');
		$I->see('Agent');
	}

}


text:
package com.amazonaws.services.mediaconvert.model;

import javax.annotation.Generated;

/**
 * The cadence MediaConvert follows for generating thumbnails. If set to FOLLOW_IFRAME, MediaConvert generates
 * thumbnails for each IDR frame in the output (matching the GOP cadence). If set to FOLLOW_CUSTOM, MediaConvert
 * generates thumbnails according to the interval you specify in thumbnailInterval.
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum DashIsoIntervalCadence {

    FOLLOW_IFRAME("FOLLOW_IFRAME"),
    FOLLOW_CUSTOM("FOLLOW_CUSTOM");

    private String value;

    private DashIsoIntervalCadence(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return DashIsoIntervalCadence corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static DashIsoIntervalCadence fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (DashIsoIntervalCadence enumEntry : DashIsoIntervalCadence.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
.class final Lo/Ow$ˊ;
.super Lo/AL;
.source ""

# interfaces
.implements Ljava/io/Serializable;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lo/Ow;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "\u02ca"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lo/AL<Ljava/lang/String;Ljava/lang/Float;>;Ljava/io/Serializable;"
    }
.end annotation

# static fields
.field static final ˊ:Lo/Ow$ˊ;

.field private static final ˋ:J = 0x1L

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 269
    new-instance v0, Lo/Ow$ˊ;

    invoke-direct {v0}, Lo/Ow$ˊ;-><init>()V

    sput-object v0, Lo/Ow$ˊ;->ˊ:Lo/Ow$ˊ;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .line 267
    invoke-direct {p0}, Lo/AL;-><init>()V

    return-void
.end method

.method private readResolve()Ljava/lang/Object;
    .locals 1

    .line 287
    sget-object v0, Lo/Ow$ˊ;->ˊ:Lo/Ow$ˊ;

    return-object v0
.end method

# virtual methods
.method public toString()Ljava/lang/String;
    .locals 1

    .line 283
    const-string v0, "Floats.stringConverter()"

    return-object v0
.end method

.method protected ˊ(Ljava/lang/String;)Ljava/lang/Float;
    .locals 1

    .line 273
    invoke-static {p1}, Ljava/lang/Float;->valueOf(Ljava/lang/String;)Ljava/lang/Float;

    move-result-object v0

    return-object v0
.end method

.method protected bridge synthetic ˊ(Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1

    .line 267
    move-object v0, p1

    check-cast v0, Ljava/lang/Float;

    invoke-virtual {p0, v0}, Lo/Ow$ˊ;->ˊ(Ljava/lang/Float;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method protected ˊ(Ljava/lang/Float;)Ljava/lang/String;
    .locals 1

    .line 278
    invoke-virtual {p1}, Ljava/lang/Float;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method protected synthetic ˋ(Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1

    .line 267
    move-object v0, p1

    check-cast v0, Ljava/lang/String;

    invoke-virtual {p0, v0}, Lo/Ow$ˊ;->ˊ(Ljava/lang/String;)Ljava/lang/Float;

    move-result-object v0

    return-object v0
.end method


text:
#region Using

using System.ComponentModel.DataAnnotations;

#endregion

namespace SmartAdminMvc.Models
{
    public class AccountLoginModel
    {
        [Required]
        [EmailAddress]
        public string Email { get; set; }

        [Required]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        public string ReturnUrl { get; set; }
        public bool RememberMe { get; set; }
    }

    public class AccountForgotPasswordModel
    {
        [Required]
        [EmailAddress]
        public string Email { get; set; }
    }

    public class AccountResetPasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Compare("Password")]
        public string PasswordConfirm { get; set; }
    }

    public class AccountRegistrationModel
    {
        public string Username { get; set; }

        [Required]
        [EmailAddress]
        public string Email { get; set; }

        [Required]
        [EmailAddress]
        [Compare("Email")]
        public string EmailConfirm { get; set; }

        [Required]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Compare("Password")]
        public string PasswordConfirm { get; set; }
    }
}


text:
"""Common code tests."""
from datetime import timedelta

from pyHS100 import SmartDeviceException

from homeassistant.components.tplink.common import async_add_entities_retry
from homeassistant.helpers.typing import HomeAssistantType

from tests.async_mock import MagicMock

async def test_async_add_entities_retry(hass: HomeAssistantType):
    """Test interval callback."""
    async_add_entities_callback = MagicMock()

    # The objects that will be passed to async_add_entities_callback.
    objects = ["Object 1", "Object 2", "Object 3", "Object 4"]

    # For each call to async_add_entities_callback, the following side effects
    # will be triggered in order. This set of side effects accuratley simulates
    # 3 attempts to add all entities while also handling several return types.
    # To help understand what's going on, a comment exists describing what the
    # object list looks like throughout the iterations.
    callback_side_effects = [
        # OB1, OB2, OB3, OB4
        False,
        False,
        True,  # Object 3
        False,
        # OB1, OB2, OB4
        True,  # Object 1
        SmartDeviceException("My error"),
        False,
        # OB2, OB4
        True,  # Object 2
        True,  # Object 4
    ]

    callback = MagicMock(side_effect=callback_side_effects)

    await async_add_entities_retry(
        hass,
        async_add_entities_callback,
        objects,
        callback,
        interval=timedelta(milliseconds=100),
    )
    await hass.async_block_till_done()

    assert callback.call_count == len(callback_side_effects)

async def test_async_add_entities_retry_cancel(hass: HomeAssistantType):
    """Test interval callback."""
    async_add_entities_callback = MagicMock()

    callback_side_effects = [
        False,
        False,
        True,  # Object 1
        False,
        True,  # Object 2
        SmartDeviceException("My error"),
        False,
        True,  # Object 3
        True,  # Object 4
    ]

    callback = MagicMock(side_effect=callback_side_effects)

    objects = ["Object 1", "Object 2", "Object 3", "Object 4"]
    cancel = await async_add_entities_retry(
        hass,
        async_add_entities_callback,
        objects,
        callback,
        interval=timedelta(milliseconds=100),
    )
    cancel()
    await hass.async_block_till_done()

    assert callback.call_count == 4


text:
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using OrchardCore.Environment.Extensions;
using OrchardCore.Environment.Shell.Descriptor.Models;

namespace OrchardCore.Environment.Shell.Descriptor.Settings
{
    /// <summary>
    /// Implements <see cref="IShellDescriptorManager"/> by returning a single tenant with all the available
    /// extensions.
    /// </summary>
    public class AllFeaturesShellDescriptorManager : IShellDescriptorManager
    {
        private readonly IExtensionManager _extensionManager;
        private ShellDescriptor _shellDescriptor;

        public AllFeaturesShellDescriptorManager(IExtensionManager extensionManager)
        {
            _extensionManager = extensionManager;
        }

        public Task<ShellDescriptor> GetShellDescriptorAsync()
        {
            if (_shellDescriptor == null)
            {
                _shellDescriptor = new ShellDescriptor
                {
                    Features = _extensionManager.GetFeatures().Select(x => new ShellFeature { Id = x.Id }).ToList()
                };
            }

            return Task.FromResult(_shellDescriptor);
        }

        public Task UpdateShellDescriptorAsync(int priorSerialNumber, IEnumerable<ShellFeature> enabledFeatures, IEnumerable<ShellParameter> parameters)
        {
            return Task.CompletedTask;
        }
    }
}


text:
/* TODO: All exponential functions have low precision */

CSMath.exp = Math.exp

CSMath.exp1m = function(a) {
	return CSMath.exp(a - 1.0)
}

CSMath.pow = Math.pow


text:
FIND_PATH(HELLO_INCLUDE_DIR hello.h /Users/moses/iboxpay/cmake/t3/install/include/hello)
FIND_LIBRARY(HELLO_LIBRARY NAMES hello libhello.a PATHS  /Users/moses/iboxpay/cmake/t3/install/lib)

IF(HELLO_INCLUDE_DIR AND HELLO_LIBRARY)
   SET(HELLO_FOUND TRUE)
ENDIF(HELLO_INCLUDE_DIR AND HELLO_LIBRARY)

IF(NOT HELLO_INCLUDE_DIR)
       MESSSAGE(STATUS "can not found hello include dir")
ENDIF(NOT HELLO_INCLUDE_DIR)

IF(NOT HELLO_LIBRARY)
       MESSAGE(STATUS "can not found hello library dir")
ENDIF(NOT HELLO_LIBRARY)

IF(HELLO_FOUND)
    IF(NOT HELLO_FIND_QUIETLY)
           MESSAGE(STATUS "Found Hello: ${HELLO_LIBRARY}")
    ENDIF(NOT HELLO_FIND_QUIETLY)
ELSE(HELLO_FOUND)
    IF(HELLO_FIND_REQUIRED)
        MESSAGE(FATAL_ERROR "Cound not find hello library")
    ENDIF(HELLO_FIND_REQUIRED)
ENDIF(HELLO_FOUND)


text:
package org.arquillian.extension.recorder.video.event;

import org.arquillian.extension.recorder.video.VideoMetaData;
import org.arquillian.extension.recorder.video.VideoType;

/**
 * @author Stefan Miklosovic
 *
 */
public class BeforeVideoStart {

    private final VideoType videoType;

    private final VideoMetaData videoMetaData;

    public BeforeVideoStart(VideoType videoType, VideoMetaData videoMetaData) {
        this.videoType = videoType;
        this.videoMetaData = videoMetaData;
    }

    public VideoType getVideoType() {
        return videoType;
    }

    public VideoMetaData getVideoMetaData() {
        return videoMetaData;
    }

}


text:
<ion-header>
  <ion-navbar>
    <ion-title>User {{name}}</ion-title>
  </ion-navbar>
</ion-header>

<ion-content padding>

Hi, I'm {{name}}

  <button ion-button (click)="onGoBack()">Confirm</button>
</ion-content>


text:
export default interface FieldSchema {
  initial?: any;
  disabled?: boolean;
  defaultValue?: any;
  savedValue?: any;
  debounceTime?: number;
}


text:
package gonum

import (
	"math"

	"gonum.org/v1/gonum/internal/math32"
)

type Implementation struct{}

// [SD]gemm behavior constants. These are kept here to keep them out of the
// way during single precision code genration.
const (
	blockSize   = 64 // b x b matrix
	minParBlock = 4  // minimum number of blocks needed to go parallel
)

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

// blocks returns the number of divisions of the dimension length with the given
// block size.
func blocks(dim, bsize int) int {
	return (dim + bsize - 1) / bsize
}

// dcabs1 returns |real(z)|+|imag(z)|.
func dcabs1(z complex128) float64 {
	return math.Abs(real(z)) + math.Abs(imag(z))
}

// scabs1 returns |real(z)|+|imag(z)|.
func scabs1(z complex64) float32 {
	return math32.Abs(real(z)) + math32.Abs(imag(z))
}


text:
<?php
use Attw\Db\Connection\PDOConnector;
use Attw\Db\Collection as DBCollection;
use Attw\Db\Sql\MySQL;

/*
 * Default example
 * To use the database components, define a defualt connection:
 *
 * $pdo_connector = new PDOConnector( 'mysql:host=localhost;dbname=test', 'user', 'pass' );
 *
 * $dbcollection = DBCollection::getInstance();
 *
 * $dbcollection->add( 'Default', $pdo_connector );
 */

//$pdo_connector = new PDOConnector('mysql:host=localhost;dbname=test', 'user', 'pass');
//$dbcollection = DBCollection::getInstance();
//$dbcollection->add('Default', $pdo_connector);

$sqlGenerators = array(
    'mysql' => new MySQL()
);

/*
 * Add other connection:
 *
 * $pdo_connector = new PDOConnector( 'mysql:host=localhost;dbname=test', 'user', 'pass' );
 *
 * $dbcollection = DBCollection::getInstance();
 *
 * $dbcollection->add( 'ConnectionName', $pdo_connector );
*/


text:
import React, { useMemo, useCallback } from 'react'
import { tutorialsTree, TutorialsNavigatorTreeItem } from '../../lib/tutorials'
import SideNavigatorItem from '../SideNavigator/SideNavigatorItem'
import { useRouter, useCurrentTutorialPathname } from '../../lib/router'
import { useGeneralStatus } from '../../lib/generalStatus'
import { useContextMenu, MenuTypes } from '../../lib/contextMenu'
import { useDialog, DialogIconTypes } from '../../lib/dialog'
import { usePreferences } from '../../lib/preferences'
import { IconFile, IconFileOpen, IconHelpOutline } from '../icons'

interface NavigatorNode {
  id: string
  icon: React.ReactNode
  depth: number
  opened: boolean
  name: string
  href: string
  children: NavigatorNode[]
  active?: boolean
}

const TutorialsNavigator = ({}) => {
  const { push } = useRouter()
  const currentHref = useCurrentTutorialPathname()
  const { popup } = useContextMenu()
  const { messageBox } = useDialog()
  const { toggleSideNavOpenedItem, sideNavOpenedItemSet } = useGeneralStatus()
  const { setPreferences } = usePreferences()

  const tutorials = tutorialsTree

  const getNavigatorNodesFromTreeItem = useCallback(
    (
      tree: TutorialsNavigatorTreeItem,
      currentDepth: number,
      parentNode?: NavigatorNode,
      parentComponentPathname?: string
    ): NavigatorNode | undefined => {
      if (tree.type === 'note') {
        return
      }

      const componentPathname = `${parentComponentPathname != null &&
        parentComponentPathname}/${tree.absolutePath}`
      const nodeHref = `${parentNode != null ? parentNode.href : '/app'}/${
        tree.slug
      }`

      const folderIsActive = currentHref.split('/notes/note:')[0] === nodeHref

      const notesUnderCurrentNode = tree.children.filter(
        child => child.type === 'note'
      )

      const nodeId = `TF-${nodeHref.split('/app')[1]}`
      const currentNode = {
        id: nodeId,
        name: `${tree.label} ${
          notesUnderCurrentNode.length > 0
            ? `(${notesUnderCurrentNode.length})`
            : ''
        }`,
        icon:
          tree.type === 'folder' ? (
            folderIsActive ? (
              <IconFileOpen size='1.3em' />
            ) : (
              <IconFile />
            )
          ) : (
            <IconHelpOutline size='1.3em' />
          ),
        href: nodeHref,
        active: folderIsActive,
        depth: currentDepth,
        opened: sideNavOpenedItemSet.has(nodeId),
        children: []
      }

      const childrenNodes =
        tree.children.length === 0
          ? []
          : (tree.children
              .map(childrenTree =>
                getNavigatorNodesFromTreeItem(
                  childrenTree,
                  currentDepth + 1,
                  currentNode,
                  componentPathname
                )
              )
              .filter(node => node != null) as NavigatorNode[])
      return {
        ...currentNode,
        children: childrenNodes
      }
    },
    [currentHref, sideNavOpenedItemSet]
  )

  const createOnContextMenuHandler = (depth: number) => {
    return (event: React.MouseEvent) => {
      event.preventDefault()
      popup(event, [
        {
          type: MenuTypes.Normal,
          label: 'Remove folder',
          enabled: depth === 0,
          onClick: () => {
            messageBox({
              title: `Hide tutorials`,
              message:
                'You can choose to display them again in your preferences.',
              iconType: DialogIconTypes.Warning,
              buttons: ['Hide', 'Cancel'],
              defaultButtonIndex: 0,
              cancelButtonIndex: 1,
              onClose: () => {
                setPreferences({ 'general.tutorials': 'hide' })
              }
            })
          }
        }
      ])
    }
  }

  const nodes = useMemo(() => {
    return tutorials
      .map(tutorial => getNavigatorNodesFromTreeItem(tutorial, 0))
      .filter(node => node != null) as NavigatorNode[]
  }, [tutorials, getNavigatorNodesFromTreeItem])

  const redirectToTutorialNode = (node: NavigatorNode) => {
    push(node.href)
  }

  const renderNode = (
    node: NavigatorNode,
    parentNodeIsOpened: boolean
  ): JSX.Element | null => {
    if (node.depth > 0 && !parentNodeIsOpened) {
      return null
    }
    return (
      <React.Fragment key={node.id}>
        <SideNavigatorItem
          label={node.name}
          depth={node.depth}
          icon={node.icon}
          active={node.active}
          onClick={() => redirectToTutorialNode(node)}
          onFoldButtonClick={() => toggleSideNavOpenedItem(node.id)}
          folded={node.children.length === 0 ? undefined : !node.opened}
          onContextMenu={createOnContextMenuHandler(node.depth)}
        />
        {node.children.map(child => renderNode(child, node.opened))}
      </React.Fragment>
    )
  }

  return <>{nodes.map(node => renderNode(node, true))}</>
}

export default TutorialsNavigator


text:
FROM ubuntu:latest
MAINTAINER Marcin Jasion <marcin.jasion@gmail.com>

# Install Oracle Java 8
ENV JAVA_VER 8
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

RUN echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' >> /etc/apt/sources.list && \
    echo 'deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main' >> /etc/apt/sources.list && \
    sed -i 's/archive\.ubuntu\.com/pl\.archive\.ubuntu\.com/' /etc/apt/sources.list && \
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886 && \
    apt-get update && \
    apt-get install --no-install-recommends -y wget ca-certificates && \
    echo oracle-java${JAVA_VER}-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections && \
    apt-get install -y --force-yes --no-install-recommends oracle-java${JAVA_VER}-installer oracle-java${JAVA_VER}-set-default && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists && \
    rm -rf /var/cache/oracle-jdk${JAVA_VER}-installer

ENV TOMCAT_MAJOR_VERSION 8
ENV TOMCAT_MINOR_VERSION 8.0.11
ENV CATALINA_HOME /tomcat
ENV TOMCAT_PASS admin

# INSTALL TOMCAT
RUN wget "https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz" && \
    wget -qO- "https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz.md5" | md5sum -c - && \
    tar zxf apache-tomcat-*.tar.gz && \
    rm apache-tomcat-*.tar.gz && \
    mv apache-tomcat* tomcat

RUN sed -i -r 's/<\/tomcat-users>//' ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo '<role rolename="manager-gui"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo '<role rolename="manager-script"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo '<role rolename="manager-jmx"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo '<role rolename="admin-gui"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo '<role rolename="admin-script"/>' >> ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo "<user username=\"admin\" password=\"${TOMCAT_PASS}\" roles=\"manager-gui,manager-script,manager-jmx,admin-gui, admin-script\"/>" >> ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo '</tomcat-users>' >> ${CATALINA_HOME}/conf/tomcat-users.xml && \
    echo "=> Done!"

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

ENTRYPOINT ["${CATALINA_HOME}/bin/catalina.sh", "run"]
EXPOSE 8080


text:
namespace Infrastructure.IoC
{
	public interface ISimpleContainer
	{
		void Register<TInterface, TClass>() where TClass : TInterface, new();
		TInterface Resolve<TInterface>() where TInterface : class;
		TInterface Singleton<TInterface>() where TInterface : class;
	}
}


text:
"""
This module is responsible for the session-related logic.
"""

import requests

from utils import make_ellipsis
from structures import CaseInsensitiveDict

class RequestsSession(requests.Session):
    """
    In the requests library, if there is data in the body,
    the content-length is computed with the size of the actual body

    I wrote the following code to send to the content-length
    you entered in the request statement.
    """
    def __init__(self):
        requests.Session.__init__(self)

    def prepare_request(self, request):
        p = requests.Session.prepare_request(self, request)

        if "content-length" in self.headers:
            p.headers["content-length"] = self.headers["content-length"]

        return p

class Session(object):

    __attrs__ = [
        "session", "request_headers", "request_body", "method",
        "allow_redirects", "timeout", "response"
    ]

    def __init__(self):
        self.session = RequestsSession()
        self.allow_redirects = False
        self.timeout = 30

        self.request_headers = CaseInsensitiveDict()
        self.request_body = ""
        self.response = None

    def update_headers(self, headers):
        if headers is None:
            self.request_headers = getattr(self.session, "headers")
        else:
            self.request_headers = headers

        self.session.headers.update(self.request_headers)

    def update_body(self, body):
        self.request_body = body

    def update_connection_info(self, method, allow_redirects=False, timeout=30):
        self.method = method
        self.allow_redirects = allow_redirects
        self.timeout = timeout

    def send(self, url, verbose=True, verbose_detail=False):
        try:
            if self.method == "GET":
                self.response = self.session.get(url, allow_redirects=self.allow_redirects, timeout=self.timeout)
            elif self.method == "POST":
                self.response = self.session.post(url, allow_redirects=self.allow_redirects, timeout=self.timeout, data=self.request_body)
            else:
                print ("Error : The HTTP method is not valid")
                return False
        except requests.exceptions.ConnectionError:
            print ("Error : The host(%s) is not reachable" % url)
            return False

        if verbose is False:
            return True

        self.show_request(verbose_detail)
        print ("\n\n")
        self.show_response(verbose_detail)

        return True

    def show_request(self, verbose):
        print ("** REQUEST **")
        print ("======================================================")
        print ("Method : %s" % self.method)
        print ("======================================================")
        print ("= Request header =")
        for key, value in self.request_headers.items():
            print ("%s : %s" % (key, value))
        print ("======================================================")
        print ("= Request body =")
        body = self.request_body if verbose else make_ellipsis(self.request_body)
        print (body)
        print ("======================================================")

    def show_response(self, verbose):
        print ("** RESPONSE **")
        print ("======================================================")
        print ("Status code : %s" % self.response.status_code)
        print ("Status reasone : %s" % self.response.reason)
        print ("======================================================")
        print ("= Response header =")
        for key, value in self.response.headers.items():
            print ("%s : %s" % (key, value))
        print ("======================================================")
        print ("= Response body =")
        body = self.response.text.encode("utf-8") if verbose else make_ellipsis(self.response.text.encode("utf-8"))
        print (body)
        print ("======================================================")


text:
package com.gzlk.android.isp.api.activity;

import android.support.annotation.NonNull;

import com.gzlk.android.isp.api.query.SingleQuery;
import com.gzlk.android.isp.api.query.PaginationQuery;
import com.gzlk.android.isp.api.Request;
import com.gzlk.android.isp.api.listener.OnMultipleRequestListener;
import com.gzlk.android.isp.api.listener.OnSingleRequestListener;
import com.gzlk.android.isp.model.activity.sign.AppSignRecord;
import com.gzlk.android.isp.model.activity.sign.AppSigning;
import com.litesuits.http.request.param.HttpMethods;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

/**
 * 功能描述:活动应用:签到

 * 创建作者:Hsiang Leekwok

 * 创建时间:2017/05/26 00:37

 * 作者邮箱:xiang.l.g@gmail.com

 * 最新版本:Version: 1.0.0

 * 修改时间:2017/05/26 00:37

 * 修改人员:

 * 修改备注:

 */

public class AppSigningRequest extends Request<AppSigning> {

    public static AppSigningRequest request() {
        return new AppSigningRequest();
    }

    private static class SingleSigning extends SingleQuery<AppSigning> {
    }

    private static class MultipleSigning extends PaginationQuery<AppSigning> {
    }

    @Override
    protected String url(String action) {
        return format("/activity/actSignInSetup%s", action);
    }

    @Override
    protected Class<AppSigning> getType() {
        return AppSigning.class;
    }

    @Override
    public AppSigningRequest setOnSingleRequestListener(OnSingleRequestListener<AppSigning> listener) {
        onSingleRequestListener = listener;
        return this;
    }

    @Override
    public AppSigningRequest setOnMultipleRequestListener(OnMultipleRequestListener<AppSigning> listListener) {
        onMultipleRequestListener = listListener;
        return this;
    }

    @Override
    protected void save(AppSigning appSigning) {
        AppSignRecord.save(appSigning.getActSignInList());
        super.save(appSigning);
    }

    @Override
    protected void save(List<AppSigning> list) {
        if (null != list) {
            for (AppSigning signing : list) {
                AppSignRecord.save(signing.getActSignInList());
            }
        }
        super.save(list);
    }

    /**
     * 添加新的活动签到条目
     */
    public void add(AppSigning signing) {
        // {actId,title,content,lon,lat,alt,site,beginDate,endDate}
        JSONObject object = new JSONObject();
        try {
            object.put("actId", signing.getActId())
                    .put("title", signing.getTitle())
                    .put("content", signing.getContent())
                    .put("lon", signing.getLon())
                    .put("lat", signing.getLat())
                    .put("alt", signing.getAlt())
                    .put("site", signing.getSite())
                    .put("beginDate", signing.getBeginDate())
                    .put("endDate", signing.getEndDate());
        } catch (JSONException e) {
            e.printStackTrace();
        }
        httpRequest(getRequest(SingleSigning.class, url(ADD), object.toString(), HttpMethods.Post));
    }

    /**
     * 增加活动签到条目
     *
     * @param activityId  活动id
     * @param title       签到应用的标题
     * @param description 描述
     * @param longitude   目的地经度
     * @param latitude    目的地纬度
     * @param altitude    目的地海拔高度
     * @param beginTime   签到开始时间
     * @param endTime     签到结束时间
     */
    @Deprecated
    public void add(@NonNull String activityId, String title, String description,
                    double longitude, double latitude, double altitude, String beginTime, String endTime) {
        // {actId:"",title:"",desc:"",lon:"",lat:"",alt:"",beginTime:"",endTime:"",accessToken:""}

        JSONObject object = new JSONObject();
        try {
            object.put("actId", activityId)
                    .put("title", title)
                    .put("desc", description)
                    .put("lon", longitude)
                    .put("lat", latitude)
                    .put("alt", altitude)
                    .put("beginTime", beginTime)
                    .put("endTime", endTime);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        httpRequest(getRequest(SingleSigning.class, url(ADD), object.toString(), HttpMethods.Post));
    }

    /**
     * 删除签到应用
     */
    public void delete(String signingId) {
        //id=""
        httpRequest(getRequest(SingleSigning.class, format("%s?id=%s", url(DELETE), signingId), "", HttpMethods.Get));
    }

    /**
     * 更新签到应用详情
     *
     * @param signingId   签到应用的id
     * @param title       签到应用的标题
     * @param description 描述
     * @param longitude   目的地经度
     * @param latitude    目的地纬度
     * @param altitude    目的地海拔高度
     * @param beginTime   签到开始时间
     * @param endTime     签到结束时间
     */
    public void update(@NonNull String signingId, String title, String description,
                       double longitude, double latitude, double altitude, String beginTime, String endTime) {
        // {id:"",title:"",desc:"",lon:"",lat:"",alt:"",beginTime:"",endTime:"",accessToken:""}

        JSONObject object = new JSONObject();
        try {
            object.put("id", signingId)
                    .put("title", title)
                    .put("desc", description)
                    .put("lon", longitude)
                    .put("lat", latitude)
                    .put("alt", altitude)
                    .put("beginTime", beginTime)
                    .put("endTime", endTime);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        httpRequest(getRequest(SingleSigning.class, url(UPDATE), object.toString(), HttpMethods.Post));
    }

    /**
     * 只查询签到内容
     */
    public static final int FIND_SIGN = 1;
    /**
     * 同时查询签到内容和签到记录
     */
    public static final int FIND_RECORD = 2;

    /**
     * 查找单个签到应用的详情
     *
     * @param signId 签到应用的id
     * @param option 操作类型(1.查询签到设置,2:查询签到设置和所有签到记录)
     */
    public void find(@NonNull String signId, int option) {
        if (option <= FIND_SIGN) {
            option = FIND_SIGN;
        }
        if (option >= FIND_RECORD) {
            option = FIND_RECORD;
        }
        httpRequest(getRequest(SingleSigning.class, format("%s?id=%s&ope=%d", url(FIND), signId, option), "", HttpMethods.Get));
    }

    /**
     * 查询活动中的签到应用列表
     */
    public void list(@NonNull String activityId, int pageNumber) {
        // actId,pageSize,pageNumber
        httpRequest(getRequest(MultipleSigning.class, format("%s?actId=%s&pageNumber=%d", url(LIST), activityId, pageNumber), "", HttpMethods.Get));
    }
}


text:
<?php
declare(strict_types=1);

namespace ManaPHP\Event;

interface EmitterInterface
{
    public function on(string $event, callable $handler): void;

    public function emit(string $event, mixed $data = null): mixed;
}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

class SGraphNodeSequencePlayer : public SGraphNode
{
public:
	SLATE_BEGIN_ARGS(SGraphNodeSequencePlayer){}
	SLATE_END_ARGS()

	void Construct(const FArguments& InArgs, UK2Node* InNode);

	// SNodePanel::SNode interface
	virtual void GetNodeInfoPopups(FNodeInfoContext* Context, TArray<FGraphInformationPopupInfo>& Popups) const override;
	// End of SNodePanel::SNode interface

	// SGraphNode interface
	virtual void UpdateGraphNode() override;
	virtual void CreateBelowWidgetControls(TSharedPtr<SVerticalBox> MainBox) override;
	// End of SGraphNode interface

protected:
	/** Get the sequence player associated with this graph node */
	struct FAnimNode_SequencePlayer* GetSequencePlayer() const;
	EVisibility GetSliderVisibility() const;
	float GetSequencePositionRatio() const;
	void SetSequencePositionRatio(float NewRatio);

	FText GetPositionTooltip() const;

	bool GetSequencePositionInfo(float& Out_Position, float& Out_Length, int32& FrameCount) const;
};