text:
#include "acutads.h"	// acutPrintf

// AcDb support
#include "dbsubeid.h"

// ObjectARX support
#include "rxobject.h"

// AcGe support
#include "gegbl.h"
#include "geextc3d.h"
#include "geray3d.h"
#include "gelnsg3d.h"
#include "geell3d.h"
#include "genurb3d.h"

// AcBr support
#include "brbrep.h"

// AcBr sample app support
#include "brreport.h"
#include "brgeutl.h"
#include "bredump.h"
#include "brvdump.h"

// Abbreviations
#include "brgblabb.h"

// local function prototypes
static AcBr::ErrorStatus edgeVertexDump(const AcBrEdge& edgeEntity);

AcBr::ErrorStatus
edgeDump(const AcBrEdge& edgeEntity)
{
	AcBr::ErrorStatus returnValue = AcBr::eOk;

	// Verify that AcBr was explicitly and not implicitly loaded,
	// by testing ObjectARX functions (which are unavailable unless
	// explicitly loaded)
    if (edgeEntity.isA() == NULL) {
        acutPrintf("\n edgeDump: AcBrEntity::isA() failed\n");
        return returnValue;
    }
    if (!edgeEntity.isKindOf(AcBrEdge::desc())) {
        acutPrintf("\n edgeDump: AcBrEntity::isKindOf() failed\n");
        return returnValue;
    }
	AcBrEntity* entClass = (AcBrEntity*)&edgeEntity;
	AcBrFace* pFace = AcBrFace::cast(entClass);
	if (pFace != NULL) {
		acutPrintf("\n edgeDump: AcBrEntity::cast() failed\n");
        return (AcBrErrorStatus)Acad::eNotThatKindOfClass;
	}

	// validate the brep "owner" of the edge
	AcBrBrep brepOwner;
	returnValue = edgeEntity.getBrep(brepOwner);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in AcBrEdge::getBrep:");
		errorReport(returnValue);
		return returnValue;
	}

	AcGe::EntityId entId;
	returnValue = edgeEntity.getCurveType(entId);
	if (returnValue != AcBr::eOk) {
		if (returnValue == (AcBr::ErrorStatus)Acad::eDegenerateGeometry) {
			acutPrintf("\n Degenerate edge geometry: apex of cone");
			returnValue = edgeVertexDump(edgeEntity);
			if (returnValue != AcBr::eOk) {
				acutPrintf("\n Error in edgeVertexDump:");
				errorReport(returnValue);
				return returnValue;
			}
		} else {
			acutPrintf("\n Error in AcBrEdge::getCurveType:");
			errorReport(returnValue);
			return returnValue;
		}
	}

	AcGeCurve3d* curveGeometry = NULL;
    AcGeCurve3d* nativeGeometry = NULL;

	returnValue = getNativeCurve(edgeEntity, curveGeometry, nativeGeometry);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in getNativeCurve:");
		errorReport(returnValue);
		delete curveGeometry;
		delete nativeGeometry;
		return returnValue;
	}

	switch (entId) {
    case(kLine3d):
	{
		acutPrintf("\nCurve Type: Line\n");
        AcGeLine3d* lineGeometry = (AcGeLine3d*)nativeGeometry;
        AcGePoint3d pt = lineGeometry->pointOnLine();
        AcGeVector3d dir = lineGeometry->direction();
		acutPrintf("\nCurve Definition Data Begin:\n");
		acutPrintf(" Point on Line is (");
		acutPrintf ("%lf , ", pt.x);
		acutPrintf ("%lf , ", pt.y);
		acutPrintf ("%lf ", pt.z);
		acutPrintf(")\n");
		acutPrintf(" Line direction is (");
		acutPrintf ("%lf , ", dir.x);
		acutPrintf ("%lf , ", dir.y);
		acutPrintf ("%lf ", dir.z);
		acutPrintf(")\n");
		acutPrintf("Curve Definition Data End\n");
		break;
    }

	case(kRay3d):
	{
		acutPrintf("\nCurve Type: Ray\n");
        AcGeRay3d* rayGeometry = (AcGeRay3d*)nativeGeometry;
        AcGePoint3d pt = rayGeometry->pointOnLine();
        AcGeVector3d dir = rayGeometry->direction();
		acutPrintf("\nCurve Definition Data Begin:\n");
		acutPrintf(" Point on Ray is (");
		acutPrintf ("%lf , ", pt.x);
		acutPrintf ("%lf , ", pt.y);
		acutPrintf ("%lf ", pt.z);
		acutPrintf(")\n");
		acutPrintf(" Ray direction is (");
		acutPrintf ("%lf , ", dir.x);
		acutPrintf ("%lf , ", dir.y);
		acutPrintf ("%lf ", dir.z);
		acutPrintf(")\n");
		acutPrintf("Curve Definition Data End\n");
		break;
    }

    case(kLineSeg3d):
	{
		acutPrintf("\nCurve Type: Line Segment\n");
        AcGeLineSeg3d* segGeometry = (AcGeLineSeg3d*)nativeGeometry;
        AcGePoint3d pt = segGeometry->pointOnLine();
        AcGeVector3d dir = segGeometry->direction();
		acutPrintf("\nCurve Definition Data Begin:\n");
		acutPrintf(" Point on Line Segment is (");
		acutPrintf ("%lf , ", pt.x);
		acutPrintf ("%lf , ", pt.y);
		acutPrintf ("%lf ", pt.z);
		acutPrintf(")\n");
		acutPrintf(" Line Segment direction is (");
		acutPrintf ("%lf , ", dir.x);
		acutPrintf ("%lf , ", dir.y);
		acutPrintf ("%lf ", dir.z);
		acutPrintf(")\n");
		acutPrintf("Curve Definition Data End\n");
        AcGePoint3d pt1, pt2;
		acutPrintf("\nCurve Subset Data Begin:\n");
        if (segGeometry->hasStartPoint(pt1)) {
            acutPrintf("\n Line Segment start point is(");
    		acutPrintf ("%lf , ", pt1.x);
    		acutPrintf ("%lf , ", pt1.y);
    		acutPrintf ("%lf ", pt1.z);
    		acutPrintf(")\n");
        }
        if (segGeometry->hasEndPoint(pt2)) {
            acutPrintf("\n Line Segment end point is(");
    		acutPrintf ("%lf , ", pt2.x);
    		acutPrintf ("%lf , ", pt2.y);
    		acutPrintf ("%lf ", pt2.z);
    		acutPrintf(")\n");
        }
		acutPrintf("Curve Subset Data End\n");
		break;
    }

	case(kEllipArc3d):
    {
		acutPrintf("\nCurve Type: Elliptic Arc\n");
        AcGeEllipArc3d* ellipGeometry = (AcGeEllipArc3d*)nativeGeometry;
        AcGePoint3d centre = ellipGeometry->center();
        AcGePoint3d start = ellipGeometry->startPoint();
        AcGePoint3d end = ellipGeometry->endPoint();
		acutPrintf("\nCurve Definition Data Begin:\n");
		acutPrintf(" Elliptic Arc centre is (");
		acutPrintf ("%lf , ", centre.x);
		acutPrintf ("%lf , ", centre.y);
		acutPrintf ("%lf ", centre.z);
		acutPrintf(")\n");
		acutPrintf(" Elliptic Arc major radius is %lf\n", ellipGeometry->majorRadius());
		acutPrintf(" Elliptic Arc minor radius is %lf\n", ellipGeometry->minorRadius());
		acutPrintf(" Elliptic Arc start angle is %lf\n", ellipGeometry->startAng());
		acutPrintf(" Elliptic Arc end angle is %lf\n", ellipGeometry->endAng());
		acutPrintf(" Elliptic Arc start point  is (");
		acutPrintf ("%lf , ", start.x);
		acutPrintf ("%lf , ", start.y);
		acutPrintf ("%lf ", start.z);
		acutPrintf(")\n");
		acutPrintf(" Elliptic Arc end point is (");
		acutPrintf ("%lf , ", end.x);
		acutPrintf ("%lf , ", end.y);
		acutPrintf ("%lf ", end.z);
		acutPrintf(")\n");
		acutPrintf("Curve Definition Data End\n");
        AcGePoint3d pt1, pt2;
		acutPrintf("\nCurve Subset Data Begin:\n");
        if (ellipGeometry->hasStartPoint(pt1)) {
            acutPrintf("\n Elliptic Arc start point is(");
    		acutPrintf ("%lf , ", pt1.x);
    		acutPrintf ("%lf , ", pt1.y);
    		acutPrintf ("%lf ", pt1.z);
    		acutPrintf(")\n");
        }
        if (ellipGeometry->hasEndPoint(pt2)) {
            acutPrintf("\n Elliptic Arc end point is(");
    		acutPrintf ("%lf , ", pt2.x);
    		acutPrintf ("%lf , ", pt2.y);
    		acutPrintf ("%lf ", pt2.z);
    		acutPrintf(")\n");
        }
		acutPrintf("Curve Subset Data End\n");
		break;
    }

	case(kCircArc3d):
    {
		acutPrintf("\nCurve Type: Circular Arc\n");
        AcGeCircArc3d* circGeometry = (AcGeCircArc3d*)nativeGeometry;
        AcGePoint3d centre = circGeometry->center();
        AcGePoint3d start = circGeometry->startPoint();
        AcGePoint3d end = circGeometry->endPoint();
		acutPrintf("\nCurve Definition Data Begin:\n");
		acutPrintf(" Circular Arc centre is (");
		acutPrintf ("%lf , ", centre.x);
		acutPrintf ("%lf , ", centre.y);
		acutPrintf ("%lf ", centre.z);
		acutPrintf(")\n");
		acutPrintf(" Circular Arc radius is %lf\n", circGeometry->radius());
		acutPrintf(" Circular Arc start angle is %lf\n", circGeometry->startAng());
		acutPrintf(" Circular Arc end angle is %lf\n", circGeometry->endAng());
		acutPrintf(" Circular Arc start point  is (");
		acutPrintf ("%lf , ", start.x);
		acutPrintf ("%lf , ", start.y);
		acutPrintf ("%lf ", start.z);
		acutPrintf(")\n");
		acutPrintf(" Circular Arc end point is (");
		acutPrintf ("%lf , ", end.x);
		acutPrintf ("%lf , ", end.y);
		acutPrintf ("%lf ", end.z);
		acutPrintf(")\n");
		acutPrintf("Curve Definition Data End\n");
        AcGePoint3d pt1, pt2;
		acutPrintf("\nCurve Subset Data Begin:\n");
        if (circGeometry->hasStartPoint(pt1)) {
            acutPrintf("\n Circular Arc start point is(");
    		acutPrintf ("%lf , ", pt1.x);
    		acutPrintf ("%lf , ", pt1.y);
    		acutPrintf ("%lf ", pt1.z);
    		acutPrintf(")\n");
        }
        if (circGeometry->hasEndPoint(pt2)) {
            acutPrintf("\n Circular Arc end point is(");
    		acutPrintf ("%lf , ", pt2.x);
    		acutPrintf ("%lf , ", pt2.y);
    		acutPrintf ("%lf ", pt2.z);
    		acutPrintf(")\n");
        }
		acutPrintf("Curve Subset Data End\n");
		break;
    }

	case(kNurbCurve3d):
    {
		acutPrintf("\nCurve Type: 3D NURB Curve\n");
        AcGeNurbCurve3d* nurbGeometry = (AcGeNurbCurve3d*)nativeGeometry;
		acutPrintf("\nCurve Definition Data Begin:\n");
		int i, nCtrlPts, nKnots, nWeights;
		acutPrintf("\n **3D NURB Curve of degree %d and order %d\n",
			nurbGeometry->degree(), nurbGeometry->order());

		nCtrlPts = nurbGeometry->numControlPoints();
		acutPrintf("\n **3D NURB Curve has %d control points\n", nCtrlPts);
		for(i=0; i<nCtrlPts; i++) {
			acutPrintf("\n ***Control point [%d] (%lf, %lf, %lf)\n", i,
				nurbGeometry->controlPointAt(i).x,
				nurbGeometry->controlPointAt(i).y,
				nurbGeometry->controlPointAt(i).z);
		}

		nKnots = nurbGeometry->numKnots();
		acutPrintf("\n **3D NURB Curve has %d knots\n", nKnots);
	   	for (i=0; i<nKnots; i++) {
			acutPrintf("\n ***Knot [%d] %lf\n", i,
				nurbGeometry->knotAt(i));
		}

		nWeights = nurbGeometry->numWeights();
		acutPrintf("\n **3D NURB Curve has %d weights\n", nWeights);
		for (i=0; i<nWeights; i++) {
			acutPrintf("\n ***Weight [%d] %lf\n", i,
				nurbGeometry->weightAt(i));
		}
		acutPrintf("Curve Definition Data End\n");
        AcGePoint3d pt1, pt2;
		acutPrintf("\nCurve Subset Data Begin:\n");
        if (nurbGeometry->hasStartPoint(pt1)) {
            acutPrintf("\n **3D NURB Curve start point is(");
    		acutPrintf ("%lf , ", pt1.x);
    		acutPrintf ("%lf , ", pt1.y);
    		acutPrintf ("%lf ", pt1.z);
    		acutPrintf(")\n");
        }
        if (nurbGeometry->hasEndPoint(pt2)) {
            acutPrintf("\n **3D NURB Curve end point is(");
    		acutPrintf ("%lf , ", pt2.x);
    		acutPrintf ("%lf , ", pt2.y);
    		acutPrintf ("%lf ", pt2.z);
    		acutPrintf(")\n");
        }
		acutPrintf("Curve Subset Data End\n");
		break;
    }

	default:
		acutPrintf("\nCurve Type: Unexpected Non Curve\n");
		return (AcBrErrorStatus)Acad::eInvalidInput;
		break;
	} // end switch(entId)
    delete nativeGeometry;

    // Evaluate the curve
	AcGeInterval intrvl;
	((AcGeExternalCurve3d*)curveGeometry)->getInterval(intrvl);
    // Make sure the interval is legal and bounded
    if ((intrvl.isBounded()) && (intrvl.length() >= 0.0)) {
		double midParam = intrvl.lowerBound() + (intrvl.length() / 2.0);
		AcGePoint3d pointOnCurve =
			((AcGeExternalCurve3d*)curveGeometry)->evalPoint(midParam);
		AcGePoint3d startPoint =
			((AcGeExternalCurve3d*)curveGeometry)->evalPoint(intrvl.lowerBound());
		AcGePoint3d endPoint =
			((AcGeExternalCurve3d*)curveGeometry)->evalPoint(intrvl.upperBound());
		acutPrintf("\nCurve Evaluation Begin:\n");
		acutPrintf(" Parameterisation is (");
        acutPrintf("%lf, ", intrvl.lowerBound());
        acutPrintf("%lf ", intrvl.upperBound());
        acutPrintf(")\n");
		acutPrintf(" Parameter space mid-point is %lf\n", midParam);
		acutPrintf(" Point on curve is (");
		acutPrintf ("%lf , ", pointOnCurve.x);
		acutPrintf ("%lf , ", pointOnCurve.y);
		acutPrintf ("%lf ", pointOnCurve.z);
		acutPrintf(")\n");
		acutPrintf(" Curve start point is (");
		acutPrintf ("%lf , ", startPoint.x);
		acutPrintf ("%lf , ", startPoint.y);
		acutPrintf ("%lf ", startPoint.z);
		acutPrintf(")\n");
		acutPrintf(" Curve end point is (");
		acutPrintf ("%lf , ", endPoint.x);
		acutPrintf ("%lf , ", endPoint.y);
		acutPrintf ("%lf ", endPoint.z);
		acutPrintf(")\n");
		acutPrintf("Curve Evaluation End\n");
    }
    delete curveGeometry;

	Adesk::Boolean oriented;
	returnValue = edgeEntity.getOrientToCurve(oriented);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in AcBrEdge::getOrientToCurve:");
        errorReport(returnValue);
		return returnValue;
	}
	oriented ? acutPrintf("\nCurve Orientation is Positive\n")
	    : acutPrintf("\nCurve Orientation is Negative\n");

	returnValue = edgeVertexDump(edgeEntity);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in edgeVertexDump:");
        errorReport(returnValue);
        return returnValue;
	}

	return returnValue;
}

static AcBr::ErrorStatus
edgeVertexDump(const AcBrEdge& edgeEntity)
{
	AcBr::ErrorStatus returnValue = AcBr::eOk;

	AcBrVertex startVertex;
	returnValue	= edgeEntity.getVertex1(startVertex);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in AcBrEdge::getVertex1:");
        errorReport(returnValue);
        return returnValue;
	}
	if (!startVertex.isNull()) {
		acutPrintf("\nCoordinate of vertex1 : ");
		returnValue	= vertexDump(startVertex);
		if (returnValue != AcBr::eOk) {
		    acutPrintf("\n Error in vertexDump:");
		    errorReport(returnValue);
			return returnValue;
		}
	}

	AcBrVertex endVertex;
	returnValue	= edgeEntity.getVertex2(endVertex);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in AcBrEdge::getVertex2:");
        errorReport(returnValue);
        return returnValue;
	}
	if (!endVertex.isNull()) {
		acutPrintf("\nCoordinate of vertex2: ");
		returnValue = vertexDump(endVertex);
		if (returnValue != AcBr::eOk) {
		    acutPrintf("\n Error in vertexDump:");
		    errorReport(returnValue);
			return returnValue;
		}
	}

	AcBrVertex newVertex;
	AcDbFullSubentPath subPath;
	returnValue = endVertex.get(subPath);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in AcBrVertex::get:");
        errorReport(returnValue);
        return returnValue;
	}
	returnValue = newVertex.set(subPath);
	if (returnValue != AcBr::eOk) {
		acutPrintf("\n Error in AcBrVertex::set:");
        errorReport(returnValue);
        return returnValue;
	}
	if (!newVertex.isEqualTo(&endVertex)) {
		acutPrintf("\n Vertex copy is unequal");
	}

	return returnValue;
}


text:
var fast = require('../'),
    underscore = require('underscore'),
    lodash = require('lodash'),
    history = require('../test/history'),
    utils = require('./utils');

var fns = utils.fns('last', 'item', 'return last * item + Math.random()');

var input = [1,2,3];

exports['Array::reduce()'] = function () {
  return input.reduce(fns(), 0);
};

exports['fast.reduce()'] = function () {
  return fast.reduce(input, fns(), 0);
};

exports['fast.reduce() v0.0.2c'] = function () {
  return history.reduce_0_0_2c(input, fns(), 0);
};

exports['fast.reduce() v0.0.2b'] = function () {
  return history.reduce_0_0_2b(input, fns(), 0);
};

exports['fast.reduce() v0.0.2a'] = function () {
  return history.reduce_0_0_2a(input, fns(), 0);
};

exports['fast.reduce() v0.0.1'] = function () {
  return history.reduce_0_0_1(input, fns(), 0);
};

exports['fast.reduce() v0.0.0'] = function () {
  return history.reduce_0_0_0(input, fns(), 0);
};

exports['underscore.reduce()'] = function () {
  return underscore.reduce(input, fns(), 0);
};

exports['lodash.reduce()'] = function () {
  return lodash.reduce(input, fns(), 0);
};

redpajama_set_name: RedPajamaGithub


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Class** | Pointer to **string** |  | [optional]
**Name** | Pointer to **string** |  | [optional]
**Url** | Pointer to **string** |  | [optional]

## Methods

### NewAllView

`func NewAllView() *AllView`

NewAllView instantiates a new AllView object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewAllViewWithDefaults

`func NewAllViewWithDefaults() *AllView`

NewAllViewWithDefaults instantiates a new AllView object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetClass

`func (o *AllView) GetClass() string`

GetClass returns the Class field if non-nil, zero value otherwise.

### GetClassOk

`func (o *AllView) GetClassOk() (*string, bool)`

GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetClass

`func (o *AllView) SetClass(v string)`

SetClass sets Class field to given value.

### HasClass

`func (o *AllView) HasClass() bool`

HasClass returns a boolean if a field has been set.

### GetName

`func (o *AllView) GetName() string`

GetName returns the Name field if non-nil, zero value otherwise.

### GetNameOk

`func (o *AllView) GetNameOk() (*string, bool)`

GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetName

`func (o *AllView) SetName(v string)`

SetName sets Name field to given value.

### HasName

`func (o *AllView) HasName() bool`

HasName returns a boolean if a field has been set.

### GetUrl

`func (o *AllView) GetUrl() string`

GetUrl returns the Url field if non-nil, zero value otherwise.

### GetUrlOk

`func (o *AllView) GetUrlOk() (*string, bool)`

GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetUrl

`func (o *AllView) SetUrl(v string)`

SetUrl sets Url field to given value.

### HasUrl

`func (o *AllView) HasUrl() bool`

HasUrl returns a boolean if a field has been set.

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
package iso20022

// Details of the intra-position movement.
type IntraPositionDetails39 struct {

	// Collective reference identifying a set of messages.
	PoolIdentification *Max35Text `xml:"PoolId,omitempty"`

	// Party that legally owns the account.
	AccountOwner *PartyIdentification92Choice `xml:"AcctOwnr,omitempty"`

	// Account to or from which a securities entry is made.
	SafekeepingAccount *SecuritiesAccount19 `xml:"SfkpgAcct"`

	// Financial instruments representing a sum of rights of the investor vis-a-vis the issuer.
	FinancialInstrumentIdentification *SecurityIdentification19 `xml:"FinInstrmId"`

	// Total quantity of securities to be settled.
	SettlementQuantity *FinancialInstrumentQuantity1Choice `xml:"SttlmQty"`

	// Number identifying a lot constituting the financial instrument.
	LotNumber *GenericIdentification37 `xml:"LotNb,omitempty"`

	// Date and time at which the securities are to be moved.
	SettlementDate *DateAndDateTimeChoice `xml:"SttlmDt"`

	// Time stamp on when the transaction is acknowledged.
	AcknowledgedStatusTimeStamp *ISODateTime `xml:"AckdStsTmStmp,omitempty"`

	// Balance from which the securities are moving.
	BalanceFrom *SecuritiesBalanceType7Choice `xml:"BalFr,omitempty"`

	// Balance to which the securities are moving.
	BalanceTo *SecuritiesBalanceType7Choice `xml:"BalTo,omitempty"`
}

func (i *IntraPositionDetails39) SetPoolIdentification(value string) {
	i.PoolIdentification = (*Max35Text)(&value)
}

func (i *IntraPositionDetails39) AddAccountOwner() *PartyIdentification92Choice {
	i.AccountOwner = new(PartyIdentification92Choice)
	return i.AccountOwner
}

func (i *IntraPositionDetails39) AddSafekeepingAccount() *SecuritiesAccount19 {
	i.SafekeepingAccount = new(SecuritiesAccount19)
	return i.SafekeepingAccount
}

func (i *IntraPositionDetails39) AddFinancialInstrumentIdentification() *SecurityIdentification19 {
	i.FinancialInstrumentIdentification = new(SecurityIdentification19)
	return i.FinancialInstrumentIdentification
}

func (i *IntraPositionDetails39) AddSettlementQuantity() *FinancialInstrumentQuantity1Choice {
	i.SettlementQuantity = new(FinancialInstrumentQuantity1Choice)
	return i.SettlementQuantity
}

func (i *IntraPositionDetails39) AddLotNumber() *GenericIdentification37 {
	i.LotNumber = new(GenericIdentification37)
	return i.LotNumber
}

func (i *IntraPositionDetails39) AddSettlementDate() *DateAndDateTimeChoice {
	i.SettlementDate = new(DateAndDateTimeChoice)
	return i.SettlementDate
}

func (i *IntraPositionDetails39) SetAcknowledgedStatusTimeStamp(value string) {
	i.AcknowledgedStatusTimeStamp = (*ISODateTime)(&value)
}

func (i *IntraPositionDetails39) AddBalanceFrom() *SecuritiesBalanceType7Choice {
	i.BalanceFrom = new(SecuritiesBalanceType7Choice)
	return i.BalanceFrom
}

func (i *IntraPositionDetails39) AddBalanceTo() *SecuritiesBalanceType7Choice {
	i.BalanceTo = new(SecuritiesBalanceType7Choice)
	return i.BalanceTo
}


text:
/* eslint-disable class-methods-use-this */
import React from 'react';
import PropTypes from 'prop-types';

import { ListRow, TextInput } from '@ichef/gypcrete';

import formRow, { rowPropTypes } from './mixins/formRow';

/**
 * It's simply a `<TextInput>` inside a `<ListRow>` with vertically-reversed form layout.
 * Most props should go into `<TextInput>`.
 */
function TextInputRow({
  // from formRow()
  readOnly,
  disabled,
  rowProps,
  children,
  ...inputProps
}) {
  const { ineditable, ...otherInputProps } = inputProps; // unwanted prop
  return (
    <ListRow {...rowProps}>
      <TextInput
        readOnly={readOnly}
        disabled={disabled}
        {...otherInputProps}
      />
      {children}
    </ListRow>
  );
}

TextInputRow.propTypes = {
  // from formRow()
  readOnly: PropTypes.bool.isRequired,
  disabled: PropTypes.bool.isRequired,
  rowProps: rowPropTypes.isRequired,
};

export { TextInputRow as PureTextInputRow };
export default formRow()(TextInputRow);


text:
//-----------------------------------------------------------------------
// <copyright file="Scope.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2016 Lightbend Inc. <http://www.lightbend.com>
//     Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using System;

namespace Akka.Actor
{
    /// <summary>
    /// Defines the scope of a <see cref="Deploy"/>
    ///
    /// Valid values are:
    ///
    /// * Local - this actor will be deployed locally in this process
    /// * Remote - this actor will be deployed remotely on another system
    /// * Cluster - this actor will be deployed into a cluster of remote processes
    /// </summary>
    public abstract class Scope : IEquatable<Scope>
    {
        public static readonly LocalScope Local = LocalScope.Instance;

        public abstract Scope WithFallback(Scope other);

        public abstract Scope Copy();

        public virtual bool Equals(Scope other)
        {
            if (other == null) return false;

            //we don't do equality checks on fallbacks
            return GetType() == other.GetType();
        }
    }

    /// <summary>
    /// Place-holder for when a scope of this deployment has not been specified yet
    /// </summary>
    internal class NoScopeGiven : Scope
    {
        private NoScopeGiven() { }

        private static readonly NoScopeGiven _instance = new NoScopeGiven();

        public static NoScopeGiven Instance
        {
            get { return _instance; }
        }

        public override Scope WithFallback(Scope other)
        {
            return other;
        }

        public override Scope Copy()
        {
            return Instance;
        }
    }
}


text:
/* global describe, test, expect */

import {
  addLocale,
  addLocales,
  getLocale,
  setLocale,
  setLocaleGetter,
  getTranslations,
  setTranslations,
  setTranslationsGetter,
  setHandleMissingTranslation,
  translate,
  localize,
  t,
  l,
  forceComponentsUpdate,
  Translate,
  Localize,
  I18n,
} from '../src';

describe('index.js', () => {
  const exportedFunctions = [
    addLocale,
    addLocales,
    getLocale,
    setLocale,
    setLocaleGetter,
    getTranslations,
    setTranslations,
    setTranslationsGetter,
    setHandleMissingTranslation,
    translate,
    localize,
    t,
    l,
    forceComponentsUpdate,
    Translate,
    Localize,
    I18n,
  ];

  exportedFunctions.forEach((exportedFunction) => {
    test(`should export ${exportedFunction.name} function`, () => {
      expect(exportedFunction).toBeDefined();
    });
  });
});


text:
SfDataSet::SfDataSet(bool use_bias_term)
  : use_bias_term_(use_bias_term) {
}

SfDataSet::SfDataSet(const string& file_name,
		     int buffer_mb,
		     bool use_bias_term)
  : use_bias_term_(use_bias_term) {
  long int buffer_size = buffer_mb * 1024 * 1024;
  char* local_buffer = new char[buffer_size];
  std::ifstream file_stream(file_name.c_str(), std::ifstream::in);
  file_stream.rdbuf()->pubsetbuf(local_buffer, buffer_size);
  if (!file_stream) {
    std::cerr << "Error reading file " << file_name << std::endl;
    exit(1);
  }

  string line_string;
  while (getline(file_stream, line_string)) {
    AddVector(line_string);
  }

  delete[] local_buffer;
}

string SfDataSet::AsString() const {
  string out_string;
  for (unsigned long int i = 0; i < vectors_.size(); ++i) {
    out_string += VectorAt(i).AsString() + "\n";
  }
  return out_string;
}

const SfSparseVector& SfDataSet::VectorAt(long int index) const {
  assert (index >= 0 &&
	  static_cast<unsigned long int>(index) < vectors_.size());
  return vectors_[index];
}

void SfDataSet::AddVector(const string& vector_string) {
  vectors_.push_back(SfSparseVector(vector_string.c_str(),
				    use_bias_term_));
}

void SfDataSet::AddVector(const char* vector_string) {
  vectors_.push_back(SfSparseVector(vector_string,
				    use_bias_term_));
}

void SfDataSet::AddLabeledVector(const SfSparseVector& x, float y) {
  vectors_.push_back(x);
  vectors_[vectors_.size() - 1].SetY(y);
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using entCMS.Models;

namespace entCMS.Services
{
    public class ModuleService : BaseService<cmsModule>
    {
        #region 私有构造函数,防止实例化
        private ModuleService()
        {
        }
        #endregion

        #region 实现单例模式
        static ModuleService()
        {
            if (instance == null)
            {
                lock (lockObj)
                {
                    instance = new ModuleService();
                }
            }
        }

        public static ModuleService GetInstance()
        {
            return (ModuleService)instance;
        }
        #endregion
        /// <summary>
        ///
        /// </summary>
        /// <param name="isEnabled"></param>
        /// <returns></returns>
        public List<cmsModule> GetList(bool? isEnabled)
        {
            if (isEnabled.HasValue)
            {
                return GetList(cmsModule._.IsEnabled == (isEnabled.Value ? 1 : 0), cmsModule._.OrderNo.Asc);
            }
            else
            {
                return GetList(null, null);
            }
        }
    }
}


text:
import sys

from settings import ROOT_PATH

sys.path.append(ROOT_PATH)

reload(sys)
sys.setdefaultencoding('utf-8')

import argparse
import atexit
import traceback
from signal import signal, SIGTERM, SIGINT, SIGQUIT

from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop

from misc import singleton, daemonize

@singleton
class AppManager(object):
    def __init__(self):
        self.app = None

    def start(self, option):

        if __debug__:
            print option

        from gateway import JmonitorApplication
        self.app = JmonitorApplication({
            "debug": option.debug
        })

        HTTPServer(self.app).listen(option.port)
        loop = IOLoop.instance()
        try:
            loop.start()
        except KeyboardInterrupt:
            print(" Shutting down on SIGINT!")
            loop.stop()
            traceback.format_exc()
        finally:
            pass

    def get_app(self):
        return self.app

def term_sig_handler(signum, frame):
    print 'catched singal: %d' % signum, frame
    sys.exit(0)

@atexit.register
def atexit_fun():
    exc_type, exc_value, exc_tb = sys.exc_info()
    traceback.print_exception(exc_type, exc_value, exc_tb)

if __name__ == "__main__":

    signal(SIGTERM, term_sig_handler)
    signal(SIGINT, term_sig_handler)
    signal(SIGQUIT, term_sig_handler)

    parser = argparse.ArgumentParser(description='gateway service')
    parser.add_argument('-p', action="store", default=6752, type=int, dest='port', help='port default 6752')
    parser.add_argument('-debug', action="store", default=True, type=bool, dest='debug', help='debug default true')
    parser.add_argument('-daemon', action="store", default=False, type=bool, dest='daemon', help='daemon default false')
    p = parser.parse_args()

    if p.daemon:
        daemonize()

    print "http://{}:{}".format("localhost", p.port)

    AppManager().start(p)


text:
license: >
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
---

# batterycritical

L'evento viene generato quando la batteria ha raggiunto la soglia di livello critico.

    window.addEventListener("batterycritical", yourCallbackFunction, false);

## Dettagli

L'evento viene generato quando la percentuale di carica della batteria ha raggiunto la soglia critica di batteria. Il valore è specifico del dispositivo.

Il `batterycritical` gestore viene passato un oggetto che contiene due proprietà:

*   **livello**: la percentuale di carica della batteria (0-100). *(Numero)*

*   **isPlugged**: un valore booleano che indica se il dispositivo è collegato poll *(Boolean)*

Applicazioni in genere è necessario utilizzare `window.addEventListener` per fissare un listener di eventi una volta il `deviceready` evento incendi.

## Piattaforme supportate

*   iOS
*   Android
*   BlackBerry WebWorks (OS 5.0 e superiori)
*   Tizen

## Esempio rapido

    window.addEventListener("batterycritical", onBatteryCritical, false);

    function onBatteryCritical(info) {
        // Handle the battery critical event
        alert("Battery Level Critical " + info.level + "%\nRecharge Soon!");
    }

## Esempio completo

    <!DOCTYPE html>
    <html>
      <head>
        <title>Battery Critical Example</title>

        <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
        <script type="text/javascript" charset="utf-8">

        // Wait for device API libraries to load
        //
        function onLoad() {
            document.addEventListener("deviceready", onDeviceReady, false);
        }

        // device APIs are available
        //
        function onDeviceReady() {
            window.addEventListener("batterycritical", onBatteryCritical, false);
        }

        // Handle the batterycritical event
        //
        function onBatteryCritical(info) {
            alert("Battery Level Critical " + info.level + "%\nRecharge Soon!");
        }

        </script>
      </head>
      <body onload="onLoad()">
      </body>
    </html>


text:
<?php

declare(strict_types=1);

namespace PhpMqdb\Exception;

/**
 * EmptySetValuesException NoMessageException
 *
 * @author Romain Cottard
 */
class EmptySetValuesException extends PhpMqdbException
{
}


text:
package com.ctrip.framework.apollo;

import com.ctrip.framework.apollo.adminservice.AdminServiceApplication;
import com.ctrip.framework.apollo.common.controller.HttpMessageConverterConfiguration;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;

@Configuration
@ComponentScan(excludeFilters = {@Filter(type = FilterType.ASSIGNABLE_TYPE, value = {
        LocalAdminServiceApplication.class, AdminServiceApplication.class,
        HttpMessageConverterConfiguration.class})})
@EnableAutoConfiguration
public class AdminServiceTestConfiguration {

}


text:
package fm.jiecao.jcvideoplayer_lib;

/**
 * Created by Nathen
 * On 2016/04/26 20:53
 */
public interface JCUserActionStandard extends JCUserAction {

    int ON_CLICK_START_THUMB = 101;
    int ON_CLICK_BLANK = 102;

}


text:
// MODULES //

var // Expectation library:
	chai = require( 'chai' ),

	// Chunkify streamed data values:
	chunkStream =  require( 'flow-chunkify' ),

	// Test utilities:
	utils = require( './utils' ),

	// Module to be tested:
	meanStream = require( './../lib' );

// VARIABLES //

var expect = chai.expect,
	assert = chai.assert;

// TESTS //

describe( 'flow-cmean', function tests() {
	'use strict';

	it( 'should export a factory function', function test() {
		expect( meanStream ).to.be.a( 'function' );
	});

	it( 'should chunk streamed data values', function test( done ) {
		var data, expected, cStream, mStream, NUMVALUES = 2;

		// Simulate some data...
		data = [ 2, 3, 1.5, 2, 10, 15, 100, 102 ];

		// Expected values:
		expected = [ 2.5, 1.75, 12.5, 101 ];

		// Create a new chunkify stream:
		cStream = chunkStream()
			.numValues( NUMVALUES )
			.stream();

		// Create a new mean stream:
		mStream = meanStream().stream();

		// Create the chunkified pipeline:
		cStream.pipe( mStream );

		// Mock reading from the stream:
		utils.readStream( mStream, onRead );

		// Mock piping a data to the stream:
		utils.writeStream( data, cStream );

		return;

		/**
		* FUNCTION: onRead( error, actual )
		*	Read event handler. Checks for errors and compares streamed data to expected data.
		*/
		function onRead( error, actual ) {
			expect( error ).to.not.exist;

			for ( var i = 0; i < expected.length; i++ ) {
				assert.strictEqual(
					actual[ i ],
					expected[ i ]
				);
			}

			done();
		} // end FUNCTION onRead()
	});

});


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>HBase - Project Information</title>

    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
    <link rel="shortcut icon" href="/images/favicon.ico" />
    <meta name="Date-Revision-yyyymmdd" content="20141008" />
    <meta http-equiv="Content-Language" content="en" />

        <form method="GET" action="http://search-hadoop.com/">
          <input type="text" style="width: 192px; height: 15px; font-size: inherit; border: 1px solid darkgray" name="q" value="Search wiki, mailing lists & more" onfocus="this.value=''"/>
          <input type="hidden" name="fc_project" value="HBase"/>
          <button style="height: 20px; width: 60px;">Search</button>
        </form>

Apache HBase Project

                          Overview

                          License

                          Downloads

                          Release Notes

                          Issue Tracking

                          Mailing Lists

                          Source Repository

                          ReviewBoard

                          Team

                          Thanks

                          Blog

                          Other resources

Documentation

                          Getting Started

                          User API

                          Developer API

                          X-Ref

                          Ref Guide (multi-page)

                          Ref Guide (single-page)

                          中文参考指南(单页)

                          FAQ

                          Videos/Presentations

                          Wiki

                          ACID Semantics

                          Bulk Loads

                          Metrics

                          HBase on Windows

                          Cluster replication

0.94 Documentation

                          API

                          X-Ref

                          Ref Guide (single-page)

ASF

                          Apache Software Foundation

                          How Apache Works

                          Sponsoring Apache

Project Information

This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by Maven on behalf of the project.

Overview

Document
Description

Project Team
This document provides information on the members of this project. These are the individuals who have contributed to the project in one form or another.

Mailing Lists
This document provides subscription and archive information for this project's mailing lists.

Continuous Integration
This is a link to the definitions of all continuous integration processes that builds and tests code on a frequent, regular basis.

Issue Tracking
This is a link to the issue management system for this project. Issues (bugs, features, change requests) can be created and queried using this link.

Project License
This is a link to the definitions of project licenses.

Source Repository
This is a link to the online source repository that can be viewed via a web browser.

About
Apache HBase™ is the Hadoop database. Use it when you need
    random, realtime read/write access to your Big Data.
    This project's goal is the hosting of very large tables -- billions of rows X millions of columns -- atop clusters
    of commodity hardware.

Project Summary
This document lists other related information of this project

Dependency Information
This document describes how to to include this project as a dependency using various dependency management tools.

Project Modules
This document lists the modules (sub-projects) of this project.

Dependency Management
This document lists the dependencies that are defined through dependencyManagement.

Dependencies
This document lists the project's dependencies and provides information on each dependency.

Dependency Convergence
This document presents the convergence of dependency versions across the entire project, and its sub modules.

Plugin Management
This document lists the plugins that are defined through pluginManagement.

Project Plugins
This document lists the build plugins and the report plugins used by this project.

Distribution Management
This document provides informations on the distribution management of this project.

                 Last Published: 2014-10-08
               | Version: 0.98.7-hadoop2

Copyright ©                    2014
                        The Apache Software Foundation.
            All Rights Reserved.  Apache Hadoop, Hadoop, HDFS, HBase and the HBase project logo are trademarks of the Apache Software Foundation.


text:
<?php

namespace Zephir\Optimizers\FunctionCall;

use Zephir\Call;
use Zephir\CompilationContext;
use Zephir\CompiledExpression;
use Zephir\Optimizers\OptimizerAbstract;
use Zephir\Compiler\CompilerException;

class CalendsIsAfterOptimizer extends OptimizerAbstract
{
    public function optimize(array $expression, Call $call, CompilationContext $context)
    {
        if (count($expression['parameters']) != 2) {
            throw new CompilerException("'Calends_is_after' only accepts 2 parameters", $expression);
        }

        $resolvedParams = $call->getReadOnlyResolvedParams($expression['parameters'], $context, $expression);

        /**
         * Process the expected symbol to be returned
         */
        $call->processExpectedReturn($context);
        $symbolVariable = $call->getSymbolVariable(true, $context);
        if ($symbolVariable->isNotVariable()) {
            throw new CompilerException("Return value can only be assigned to variant variables", $expression);
        }
        $context->headersManager->add('wrap_libcalends');
        $context->headersManager->add('kernel/string');
        $symbolVariable->setDynamicTypes('string');
        if ($call->mustInitSymbolVariable()) {
            $symbolVariable->initVariant($context);
        }

        $context->codePrinter->output("{$symbolVariable->getRealName()} = ext_Calends_is_after(" . implode($resolvedParams, ', ') . ');');
        return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
    }
}


text:
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var gfi = require("gulp-file-insert");

gulp.task('default', function () {
    return gulp.src('jquery/jquery.tmp.js')
        .pipe(gfi({
            "/* flex-text */": "flex-text.js",
        }))
        .pipe(uglify())
        .pipe(gulp.dest('dist'));
});

// var fs = require('fs');
//
// gulp.task('jquery', function() {
//     var jQtemplate = fs.readFileSync('./jquery/jquery.tmp.js', 'utf8'),
//         flexText = fs.readFileSync('flex-text.js', 'utf8');
//
//     var jqPlugin = jQtemplate.replace('//flex-text', flexText);
//
//     fs.writeFileSync('jquery.flextext.js', jqPlugin);
// });


text:
package ie

import (
	"time"

	"github.com/intervention-engine/fhir/models"
)

type PatientService interface {
	Patient(id string) (*Patient, error)
	Patients() ([]Patient, error)
	PatientsByID(ids []string) ([]Patient, error)
}

type Patient struct {
	ID                    string               `json:"id"`
	Address               Address              `json:"address"`
	Age                   int                  `json:"age"`
	Gender                string               `json:"gender"`
	BirthDate             *models.FHIRDateTime `json:"birthDate"`
	Name                  Name                 `json:"name"`
	NextHuddleID          string               `json:"nextHuddleId"`
	RecentRiskAssessments []RiskAssessment     `json:"recentRiskAssessments"`
}

type Address struct {
	Street     []string `json:"street"`
	City       string   `json:"city"`
	State      string   `json:"state"`
	PostalCode string   `json:"postalCode"`
}

type Name struct {
	Family        string `json:"family"`
	Given         string `json:"given"`
	MiddleInitial string `json:"middleInitial"`
	Full          string `json:"full"`
}

type RiskAssessment struct {
	ID      string    `json:"id"`
	GroupID string    `json:"riskAssessmentGroupId"`
	Date    time.Time `json:"date"`
	Value   int       `json:"value"`
}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
** File:        pripv6.c
** Description: Support for various functions unique to IPv6
*/
#include "primpl.h"
#include <string.h>

#if !defined(_PR_INET6) || defined(_PR_INET6_PROBE)

static PRIOMethods ipv6_to_v4_tcpMethods;
static PRIOMethods ipv6_to_v4_udpMethods;
static PRDescIdentity _pr_ipv6_to_ipv4_id;
extern PRBool IsValidNetAddr(const PRNetAddr *addr);
extern PRIPv6Addr _pr_in6addr_any;
extern PRIPv6Addr _pr_in6addr_loopback;

/*
 * convert an IPv4-mapped IPv6 addr to an IPv4 addr
 */
static void _PR_ConvertToIpv4NetAddr(const PRNetAddr *src_v6addr,
											PRNetAddr *dst_v4addr)
{
const PRUint8 *srcp;

	PR_ASSERT(PR_AF_INET6 == src_v6addr->ipv6.family);

	if (PR_IsNetAddrType(src_v6addr, PR_IpAddrV4Mapped)) {
		srcp = src_v6addr->ipv6.ip.pr_s6_addr;
		memcpy((char *) &dst_v4addr->inet.ip, srcp + 12, 4);
    } else if (PR_IsNetAddrType(src_v6addr, PR_IpAddrAny)) {
        dst_v4addr->inet.ip = htonl(INADDR_ANY);
    } else if (PR_IsNetAddrType(src_v6addr, PR_IpAddrLoopback)) {
        dst_v4addr->inet.ip = htonl(INADDR_LOOPBACK);
    }
	dst_v4addr->inet.family = PR_AF_INET;
	dst_v4addr->inet.port = src_v6addr->ipv6.port;
}

/*
 * convert an IPv4 addr to an IPv4-mapped IPv6 addr
 */
static void _PR_ConvertToIpv6NetAddr(const PRNetAddr *src_v4addr,
                                            PRNetAddr *dst_v6addr)
{
PRUint8 *dstp;

	PR_ASSERT(PR_AF_INET == src_v4addr->inet.family);
	dst_v6addr->ipv6.family = PR_AF_INET6;
	dst_v6addr->ipv6.port = src_v4addr->inet.port;

 	if (htonl(INADDR_ANY) == src_v4addr->inet.ip) {
		dst_v6addr->ipv6.ip = _pr_in6addr_any;
	} else {
		dstp = dst_v6addr->ipv6.ip.pr_s6_addr;
		memset(dstp, 0, 10);
		memset(dstp + 10, 0xff, 2);
		memcpy(dstp + 12,(char *) &src_v4addr->inet.ip, 4);
	}
}

static PRStatus PR_CALLBACK Ipv6ToIpv4SocketBind(PRFileDesc *fd,
								const PRNetAddr *addr)
{
	PRNetAddr tmp_ipv4addr;
	const PRNetAddr *tmp_addrp;
	PRFileDesc *lo = fd->lower;

	if (PR_AF_INET6 != addr->raw.family) {
        PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, 0);
		return PR_FAILURE;
	}
	if (PR_IsNetAddrType(addr, PR_IpAddrV4Mapped) ||
    			PR_IsNetAddrType(addr, PR_IpAddrAny)) {
		_PR_ConvertToIpv4NetAddr(addr, &tmp_ipv4addr);
		tmp_addrp = &tmp_ipv4addr;
	} else {
        PR_SetError(PR_NETWORK_UNREACHABLE_ERROR, 0);
		return PR_FAILURE;
	}
	return((lo->methods->bind)(lo,tmp_addrp));
}

static PRStatus PR_CALLBACK Ipv6ToIpv4SocketConnect(
    PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout)
{
	PRNetAddr tmp_ipv4addr;
	const PRNetAddr *tmp_addrp;

	if (PR_AF_INET6 != addr->raw.family) {
        PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, 0);
		return PR_FAILURE;
	}
	if (PR_IsNetAddrType(addr, PR_IpAddrV4Mapped) ||
			PR_IsNetAddrType(addr, PR_IpAddrLoopback)) {
		_PR_ConvertToIpv4NetAddr(addr, &tmp_ipv4addr);
		tmp_addrp = &tmp_ipv4addr;
	} else {
        PR_SetError(PR_NETWORK_UNREACHABLE_ERROR, 0);
		return PR_FAILURE;
	}
	return (fd->lower->methods->connect)(fd->lower, tmp_addrp, timeout);
}

static PRInt32 PR_CALLBACK Ipv6ToIpv4SocketSendTo(
    PRFileDesc *fd, const void *buf, PRInt32 amount,
    PRIntn flags, const PRNetAddr *addr, PRIntervalTime timeout)
{
	PRNetAddr tmp_ipv4addr;
	const PRNetAddr *tmp_addrp;

	if (PR_AF_INET6 != addr->raw.family) {
        PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, 0);
		return PR_FAILURE;
	}
	if (PR_IsNetAddrType(addr, PR_IpAddrV4Mapped) ||
			PR_IsNetAddrType(addr, PR_IpAddrLoopback)) {
		_PR_ConvertToIpv4NetAddr(addr, &tmp_ipv4addr);
		tmp_addrp = &tmp_ipv4addr;
	} else {
        PR_SetError(PR_NETWORK_UNREACHABLE_ERROR, 0);
		return PR_FAILURE;
	}
    return (fd->lower->methods->sendto)(
        fd->lower, buf, amount, flags, tmp_addrp, timeout);
}

static PRFileDesc* PR_CALLBACK Ipv6ToIpv4SocketAccept (
    PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
{
    PRStatus rv;
    PRFileDesc *newfd;
    PRFileDesc *newstack;
	PRNetAddr tmp_ipv4addr;
    PRNetAddr *addrlower = NULL;

    PR_ASSERT(fd != NULL);
    PR_ASSERT(fd->lower != NULL);

    newstack = PR_NEW(PRFileDesc);
    if (NULL == newstack)
    {
        PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
        return NULL;
    }
    *newstack = *fd;  /* make a copy of the accepting layer */

    if (addr)
        addrlower = &tmp_ipv4addr;
    newfd = (fd->lower->methods->accept)(fd->lower, addrlower, timeout);
    if (NULL == newfd)
    {
        PR_DELETE(newstack);
        return NULL;
    }
    if (addr)
        _PR_ConvertToIpv6NetAddr(&tmp_ipv4addr, addr);

    rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack);
    PR_ASSERT(PR_SUCCESS == rv);
    return newfd;  /* that's it */
}

static PRInt32 PR_CALLBACK Ipv6ToIpv4SocketAcceptRead(PRFileDesc *sd,
			PRFileDesc **nd, PRNetAddr **ipv6_raddr, void *buf, PRInt32 amount,
							PRIntervalTime timeout)
{
    PRInt32 nbytes;
    PRStatus rv;
	PRNetAddr tmp_ipv4addr;
    PRFileDesc *newstack;

    PR_ASSERT(sd != NULL);
    PR_ASSERT(sd->lower != NULL);

    newstack = PR_NEW(PRFileDesc);
    if (NULL == newstack)
    {
        PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
        return -1;
    }
    *newstack = *sd;  /* make a copy of the accepting layer */

    nbytes = sd->lower->methods->acceptread(
        sd->lower, nd, ipv6_raddr, buf, amount, timeout);
    if (-1 == nbytes)
    {
        PR_DELETE(newstack);
        return nbytes;
    }
	tmp_ipv4addr = **ipv6_raddr;	/* copy */
	_PR_ConvertToIpv6NetAddr(&tmp_ipv4addr, *ipv6_raddr);

    /* this PR_PushIOLayer call cannot fail */
    rv = PR_PushIOLayer(*nd, PR_TOP_IO_LAYER, newstack);
    PR_ASSERT(PR_SUCCESS == rv);
    return nbytes;
}

static PRStatus PR_CALLBACK Ipv6ToIpv4SocketGetName(PRFileDesc *fd,
										PRNetAddr *ipv6addr)
{
	PRStatus result;
	PRNetAddr tmp_ipv4addr;

	result = (fd->lower->methods->getsockname)(fd->lower, &tmp_ipv4addr);
	if (PR_SUCCESS == result) {
		_PR_ConvertToIpv6NetAddr(&tmp_ipv4addr, ipv6addr);
		PR_ASSERT(IsValidNetAddr(ipv6addr) == PR_TRUE);
	}
	return result;
}

static PRStatus PR_CALLBACK Ipv6ToIpv4SocketGetPeerName(PRFileDesc *fd,
										PRNetAddr *ipv6addr)
{
	PRStatus result;
	PRNetAddr tmp_ipv4addr;

	result = (fd->lower->methods->getpeername)(fd->lower, &tmp_ipv4addr);
	if (PR_SUCCESS == result) {
		_PR_ConvertToIpv6NetAddr(&tmp_ipv4addr, ipv6addr);
		PR_ASSERT(IsValidNetAddr(ipv6addr) == PR_TRUE);
	}
	return result;
}

static PRInt32 PR_CALLBACK Ipv6ToIpv4SocketRecvFrom(PRFileDesc *fd, void *buf,
			PRInt32 amount, PRIntn flags, PRNetAddr *ipv6addr,
				PRIntervalTime timeout)
{
	PRNetAddr tmp_ipv4addr;
	PRInt32 result;

    result = (fd->lower->methods->recvfrom)(
        fd->lower, buf, amount, flags, &tmp_ipv4addr, timeout);
	if (-1 != result) {
		_PR_ConvertToIpv6NetAddr(&tmp_ipv4addr, ipv6addr);
		PR_ASSERT(IsValidNetAddr(ipv6addr) == PR_TRUE);
	}
	return result;
}

#if defined(_PR_INET6_PROBE)
static PRBool ipv6_is_present;
extern PRBool _pr_test_ipv6_socket(void);

#if !defined(_PR_INET6) && defined(_PR_HAVE_GETIPNODEBYNAME)
extern PRStatus _pr_find_getipnodebyname(void);
#endif

#if !defined(_PR_INET6) && defined(_PR_HAVE_GETADDRINFO)
extern PRStatus _pr_find_getaddrinfo(void);
#endif

static PRBool
_pr_probe_ipv6_presence(void)
{
#if !defined(_PR_INET6) && defined(_PR_HAVE_GETIPNODEBYNAME)
    if (_pr_find_getipnodebyname() != PR_SUCCESS)
        return PR_FALSE;
#endif

#if !defined(_PR_INET6) && defined(_PR_HAVE_GETADDRINFO)
    if (_pr_find_getaddrinfo() != PR_SUCCESS)
        return PR_FALSE;
#endif

    return _pr_test_ipv6_socket();
}
#endif  /* _PR_INET6_PROBE */

static PRCallOnceType _pr_init_ipv6_once;

static PRStatus PR_CALLBACK _pr_init_ipv6(void)
{
    const PRIOMethods *stubMethods;

#if defined(_PR_INET6_PROBE)
    ipv6_is_present = _pr_probe_ipv6_presence();
    if (ipv6_is_present)
        return PR_SUCCESS;
#endif

    _pr_ipv6_to_ipv4_id = PR_GetUniqueIdentity("Ipv6_to_Ipv4 layer");
    PR_ASSERT(PR_INVALID_IO_LAYER != _pr_ipv6_to_ipv4_id);

	stubMethods = PR_GetDefaultIOMethods();

	ipv6_to_v4_tcpMethods = *stubMethods;  /* first get the entire batch */
	/* then override the ones we care about */
	ipv6_to_v4_tcpMethods.connect = Ipv6ToIpv4SocketConnect;
	ipv6_to_v4_tcpMethods.bind = Ipv6ToIpv4SocketBind;
	ipv6_to_v4_tcpMethods.accept = Ipv6ToIpv4SocketAccept;
	ipv6_to_v4_tcpMethods.acceptread = Ipv6ToIpv4SocketAcceptRead;
	ipv6_to_v4_tcpMethods.getsockname = Ipv6ToIpv4SocketGetName;
	ipv6_to_v4_tcpMethods.getpeername = Ipv6ToIpv4SocketGetPeerName;
/*
	ipv6_to_v4_tcpMethods.getsocketoption = Ipv6ToIpv4GetSocketOption;
	ipv6_to_v4_tcpMethods.setsocketoption = Ipv6ToIpv4SetSocketOption;
*/
	ipv6_to_v4_udpMethods = *stubMethods;  /* first get the entire batch */
	/* then override the ones we care about */
	ipv6_to_v4_udpMethods.connect = Ipv6ToIpv4SocketConnect;
	ipv6_to_v4_udpMethods.bind = Ipv6ToIpv4SocketBind;
	ipv6_to_v4_udpMethods.sendto = Ipv6ToIpv4SocketSendTo;
	ipv6_to_v4_udpMethods.recvfrom = Ipv6ToIpv4SocketRecvFrom;
	ipv6_to_v4_udpMethods.getsockname = Ipv6ToIpv4SocketGetName;
	ipv6_to_v4_udpMethods.getpeername = Ipv6ToIpv4SocketGetPeerName;
/*
	ipv6_to_v4_udpMethods.getsocketoption = Ipv6ToIpv4GetSocketOption;
	ipv6_to_v4_udpMethods.setsocketoption = Ipv6ToIpv4SetSocketOption;
*/
	return PR_SUCCESS;
}

#if defined(_PR_INET6_PROBE)
PRBool _pr_ipv6_is_present(void)
{
    if (PR_CallOnce(&_pr_init_ipv6_once, _pr_init_ipv6) != PR_SUCCESS)
        return PR_FALSE;
    return ipv6_is_present;
}
#endif

PR_IMPLEMENT(PRStatus) _pr_push_ipv6toipv4_layer(PRFileDesc *fd)
{
	PRFileDesc *ipv6_fd = NULL;

	if (PR_CallOnce(&_pr_init_ipv6_once, _pr_init_ipv6) != PR_SUCCESS)
		return PR_FAILURE;

	/*
	 * For platforms with no support for IPv6
	 * create layered socket for IPv4-mapped IPv6 addresses
	 */
	if (fd->methods->file_type == PR_DESC_SOCKET_TCP)
		ipv6_fd = PR_CreateIOLayerStub(_pr_ipv6_to_ipv4_id,
									&ipv6_to_v4_tcpMethods);
	else
		ipv6_fd = PR_CreateIOLayerStub(_pr_ipv6_to_ipv4_id,
									&ipv6_to_v4_udpMethods);
	if (NULL == ipv6_fd) {
		goto errorExit;
	}
	ipv6_fd->secret = NULL;

	if (PR_PushIOLayer(fd, PR_TOP_IO_LAYER, ipv6_fd) == PR_FAILURE) {
		goto errorExit;
	}

	return PR_SUCCESS;
errorExit:

	if (ipv6_fd)
		ipv6_fd->dtor(ipv6_fd);
	return PR_FAILURE;
}

#endif /* !defined(_PR_INET6) || defined(_PR_INET6_PROBE) */


text:
<?php namespace League\Twitter;

class HashTag extends ObjectTwitterAbstract
{
    protected $text;

    /**
     * A class representing a Twitter HashTag.
     * @param string $text
     */
    public function __construct($text)
    {
        $this->text = $text;
    }

    /**
     * @param string $text
     */
    public function setText($text)
    {
        $this->text = $text;
    }

    /**
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }
}


text:
import { combineReducers } from 'redux';
import { reducer as form } from 'redux-form';

const rootReducer = combineReducers({ form });

export default rootReducer;


text:
package io.musichouse.repository;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

import org.springframework.stereotype.Repository;

import io.musichouse.entity.Customer;

@Repository
public class CustomerRepositoryImpl implements CustomerRepository {

	@PersistenceContext
	private EntityManager em;

	@Override
	public Customer createCustomer(Customer currentCustomer) {
		em.persist(currentCustomer);
		return currentCustomer;
	}

	@Override
	public List<Customer> getAllCustomers() {
		TypedQuery<Customer> query = em.createQuery("select cust from Customer cust", Customer.class);
		List<Customer> existingCustomerList = query.getResultList();
		return existingCustomerList;
	}

	@Override
	public List<Customer> getTopShippingAddress() {
		TypedQuery<Customer> query = em.createQuery(
				"select cust from Customer cust group by cust.shippingAddress.shippingId order by count(cust) desc",
				Customer.class);
		query.setMaxResults(2);
		List<Customer> existingCustomerList = query.getResultList();
		return existingCustomerList;
	}

}


text:
IMAGE_FORMATS = ('jpg', 'jpeg', 'png', 'gif')
FILE_FORMATS = ('html', 'jpg', 'jpeg', 'png', 'gif')

def get_url_from_subdomain(subdomain):
    return "https://" + subdomain + ".zendesk.com"


text:
@interface OWSpaceListModel : JSONModel

PROPERTY_STRING(ID)//需要转换
PROPERTY_STRING(title)
PROPERTY_STRING(excerpt)
PROPERTY_STRING(lead)
PROPERTY_STRING(thumbnail)
PROPERTY_STRING(video)
PROPERTY_STRING(fm)
PROPERTY_STRING(author)
PROPERTY_STRING(category)
PROPERTY_STRING(update_time)

@end


text:
module.exports = {
  env: {
    browser: true,
    es6: true,
    node: true,
  },
  extends: [
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:import/typescript",
  ],
  parser: "@typescript-eslint/parser",
  parserOptions: {
    project: "tsconfig.json",
    sourceType: "module",
  },
  plugins: [
    "@typescript-eslint",
    "import",
  ],
  rules: {
    "@typescript-eslint/adjacent-overload-signatures": "error",
    "@typescript-eslint/no-empty-function": "error",
    "@typescript-eslint/no-empty-interface": "warn",
    "@typescript-eslint/no-floating-promises": "error",
    "@typescript-eslint/no-namespace": "error",
    "@typescript-eslint/no-unnecessary-type-assertion": "error",
    "@typescript-eslint/prefer-for-of": "warn",
    "@typescript-eslint/triple-slash-reference": "error",
    "@typescript-eslint/unified-signatures": "warn",
    "comma-dangle": ["error", "always-multiline"],
    "constructor-super": "error",
    eqeqeq: ["warn", "always"],
    "import/no-deprecated": "warn",
    "import/no-extraneous-dependencies": "error",
    "import/no-unassigned-import": "warn",
    "no-cond-assign": "error",
    "no-duplicate-case": "error",
    "no-duplicate-imports": "error",
    "no-empty": [
      "error",
      {
        allowEmptyCatch: true,
      },
    ],
    "no-invalid-this": "error",
    "no-new-wrappers": "error",
    "no-param-reassign": "error",
    "no-redeclare": "error",
    "no-sequences": "error",
    "no-shadow": [
      "error",
      {
        hoist: "all",
      },
    ],
    "no-throw-literal": "error",
    "no-unsafe-finally": "error",
    "no-unused-labels": "error",
    "no-var": "warn",
    "no-void": "error",
    "prefer-const": "warn",
  },
  settings: {
    jsdoc: {
      tagNamePreference: {
        returns: "return",
      },
    },
  },
};


text:
package uk.co.mruoc.postman;

import uk.co.mruoc.postman.task.DeployNewmanWrapperTask;
import uk.co.mruoc.postman.task.InstallNewmanTask;
import uk.co.mruoc.postman.task.PostmanTask;
import org.gradle.api.Plugin;
import org.gradle.api.Project;

import java.util.HashMap;
import java.util.Map;

public class PostmanRunnerPlugin implements Plugin<Project> {

    private static final String COM_MOOWORK_NODE = "com.moowork.node";

    public final static String GROUP_NAME = "Postman";

    @Override
    public void apply(Project project) {
        createTasks(project);
        createExtension(project);

        project.getPluginManager().apply(COM_MOOWORK_NODE);
    }

    private void createExtension(Project project) {
        project.getExtensions().create(PostmanExtension.NAME, PostmanExtension.class, project);
    }

    private void createTasks(Project project) {
        project.task(type(PostmanTask.class), PostmanTask.NAME);
        project.task(type(InstallNewmanTask.class), InstallNewmanTask.NAME);
        project.task(type(DeployNewmanWrapperTask.class), DeployNewmanWrapperTask.NAME);
    }

    private <T> Map<String, Class<T>> type(Class<T> clazz) {
        HashMap<String, Class<T>> map = new HashMap<>();
        map.put("type", clazz);
        return map;
    }
}


text:
SORT ORDER

    <form autocomplete="off">

Sort order

      <input id="maximum" name="sort-order" type="radio" value="maximum" checked>
      Maximum

      <input id="minimum" name="sort-order" type="radio" value="minimum">
      Minimum

        <button class="btn default" onclick="closeCard('sort-order')">Cancel</button>
        <button id="update-sort-order" class="btn primary">Update</button>

    </form>


text:
var gulp = require('gulp');
var watch = require('gulp-watch');
var webpack = require('gulp-webpack');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var minifyCss = require('gulp-minify-css');

gulp.task('webpack', function () {
    return gulp.src('public/src/index.js')
        .pipe(webpack({
            watch: true,
            module: {
                loaders: [
                    {
                        test: /.jsx?$/,
                        loader: 'babel-loader',
                        exclude: /node_modules/,
                        query: {
                            presets: ['es2015', 'react']
                        }
                    }
                ]
            },
            output: {
                filename: "bundle.js"
            }
        }))
        //.pipe(uglify())
        .pipe(gulp.dest('public/build'))
});

gulp.task('css', function () {
    return gulp.src('public/src/css/css.css')
        .pipe(minifyCss())
        .pipe(gulp.dest('public/build'))
});


text:
---
layout: default
class: Project
title: -runpath REPO-ENTRY ( ',' REPO-ENTRY )
summary:  Additional JARs for the remote VM path, should include the framework.
---

	/**
	 * Method to verify that the paths are correct, ie no missing dependencies
	 *
	 * @param test
	 *            for test cases, also adds -testpath
	 * @throws Exception
	 */
	public void verifyDependencies(boolean test) throws Exception {
		verifyDependencies(RUNBUNDLES, getRunbundles());
		verifyDependencies(RUNPATH, getRunpath());
		if (test)
			verifyDependencies(TESTPATH, getTestpath());
		verifyDependencies(BUILDPATH, getBuildpath());
	}

						doPath(buildpath, dependencies, parseBuildpath(), bootclasspath, false, BUILDPATH);
					doPath(testpath, dependencies, parseTestpath(), bootclasspath, false, TESTPATH);
					if (!delayRunDependencies) {
						doPath(runfw, dependencies, parseRunFw(), null, false, RUNFW);
						doPath(runpath, dependencies, parseRunpath(), null, false, RUNPATH);
						doPath(runbundles, dependencies, parseRunbundles(), null, true, RUNBUNDLES);
					}

		private List<Container> parseRunpath() throws Exception {
		return getBundles(Strategy.HIGHEST, mergeProperties(Constants.RUNPATH), Constants.RUNPATH);
	}

		public Collection<Container> getRunpath() throws Exception {
		prepare();
		justInTime(runpath, parseRunpath(), false, RUNPATH);
		return runpath;
	}


text:
1. Image

                        Parcourir
                        <input type="file" nv-file-select uploader="uploader">

                    <button class="btn btn-success btn-flat" data-ng-click="uploadTargetPicture();">Enregistrer</button>
                    <button class="btn btn-default btn-flat" data-ng-click="cancelUpload();">Annuler</button>

 Image enregistrée

                    Rotation (°)

                        <button type="button" class="btn btn-default btn-primary btn-small" ng-click="rotateCrop(false);">rotate_left</button>
                        <button type="button" class="btn btn-default btn-primary btn-small" ng-click="rotateCrop(true);">rotate_right</button>

                    Zoom

                        <button type="button" class="btn btn-default btn-primary btn-small" ng-click="zoomCrop();">zoom_out</button>
                        <button type="button" class="btn btn-default btn-primary btn-small" ng-click="zoomCrop(true);">zoom_in</button>

                    Translation

                        gamepad

3. Ajout des impacts

                    Choix du calibre

                        <ui-select ng-model="caliber.selected" title="Calibre">
                            <ui-select-match placeholder="Calibre">{{$select.selected.name}}</ui-select-match>
                            <ui-select-choices repeat="caliber in calibers">

                            </ui-select-choices>
                        </ui-select>

                    Nombre d'impacts

                        <button type="button" class="btn btn-default btn-primary btn-small" ng-bind="bulletCount"></button>

                    Impacts dans noir

                        <button type="button" class="btn btn-default btn-primary btn-small">
                             ( %)
                        </button>

                    Score

                        <button type="button" class="btn btn-default btn-primary btn-small" ng-bind="scoreText"></button>

                    Moyenne

                        <button type="button" class="btn btn-default btn-primary btn-small" ng-bind="meanScore"></button>

Mode

                <button class="btn btn-block btn-flat" data-ng-class="{ 'btn-primary': checkCurrentStateByName('image'), 'btn-default': !checkCurrentStateByName('image') }" ng-click="setImageMode();">Image</button>
                <button class="btn btn-block btn-flat" data-ng-class="{ 'btn-warning': checkCurrentStateByName('impacts') , 'btn-default': !checkCurrentStateByName('impacts') }" ng-click="setImpactsMode();">Impacts</button>
                <button class="btn btn-block btn-flat" data-ng-class="{ 'btn-info': checkCurrentStateByName('verification'), 'btn-default': !checkCurrentStateByName('verification') }" ng-click="setVerificationMode();" ng-disabled="!helpers[2].done">Verification</button>

4. Vérification

                <datepicker starting-day="1" ng-model="dt" show-weeks="true" custom-class="getDayClass(date, mode)" class="datepicker datepicker-mode-0"></datepicker>

                <form data-ng-submit="create()" class="pull-right btn-block form-horizontal" novalidate>
                    <fieldset>
                        <button type="submit" class="btn btn-success btn-flat btn-block">Enregistrer la cible</button>

                    </fieldset>
                </form>


text:
var DoorMan = (function ($) {

  var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

  var monthsThirty = ["04", "06", "09", "11"];
  var monthsThirtyOne = ["01", "03", "05", "07", "08", "10", "12"];
  var date = new Date();
  var year = date.getFullYear();

  //Create Month Dropdown
  //Leading Zero added for Age Calculation later

  for (i = 0; i < months.length; i++) {
    $('#dm-age-month').append("<option value='" + ('0' + (i + 1)).slice(-2) + "'>" + months[i] + "</option>");

  };

  //Create Day Dropdown with 31 days by default

  for (i = 1; i <= 31; i++) {
    $('#dm-age-day').append("<option value='" + i + "'>" + i + "</option>");

  };

  //Create Year Dropdown

  for (i = 1900; i <= year; i++) {
    $('#dm-age-year').append("<option value='" + i + "'>" + i + "</option>");

  };

  //Show or Hide the 31st day on months with less than 30 days

  $('#dm-age-month').change(function () {

    var monthValue = $('#dm-age-month').val();

    if (monthsThirty.indexOf(monthValue) !== -1) {
      $("#dm-age-day option[value='31']").hide();

    } else if (monthsThirtyOne.indexOf(monthValue) !== -1) {
      $("#dm-age-day option[value='31']").show();

    };
  });

  $('#check-age-button').click(function () {

    var monthValue = $('#dm-age-month').val();
    var dayValue = $('#dm-age-day').val();
    var yearValue = $('#dm-age-year').val();

    var birthday = new Date(monthValue + '/' + dayValue + '/' + yearValue).getTime();
    var today = new Date();
    var todayTime = today.getTime();

    var ageMill = todayTime - birthday;
    var ageSec = ageMill / 1000;
    var ageMin = ageSec / 60;
    var ageHour = ageMin / 60;
    var ageDay = ageHour / 24;
    var ageYears = ageDay / 365.25;

    if (ageYears > 18) {
      window.location.href = 'success.html?age='+Math.floor(ageYears)+'&verified=true';
      sessionStorage.age = ageYears;
    } else{
      window.location.href = 'failure.html';
      sessionStorage.age = ageYears;
    }

  });

  return {

    alertAge: function (age) {
      alert(age);
    },

    alertMonths: function (months) {
      alert(months);
    }

  };

})(jQuery);


text:
using System;
using System.Windows;
using System.Windows.Data;

namespace taiyuanhitech.TGFCSpiderman.Converter
{
    class PostTitleConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (values[0] == DependencyProperty.UnsetValue || values[1] == DependencyProperty.UnsetValue) return "";
            var threadTitle = (string)values[0];
            var order = (int)values[1];
            return order == 1 ? threadTitle : "RE:" + threadTitle;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}


text:
<?php

namespace Ortofit\Bundle\StatBundle\Indicator;

use Ortofit\Bundle\StatBundle\Request\StatRequestInterface;

/**
 * Interface IndicatorInterface
 * @package Ortofit\Bundle\StatBundle
 */
interface IndicatorInterface
{
    /**
     * @param StatRequestInterface $request
     *
     * @return array
     */
    public function calculate($request);

    /**
     * @return string
     */
    public function getId();
}


text:
package com.azure.resourcemanager.policyinsights.implementation;

import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.policyinsights.fluent.models.AttestationInner;
import com.azure.resourcemanager.policyinsights.models.Attestation;
import com.azure.resourcemanager.policyinsights.models.AttestationEvidence;
import com.azure.resourcemanager.policyinsights.models.ComplianceState;
import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.List;

public final class AttestationImpl implements Attestation, Attestation.Definition, Attestation.Update {
    private AttestationInner innerObject;

    private final com.azure.resourcemanager.policyinsights.PolicyInsightsManager serviceManager;

    public String id() {
        return this.innerModel().id();
    }

    public String name() {
        return this.innerModel().name();
    }

    public String type() {
        return this.innerModel().type();
    }

    public SystemData systemData() {
        return this.innerModel().systemData();
    }

    public String policyAssignmentId() {
        return this.innerModel().policyAssignmentId();
    }

    public String policyDefinitionReferenceId() {
        return this.innerModel().policyDefinitionReferenceId();
    }

    public ComplianceState complianceState() {
        return this.innerModel().complianceState();
    }

    public OffsetDateTime expiresOn() {
        return this.innerModel().expiresOn();
    }

    public String owner() {
        return this.innerModel().owner();
    }

    public String comments() {
        return this.innerModel().comments();
    }

    public List<AttestationEvidence> evidence() {
        List<AttestationEvidence> inner = this.innerModel().evidence();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public String provisioningState() {
        return this.innerModel().provisioningState();
    }

    public OffsetDateTime lastComplianceStateChangeAt() {
        return this.innerModel().lastComplianceStateChangeAt();
    }

    public OffsetDateTime assessmentDate() {
        return this.innerModel().assessmentDate();
    }

    public Object metadata() {
        return this.innerModel().metadata();
    }

    public String resourceGroupName() {
        return resourceGroupName;
    }

    public AttestationInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager() {
        return this.serviceManager;
    }

    private String resourceGroupName;

    private String attestationName;

    public AttestationImpl withExistingResourceGroup(String resourceGroupName) {
        this.resourceGroupName = resourceGroupName;
        return this;
    }

    public Attestation create() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getAttestations()
                .createOrUpdateAtResourceGroup(resourceGroupName, attestationName, this.innerModel(), Context.NONE);
        return this;
    }

    public Attestation create(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getAttestations()
                .createOrUpdateAtResourceGroup(resourceGroupName, attestationName, this.innerModel(), context);
        return this;
    }

    AttestationImpl(String name, com.azure.resourcemanager.policyinsights.PolicyInsightsManager serviceManager) {
        this.innerObject = new AttestationInner();
        this.serviceManager = serviceManager;
        this.attestationName = name;
    }

    public AttestationImpl update() {
        return this;
    }

    public Attestation apply() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getAttestations()
                .createOrUpdateAtResourceGroup(resourceGroupName, attestationName, this.innerModel(), Context.NONE);
        return this;
    }

    public Attestation apply(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getAttestations()
                .createOrUpdateAtResourceGroup(resourceGroupName, attestationName, this.innerModel(), context);
        return this;
    }

    AttestationImpl(
        AttestationInner innerObject, com.azure.resourcemanager.policyinsights.PolicyInsightsManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
        this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
        this.attestationName = Utils.getValueFromIdByName(innerObject.id(), "attestations");
    }

    public Attestation refresh() {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getAttestations()
                .getByResourceGroupWithResponse(resourceGroupName, attestationName, Context.NONE)
                .getValue();
        return this;
    }

    public Attestation refresh(Context context) {
        this.innerObject =
            serviceManager
                .serviceClient()
                .getAttestations()
                .getByResourceGroupWithResponse(resourceGroupName, attestationName, context)
                .getValue();
        return this;
    }

    public AttestationImpl withPolicyAssignmentId(String policyAssignmentId) {
        this.innerModel().withPolicyAssignmentId(policyAssignmentId);
        return this;
    }

    public AttestationImpl withPolicyDefinitionReferenceId(String policyDefinitionReferenceId) {
        this.innerModel().withPolicyDefinitionReferenceId(policyDefinitionReferenceId);
        return this;
    }

    public AttestationImpl withComplianceState(ComplianceState complianceState) {
        this.innerModel().withComplianceState(complianceState);
        return this;
    }

    public AttestationImpl withExpiresOn(OffsetDateTime expiresOn) {
        this.innerModel().withExpiresOn(expiresOn);
        return this;
    }

    public AttestationImpl withOwner(String owner) {
        this.innerModel().withOwner(owner);
        return this;
    }

    public AttestationImpl withComments(String comments) {
        this.innerModel().withComments(comments);
        return this;
    }

    public AttestationImpl withEvidence(List<AttestationEvidence> evidence) {
        this.innerModel().withEvidence(evidence);
        return this;
    }

    public AttestationImpl withAssessmentDate(OffsetDateTime assessmentDate) {
        this.innerModel().withAssessmentDate(assessmentDate);
        return this;
    }

    public AttestationImpl withMetadata(Object metadata) {
        this.innerModel().withMetadata(metadata);
        return this;
    }
}


text:
package DDG::Goodie::Regexp;

# ABSTRACT: Parse a regexp and list the matches

use strict;
use warnings;
use DDG::Goodie;

use Safe;

zci answer_type => "regexp";
zci is_cached   => 1;

triggers start => 'regex', 'match', 'regexp';
triggers any   => '=~';

sub compile_re {
    my ($re, $modifiers, $compiler) = @_;
    $compiler->($re, $modifiers);
}

# Using $& causes a performance penalty, apparently.
sub get_full_match {
    return substr(shift, $-[0], $+[0] - $-[0]);
}

# Ensures that the correct numbered matches are being produced.
sub real_number_matches {
    my ($one, @numbered) = @_;
    # If the first match isn't defined then neither are the others!
    return defined $one ? @numbered : ();
}

sub get_match_record {
    my ($regexp, $str, $modifiers) = @_;
    my $compiler = Safe->new->reval(q { sub { qr/(?$_[1])$_[0]/ } }) or return;
    BEGIN {
        $SIG{'__WARN__'} = sub {
            warn $_[0] if $_[0] !~ /Use of uninitialized value in regexp compilation/i;
        }
    }

    my @numbered = $str =~ compile_re($regexp, $modifiers, $compiler) or return;
    @numbered = real_number_matches($1, @numbered);
    my $matches = {};
    $matches->{'Full Match'} = get_full_match($str);
    foreach my $match (keys %+) {
        $matches->{"Named Capture <$match>"} = $+{$match};
    };
    my $i = 1;
    foreach my $match (@numbered) {
        $matches->{"Subpattern Match $i"} = $match;
        $i++;
    };
    return $matches;
}

my $regex_re = qr/\/(?<regex>.+)\/(?<modifiers>i)?/;

sub extract_regex_text {
    my $query = shift;
    $query =~ /^(?<text>.+) =~ $regex_re$/;
    ($+{regex} && $+{text}) || ($query =~ /^(?:match\s*regexp?|regexp?)\s*$regex_re\s+(?<text>.+)$/);
    return unless defined $+{regex} && defined $+{text};
    my $modifiers = $+{modifiers} // '';
    return ($+{regex}, $+{text}, $modifiers);
}

sub get_match_keys { return sort (keys %{$_[0]}) }

handle query => sub {
    my $query = $_;
    my ($regexp, $str, $modifiers) = extract_regex_text($query) or return;
    my $matches = get_match_record($regexp, $str, $modifiers) or return;
    my @key_order = get_match_keys($matches);
    return unless $matches->{'Full Match'} ne '';

    return $matches,
        structured_answer => {
            data => {
                title       => "Regular Expression Match",
                subtitle    => "Match regular expression /$regexp/$modifiers on $str",
                record_data => $matches,
                record_keys => \@key_order,
            },
            meta => {
                signal => 'high',
            },
            templates => {
                group   => 'list',
                options => {
                    content => 'record',
                },
                moreAt  => 0,
            },
        };
};

1;


text:
<?php
/**
 * Created by mcfedr on 01/04/2014 16:35
 */

namespace mcfedr\Queue\JobManagerBundle\Worker;

interface DoctrineAwareWorker extends Worker
{
}


text:
Obtain the private key associated with the production server (e.g. "gwu-business-1.pem").
 Note the server's Public IP address (e.g. 54.173.219.67).

Log-in to the server:

```` sh
# as an instructor:
ssh ec2-user@54.173.219.67 -i ~/.ssh/gwu-business-1.pem

# as a student:
ssh sammy_student@54.173.219.67 -i ~/.ssh/gw_id_rsa.pub
````

To deploy or re-deploy,
 run the "Setup" command
  from the AWS "Stack" > "Run Command" menu.
  Before deploying, copy and paste the contents of [`opsworks.json`](clubhouse/attributes/opsworks.json)
   into the "Custom Chef JSON" text box.

If the cookbook changes, run the "Update Custom Cookbooks" command
 before performing the next "Setup" command.

## AWS Prerequisites

Create an AWS account, log-in to the AWS console, and ensure presence of a running server.

### Key Pair

Navigate to the "Network and Security" > "Key Pairs" menu.

Choose an existing key pair,
 or create a new key pair
  and witness it auto-download to your local machine (e.g. "gwu-business-1.pem").

Move the file into the .ssh directory and change file permissions.

```` sh
mv ~/Downloads/gwu-business-1.pem ~/.ssh
chmod 400 ~/.ssh/gwu-business-1.pem
````

### Server Instance

Navigate to the "OpsWorks" service.

Create a new stack in the "N. Virginia" region using the "Amazon Linux" OS,
 and use the advanced options to "use custom chef cookbooks",
 and specify the url of this hosted repository as the cookbook url.

Add a new "MySQL" layer
 and specify the recipe(s) to run
 during the "Setup" lifecycle event: `clubhouse::build`.

Add a new server instance to the stack.
 Choose "m4.large" size,
  "24/7" scaling type,
  and select the previously-generated "gwu-business-1.pem" SSH key.

Once the new instance has been created,
 click "start"
 and wait a few moments until the instance status changes from "booting" to "running".

This will trigger a number of lifecycle events, including the "Deploy" event,
 which should in turn trigger execution of custom cookbook recipe(s).

Note the server's Public IP address (e.g. 54.175.53.250).

## Configuration

Optionally use a text editor to add an entry to the SSH configuration file
 to specify the credentials to use when logging in to the server.

```` sh
# ~/.ssh/config

# GWSB BADM 2301 SERVER CONFIG
Host clubhouse
  IdentityFile ~/.ssh/gwu-business-1.pem
  User ec2-user
  Hostname 54.175.53.250
````

This configuration allows server access via a more concise command:

```` sh
ssh clubhouse
````

## Adding SSH Users

Obtain the user's public key
 and add a corresponding entry
  to the "ssh_users" node attribute.


text:
```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "getmempoolinfo"
  }'
```

```shell--cli
bcoin-cli rpc getmempoolinfo
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('getmempoolinfo');
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
{
  "size": 5,
  "bytes": 14120,
  "usage": 14120,
  "maxmempool": 100000000,
  "mempoolminfee": 0.00001
}
```

Returns informations about mempool.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
None. |

## getmempoolancestors

```javascript
let txhash, verbose;
```

```shell--vars
txhash='0e690d6655767c8b388e7403d13dc9ebe49b68e3bd46248c840544f9da87d1e8';
verbose=1;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "getmempoolancestors",
    "params": [ "'$txhash'", '$verbose' ]
  }'
```

```shell--cli
bcoin-cli rpc getmempoolancestors $txhash $verbose
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('getmempoolancestors', [ txhash, verbose ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:
>
> verbose=1

```json
[
  {
    "size": 226,
    "fee": 0.0000454,
    "modifiedfee": 0,
    "time": 1527103521,
    "height": 100,
    "startingpriority": 0,
    "currentpriority": 0,
    "descendantcount": 1,
    "descendantsize": 451,
    "descendantfees": 9080,
    "ancestorcount": 2,
    "ancestorsize": 0,
    "ancestorfees": 0,
    "depends": [
      "7922c798ea02c3957393bb7c373ba89e0a337d049564aeb64a9fd2b8d4998795"
    ]
  },
  {
    "size": 225,
    "fee": 0.0000454,
    "modifiedfee": 0,
    "time": 1527103519,
    "height": 100,
    "startingpriority": 0,
    "currentpriority": 0,
    "descendantcount": 2,
    "descendantsize": 676,
    "descendantfees": 13620,
    "ancestorcount": 1,
    "ancestorsize": 0,
    "ancestorfees": 0,
    "depends": [
      "d54e576d30f9014ffb06a31b9e36f2f5bb360e8c54980188ee4b09a979e092c2"
    ]
  },
  ...
]
```

> verbose=0

```json
[
  "56ab7663c80cb6ffc9f8a4b493d77b2e6f52ae8ff64eefa8899c2065922665c8"
]
```

returns all in-mempool ancestors for a transaction in the mempool.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | txhash | Required | Transaction Hash
2 | verbose | false | False returns only tx hashs, true - returns dependency tx info

## getmempooldescendants

```javascript
let txhash, verbose;
```

```shell--vars
txhash='7922c798ea02c3957393bb7c373ba89e0a337d049564aeb64a9fd2b8d4998795';
verbose=1;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "getmempooldescendants",
    "params": [ "'$txhash'", '$verbose' ]
  }'
```

```shell--cli
bcoin-cli rpc getmempooldescendants $txhash $verbose
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('getmempooldescendants', [ txhash, verbose ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:
>
> verbose=1

```json
[
  {
    "size": 226,
    "fee": 0.0000454,
    "modifiedfee": 0,
    "time": 1527103521,
    "height": 100,
    "startingpriority": 0,
    "currentpriority": 0,
    "descendantcount": 1,
    "descendantsize": 451,
    "descendantfees": 9080,
    "ancestorcount": 2,
    "ancestorsize": 0,
    "ancestorfees": 0,
    "depends": [
      "7922c798ea02c3957393bb7c373ba89e0a337d049564aeb64a9fd2b8d4998795"
    ]
  },
  {
    "size": 225,
    "fee": 0.0000454,
    "modifiedfee": 0,
    "time": 1527103523,
    "height": 100,
    "startingpriority": 0,
    "currentpriority": 0,
    "descendantcount": 0,
    "descendantsize": 225,
    "descendantfees": 4540,
    "ancestorcount": 3,
    "ancestorsize": 0,
    "ancestorfees": 0,
    "depends": [
      "e66c029a755d326f14cc32f485ea43e705ef59ed4a8061e8f47e681fbdefefea"
    ]
  }
]
```
> verbose=0

```json
[
  "939a3b8485b53a718d89e7e4412473b3762fa1d9bbd555fc8b01e73be0ab1881"
]
```

returns all in-mempool descendants for a transaction in the mempool.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | txhash | Required | Transaction hash
2 | verbose | false | False returns only tx hashs, true - returns dependency tx info

## getmempoolentry

```javascript
let txhash;
```

```shell--vars
txhash='0e690d6655767c8b388e7403d13dc9ebe49b68e3bd46248c840544f9da87d1e8';
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "getmempoolentry",
    "params": [ "'$txhash'" ]
  }'
```

```shell--cli
bcoin-cli rpc getmempoolentry $txhash
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('getmempoolentry', [ txhash ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
{
  "size": 225,
  "fee": 0.0000454,
  "modifiedfee": 0,
  "time": 1527103523,
  "height": 100,
  "startingpriority": 0,
  "currentpriority": 0,
  "descendantcount": 0,
  "descendantsize": 225,
  "descendantfees": 4540,
  "ancestorcount": 3,
  "ancestorsize": 0,
  "ancestorfees": 0,
  "depends": [
    "e66c029a755d326f14cc32f485ea43e705ef59ed4a8061e8f47e681fbdefefea"
  ]
}
```

returns mempool transaction info by its hash.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | txhash | Required | Transaction Hash

## getrawmempool

```javascript
let verbose;
```

```shell--vars
verbose=1;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "getrawmempool",
    "params": [ '$verbose' ]
  }'
```

```shell--cli
bcoin-cli rpc getrawmempool $verbose
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('getrawmempool', [ verbose ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
{
  "d54e576d30f9014ffb06a31b9e36f2f5bb360e8c54980188ee4b09a979e092c2": {
    "size": 225,
    "fee": 0.0000454,
    "modifiedfee": 0,
    "time": 1527103516,
    "height": 100,
    "startingpriority": 2200000000,
    "currentpriority": 2200000000,
    "descendantcount": 3,
    "descendantsize": 901,
    "descendantfees": 18160,
    "ancestorcount": 0,
    "ancestorsize": 0,
    "ancestorfees": 0,
    "depends": []
  },
  "7922c798ea02c3957393bb7c373ba89e0a337d049564aeb64a9fd2b8d4998795": {
    "size": 225,
    "fee": 0.0000454,
    "modifiedfee": 0,
    "time": 1527103519,
    "height": 100,
    "startingpriority": 0,
    "currentpriority": 0,
    "descendantcount": 2,
    "descendantsize": 676,
    "descendantfees": 13620,
    "ancestorcount": 1,
    "ancestorsize": 0,
    "ancestorfees": 0,
    "depends": [
      "d54e576d30f9014ffb06a31b9e36f2f5bb360e8c54980188ee4b09a979e092c2"
    ]
  },
  ...
}
```

Returns mempool detailed information (on verbose).
Or mempool tx list.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | verbose | false | False returns only tx hashs, true - returns full tx info

## prioritisetransaction

```javascript
let txhash, priorityDelta, feeDelta;
```

```shell--vars
txhash='0e690d6655767c8b388e7403d13dc9ebe49b68e3bd46248c840544f9da87d1e8';
priorityDelta=1000;
feeDelta=1000;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "prioritisetransaction",
    "params": [ "'$txhash'", '$priorityDelta', '$feeDelta' ]
  }'
```

```shell--cli
bcoin-cli rpc prioritisetransaction $txhash $priorityDelta $feeDelta
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('prioritisetransaction', [ txhash, priorityDelta, feeDelta ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
true
```

Prioritises the transaction.

*Note: changing fee or priority will only trick local miner (using this mempool)
into accepting Transaction(s) into the block. (even if Priority/Fee doen't qualify)*

N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | txhash | Required | Transaction hash
2 | priority delta | Required | Virtual priority to add/subtract to the entry
3 | fee delta | Required | Virtual fee to add/subtract to the entry

## estimatefee

```javascript
let nblocks;
```

```shell--vars
nblocks=10;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "estimatefee",
    "params": [ '$nblocks' ]
  }'
```

```shell--cli
bcoin-cli rpc estimatefee $nblocks
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('estimatefee', [ nblocks ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
0.001
```

Estimates fee to be paid for transaction.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | nblocks | 1 | Number of blocks to check for estimation.

## estimatepriority

```javascript
let nblocks;
```

```shell--vars
nblocks=10;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "estimatepriority",
    "params": [ '$nblocks' ]
  }'
```

```shell--cli
bcoin-cli rpc estimatepriority $nblocks
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('estimatepriority', [ nblocks ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
718158904.3501
```

estimates the priority (coin age) that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | nblocks | 1 | Number of blocks to check for estimation.

## estimatesmartfee

```javascript
let nblocks;
```

```shell--vars
nblocks=10;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "estimatesmartfee",
    "params": [ '$nblocks' ]
  }'
```

```shell--cli
bcoin-cli rpc estimatesmartfee $nblocks
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('estimatesmartfee', [ nblocks ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
{
  "fee": 0.001,
  "blocks": 10
}
```

Estimates smart fee to be paid for transaction.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | nblocks | 1 | Number of blocks to check for estimation.

## estimatesmartpriority

```javascript
let nblocks;
```

```shell--vars
nblocks=10;
```

```shell--curl
curl $url \
  -X POST \
  --data '{
    "method": "estimatesmartpriority",
    "params": [ '$nblocks' ]
  }'
```

```shell--cli
bcoin-cli rpc estimatesmartpriority $nblocks
```

```javascript
const {NodeClient, Network} = require('bcoin');
const network = Network.get('regtest');

const clientOptions = {
  network: network.type,
  port: network.rpcPort,
  apiKey: 'api-key'
}

const client = new NodeClient(clientOptions);

(async () => {
  const result = await client.execute('estimatesmartpriority', [ nblocks ]);
  console.log(result);
})();
```

> The above command returns JSON "result" like this:

```json
{
  "priority": 718158904.3501,
  "blocks": 10
}
```

estimates smart priority (coin age) that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction.

### Params
N. | Name | Default |  Description
--------- | --------- | --------- | -----------
1 | nblocks | 1 | Number of blocks to check for estimation.


text:
@implementation SelfiePageViewControllerData

+ (SelfiePageViewControllerData *)sharedInstance {
    static dispatch_once_t onceToken;
    static SelfiePageViewControllerData *sSharedInstance;

    dispatch_once(&onceToken, ^{
        sSharedInstance = [[SelfiePageViewControllerData alloc] init];
    });
    return sSharedInstance;
}

- (NSUInteger)photoCount {

    return self.photoAssets.count;
}

- (UIImage *)photoAtIndex:(NSUInteger)index {

    ALAsset *photoAsset = self.photoAssets[index];

    ALAssetRepresentation *assetRepresentation = [photoAsset defaultRepresentation];

    UIImage *fullScreenImage = [UIImage imageWithCGImage:[assetRepresentation fullScreenImage]
                                                   scale:[assetRepresentation scale]
                                             orientation:ALAssetOrientationUp];
    return fullScreenImage;
}

@end