text:
/*********************************************************************/
/***  Høyland-Kaut-Wallace algorithm for scenario generation       ***/
/***                                                               ***/
/***  author: Michal Kaut                                          ***/
/*********************************************************************/

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>

#include "HKW_sg.h"
#include "HKW_cubic.h"    // cubic transformation
#include "misc_macros.h"  // misc. C macros used here (like frand)
#include "sg_functions.h" // general functions needed for SG

#define StartWithCubic 1 /// Start with the cubic distribution
#define MaxStartTrial 5  /// Max number of starting points per marginal
#define MaxCubIter 2     /// Max number of cubic transf. per HKW iteration

/* MAIN GENERATION FUNCTION
	 Generates one subtree using the HKW algorithm (heuristics)
	 Parameter FormatOfMoms describes the format of target moments.
		It is a sum of following bits:
			1 -> 2nd moment is Var instead of StDev
			2 -> 4th moment is Kurtose - 3
			4 -> Higher moments are not scaled by StDev
			8 -> TarMom[i-1] = E{X^i} ... lower bits are ignored in this case
		=> The reasonable values are 0,1,2,3,6,7,8
	*/
int HKW_ScenGen(int const FormatOfMoms, TMatrix const * const p_TarMoms,
                TMatrix const * const p_TgCorrs, TVector const * const p_Probs,
                TMatrix * const p_OutMat,
                double const MaxErrMom, double const MaxErrCorr,
                int const TestLevel, int const MaxTrial, int const MaxIter,
                int const UseStartValues,
                double * p_errMom, double * p_errCorr,
                int * p_nmbTrial, int * p_nmbIter)
{
	int i,j,s;
	int err_code;

	int nVar = p_OutMat->nrow;
	int nScen = p_OutMat->ncol;

	int iter;
	int trial = 0, start_trial = 0;
	double errMom, errCorr, bestError;
	double tmp_double;

	TMatrix OutMoms=Mat_0, OutCorrs=Mat_0, Chol_OutCorrs=Mat_0,
	        InvChol_OutCorrs=Mat_0, TrsfMat=Mat_0, TmpOutMat=Mat_0;
	TMatrix Chol_TgCorrs=Mat_0;
	TMatrix TgMoms=Mat_0; // The transformed (normalised) moments

	int Chol_TestLevel = TestLevel;

	// Variables for the cubic transformation
	// input data - defined in HKW_cubic.h
	//extern double InMom[13]; // Input moments + In[0]:=1
	//extern double TgMom[4];  // Target moments
	double CubParam[4];        // This is what we want to find
	int cub_iter;
	double cub_error;
	InMom[0] = 1;

	// Check consistency of the input
	CheckInput(p_TarMoms, p_TgCorrs, p_Probs, p_OutMat, TestLevel);

	// Compute the Cholesky decomposition
	// (done in CheckInput(), but not returned)
	Mat_Init(&Chol_TgCorrs, nVar,nVar);
	if (Mat_Cholesky(p_TgCorrs, &Chol_TgCorrs, Chol_TestLevel) > 0) {
		printf("\nProblem with the target correlation matrix");
		printf(" - Cholesky failed!\n\n");
		exit(1);
	}
	if (TestLevel > 3) {
		Mat_Display(p_TgCorrs, "R_tg");
		Mat_Display(&Chol_TgCorrs, "L_tg");
	}

	// Transform the target moments
	Mat_InitAsBigAs(&TgMoms, p_TarMoms);
	CreateTargetMoments(nVar, nScen, (unsigned short) FormatOfMoms,
	                    p_TarMoms->val, TgMoms.val);
	if (TestLevel > 3) {
		Mat_Display(p_TarMoms, "TARMOM");
		Mat_Display(&TgMoms, "MOM");
	}

	// Matrices for the algorithm
	Mat_Init(&OutMoms, 4,nVar);  // moments of outcomes
	Mat_Init(&OutCorrs, nVar,nVar);  // correlations of outcomes
	Mat_Init(&Chol_OutCorrs, nVar,nVar);  // Cholesky decomp of OutCorrs
	Mat_Init(&InvChol_OutCorrs, nVar,nVar);  // inverse of Chol_OutCorrs
	Mat_Init(&TrsfMat, nVar,nVar);  // matrix of the linear transformation
	Mat_InitAsBigAs(&TmpOutMat, p_OutMat);  // temporary outcome matrix

	// TRIALS
	do {

		trial++;
		if (TestLevel > 1)
			printf("\ntrial %d\n", trial);

		if (UseStartValues) {
			// Using starting values
			// !!! HAVE TO TRANSFORM THEM TO MEAN=0, STDEV=1 !!!
			for (i=0; i<nVar; i++)
				for (s=0; s<nScen; s++)
					p_OutMat->val[i][s] = (p_OutMat->val[i][s] - p_TarMoms->val[0][i])
					                      / p_TarMoms->val[1][i];
		}
		else {
			// GENERATING STARTING VALUES
			for (i=0; i<nVar; i++) {

				if (!StartWithCubic) {
					// NOT starting with cubic -> first is the matrix transformation!
					// Start with N(0,1) values, discretizing (FIXED values)
					ArrayOfN01(p_OutMat->val[i], nScen, 1);
				}
				else {
					// Start with cubic
					//  - do it by marginals, test if we can get the right moments directly!!!

					// target moments
					TgMom[0] = TgMoms.val[0][i];
					TgMom[1] = pow(TgMoms.val[1][i],2);
					TgMom[2] = TgMoms.val[2][i] * pow(TgMoms.val[1][i],3);
					TgMom[3] = TgMoms.val[3][i] * pow(TgMoms.val[1][i],4);

					if (TestLevel > 6) {
						printf("CUBIC - Target:");
						for (j=0; j<4; j++)
							printf("  %.4f", TgMom[j]);
						printf("\n");
					}

					start_trial = 0;
					bestError = 1e10;
					do { // trials - different starting distributions
						start_trial++;

						switch (start_trial) {
							case 1:
								// Start with N(0,1) values, discretizing (FIXED values)
								ArrayOfN01(TmpOutMat.val[i], nScen, 1);
								break;
							case MaxStartTrial:
								// Last trial - try uniform instead of N(0,1)!
								for (s=0; s<nScen; s++)
									TmpOutMat.val[i][s] = frand;
								break;
							default:
								// Start with N(0,1) values, RANDOM
								ArrayOfN01(TmpOutMat.val[i], nScen, 0);
								break;
						}

						// CUBIC TRANSFORMATION
						// Repeat the cubic transformation several times if needed
						cub_iter = 0;
						do {
							cub_iter++;

							// compute the 12 moments
							for (j=1; j<=12; j++) {
								InMom[j] = 0;
								for (s=0; s<nScen; s++)
									InMom[j] += p_Probs->val[s]
									            * pow(TmpOutMat.val[i][s],j);
							}
							if (TestLevel > 6) {
								printf("CUBIC - Start:");
								for (j=1; j<=12; j++)
									printf("  %.4f", InMom[j]);
								printf("\n");
							}

							// find the parameters
							cub_error = cubic_solve(CubParam);

							if (TestLevel > 2) {
								printf("Error of the cubic transformation of r.v.");
								printf(" %2d = %g\n", i+1, cub_error);
							}

							if ((cub_error > EPS) && (cub_iter < MaxCubIter)) {
								// transform for new cub_iter; can not use OutMat!
								// using a+bX+cX^2+dX^3 = ((d*X+c)*X+b)*X+a
								for (s=0; s<nScen; s++) {
									tmp_double = CubParam[3]; // d
									for (j=2; j>=0; j--) {
										tmp_double *= TmpOutMat.val[i][s]; // *X
										tmp_double += CubParam[j]; // + c, b, a
									}
									TmpOutMat.val[i][s] = tmp_double;
								} // next s
							} // end if
						} while ((cub_error>EPS) && (cub_iter<MaxCubIter));

						// out of the cub_iter loop
						// cub_error < EPS  OR  cub_iter = MaxCubIter
						if (cub_error < bestError) {
							bestError = cub_error;
							// new best solution -> copy to OutMat
							// do the transformation - directly to OutMat
							// using a+bX+cX^2+dX^3 = ((d*X+c)*X+b)*X+a
							for (s=0; s<nScen; s++) {
								p_OutMat->val[i][s] = CubParam[3]; // d
								for (j=2; j>=0; j--) {
									p_OutMat->val[i][s] *= TmpOutMat.val[i][s]; // *X
									p_OutMat->val[i][s] += CubParam[j]; // + c, b, a
								}
							}
						} // end if
					} while ((cub_error>EPS) && (start_trial<MaxStartTrial));

					if (TestLevel > 0) {
						if ((cub_error<EPS) && (start_trial==MaxStartTrial)) {
							printf("Start values for r.v. %d", i+1);
							printf(" were generated with uniform distribution!\n");
						}
						if ((cub_error>EPS) && (start_trial==MaxStartTrial)) {
							printf("Warning: Did NOT find a good starting point for");
							printf(" r.v. %2d (error = %g)!\n", i+1, bestError);
						}
					}
				} // end: if (StartWithCubic)

			} // next i (starting values for next marginals)
		} // end: if (UseStartValues)

		// Compute starting properties and errors
		ComputeProperties(nVar, nScen, p_OutMat->val, p_Probs->val,
		                  OutMoms.val, OutCorrs.val);
		errMom = ErrorMoments(nVar, OutMoms.val, TgMoms.val);
		errCorr = ErrorCorrs(nVar, OutCorrs.val, p_TgCorrs->val);

		if (TestLevel > 6) {
			if (TestLevel > 10) Mat_DisplayTransp(p_OutMat, "outcomes");
			Mat_DisplayTransp(&OutMoms, "moments");
			Mat_DisplayTransp(&TgMoms, "tg_moms");
			Mat_DisplayTransp(&OutCorrs, "corrs");
			Mat_DisplayTransp(p_TgCorrs, "tg_corrs");
		}
		if (TestLevel > 2) {
			printf("Starting properties:\n");
			printf("  Error in moments is %.4f:\n", errMom);
			if (TestLevel > 3) Mat_Display(&OutMoms, "Moments");
			printf("  Error in correlations is %.4f:\n", errCorr);
			if (TestLevel > 3) Mat_Display(&OutCorrs, "Corrs");
		}

		// MAIN ITERATIONS OF HKW-alg
		iter=0;
		while (((errMom>MaxErrMom) || (errCorr>MaxErrCorr)) && (iter<MaxIter)) {
			iter++;
			if (TestLevel > 2)
				printf("\niter %d\n", iter);

			// Cholesky decomp. of correlation matrix of outcomes
			err_code = Mat_Cholesky(&OutCorrs, &Chol_OutCorrs, Chol_TestLevel);
			if (err_code > 0) {
				printf("\nError in Cholesky decomposition of correlation matrix");
				printf(" of outcomes!\n");
				printf(" - exit code was %d\n\n", err_code);
				goto next_trial;
			}
			Mat_LowTriangInverse(&Chol_OutCorrs, &InvChol_OutCorrs);  // inverse
			// this creates the matrix we multiply with
			Mat_Mult_LeftTriang(&Chol_TgCorrs, 'L', &InvChol_OutCorrs, &TrsfMat);

			if (TestLevel > 3) {
				Mat_Display(&OutCorrs, "R");
				Mat_Display(&Chol_OutCorrs, "L");
				Mat_Display(&InvChol_OutCorrs, "invL");
				Mat_Display(&Chol_TgCorrs, "L_tg");
				Mat_Display(&TrsfMat, "L_iter");
			}

			// THE LINEAR (MATRIX) TRANSFORMATION
			if (Mat_Mult_LeftTriang(&TrsfMat, 'L', p_OutMat, &TmpOutMat) > 0) {
				printf("ERROR during the linear transformation!\n\n");
				goto next_trial;
			}

			// Compute properties and errors
			ComputeProperties(nVar, nScen, TmpOutMat.val, p_Probs->val,
			                  OutMoms.val, OutCorrs.val);
			errMom = ErrorMoments(nVar, OutMoms.val, TgMoms.val);
			errCorr = ErrorCorrs(nVar, OutCorrs.val, p_TgCorrs->val);

			if (TestLevel > 2) {
				printf("After the linear (matrix) transformation:\n");
				printf("  Error in moments is %.4f:\n", errMom);
				if (TestLevel > 3) Mat_Display(&OutMoms, "Moments");
				printf("  Error in correlations is %.4f:\n", errCorr);
				if (TestLevel > 3) Mat_Display(&OutCorrs, "Corrs");
				printf("\n");
			}

			// THE CUBIC TRANSFORMATION - separately for every r.v.
			for (i=0; i<nVar; i++) {

				// set the target moments
				TgMom[0] = TgMoms.val[0][i];
				TgMom[1] = pow(TgMoms.val[1][i],2);
				TgMom[2] = TgMoms.val[2][i] * pow(TgMoms.val[1][i],3);
				TgMom[3] = TgMoms.val[3][i] * pow(TgMoms.val[1][i],4);

				if (TestLevel > 6) {
					printf("CUBIC - Target:");
					for (j=0; j<4; j++)
						printf("  %.4f", TgMom[j]);
					printf("\n");
				}

				cub_iter = 0;
				do { // Repeat the cubic transformation several times if needed
					cub_iter++;

					// compute the 12 moments
					for (j=1; j<=12; j++) {
						InMom[j] = 0;
						for (s=0; s<nScen; s++)
							InMom[j] += p_Probs->val[s] * pow(TmpOutMat.val[i][s],j);
					}
					if (TestLevel > 6) {
						printf("CUBIC - Start:");
						for (j=1; j<=12; j++)
							printf("  %.4f", InMom[j]);
						printf("\n");
					}

					// find the parameters
					cub_error = cubic_solve(CubParam);

					if (TestLevel > 2) {
						printf("Error of the cubic transformation of r.v.");
						printf(" %2d = %g\n", i+1, cub_error);
					}

					// do the transformation
					// using a+bX+cX^2+dX^3 = ((d*X+c)*X+b)*X+a
					for (s=0; s<nScen; s++) {
						p_OutMat->val[i][s] = CubParam[3]; // d
						for (j=2; j>=0; j--) {
							p_OutMat->val[i][s] *= TmpOutMat.val[i][s]; // *X
							p_OutMat->val[i][s] += CubParam[j]; // + c, b, a
						}
					}

					// if we are going to repeat cubic, have to copy data!!!
					if ((cub_error>EPS) && (cub_iter<MaxCubIter))
						for (s=0; s<nScen; s++)
							TmpOutMat.val[i][s] = p_OutMat->val[i][s];

				} while ((cub_error>EPS) && (cub_iter<MaxCubIter));
			} // next variable (to cubic transform)
			if (TestLevel > 2) printf("\n");

			// Compute properties and errors
			ComputeProperties(nVar, nScen, p_OutMat->val, p_Probs->val,
			                  OutMoms.val, OutCorrs.val);
			errMom = ErrorMoments(nVar, OutMoms.val, TgMoms.val);
			errCorr = ErrorCorrs(nVar, OutCorrs.val, p_TgCorrs->val);

			if (TestLevel > 2) {
				printf("After the cubic transformation:\n");
				printf("  Error in moments is %.4f:\n", errMom);
				if (TestLevel > 3) Mat_Display(&OutMoms, "Moments");
				printf("  Error in correlations is %.4f:\n", errCorr);
				if (TestLevel > 3) Mat_Display(&OutCorrs, "Corrs");
			}

			if (TestLevel > 1)
				printf("Distance after iteration %2d = %9.6f\n", iter,
				       errMom + errCorr);
		} // next iter

		if (TestLevel > 0) {
			printf("Distance in trial %2d = %9.6f\n", trial, errMom+errCorr);
			if (TestLevel > 2) printf("\n");
		}
		next_trial:;
	} while (((errMom>MaxErrMom) || (errCorr>MaxErrCorr)) && (trial<MaxTrial));

	// De-allocate matrices
	Mat_Kill(&TgMoms);
	Mat_Kill(&Chol_TgCorrs);
	Mat_Kill(&OutMoms);
	Mat_Kill(&OutCorrs);
	Mat_Kill(&Chol_OutCorrs);
	Mat_Kill(&InvChol_OutCorrs);
	Mat_Kill(&TrsfMat);
	Mat_Kill(&TmpOutMat);

	// Re-scale the outcomes to the original moments
	// Assumes that the second target moment is STANDARD DEVIATION
	//     and that the higher target moments are scaled!!!
	for (i=0; i<nVar; i++)
		for (s=0; s<nScen; s++)
			p_OutMat->val[i][s] = p_TarMoms->val[0][i]
			 + p_TarMoms->val[1][i] * p_OutMat->val[i][s];

	// copy results to the output pointers
	if (p_errMom != NULL) *p_errMom = errMom;
	if (p_errCorr != NULL) *p_errCorr = errCorr;
	if (p_nmbTrial != NULL) *p_nmbTrial = trial;
	if (p_nmbIter != NULL) *p_nmbIter = iter;

	return ( (errMom>MaxErrMom) | (errCorr>MaxErrCorr) ? 1 : 0 );
}

int scengen_HKW(double ** const tgMoms, int const FormatOfMoms,
                double ** const tgCorrs, double * const probs,
                int const nVar, int const nScen, double ** outSc,
                double const MaxErrMom, double const MaxErrCorr,
                int const TestLevel, int const MaxTrial, int const MaxIter,
                int const UseStartValues,
                double * p_errMom, double * p_errCorr,
                int * p_nmbTrial, int * p_nmbIter)
{
	// create temp. matrices and vectors, directly using the provided arrays
	// -> no allocation, unless we get NULL pointers
	TMatrix const TarMoms={4, nVar, tgMoms};
	TMatrix const TgCorrs={nVar, nVar, tgCorrs};
	TVector Probs={nScen, probs};
	if (probs == NULL) {
		Vec_Init(&Probs, nScen);
		double p = 1.0 / (double) nScen;
		int s;
		for (s = 0; s < nScen; ++s) {
			Probs.val[s] = p;
		}
	}
	TMatrix OutMat={nVar, nScen, outSc};
	if (outSc == NULL) {
		Mat_Init(&OutMat, nVar, nScen);
		outSc = OutMat.val;
	}

	int retVal = HKW_ScenGen(FormatOfMoms, &TarMoms, &TgCorrs, &Probs, &OutMat,
	                         MaxErrMom, MaxErrCorr, TestLevel, MaxTrial,
	                         MaxIter, UseStartValues,
	                         p_errMom, p_errCorr, p_nmbTrial, p_nmbIter);

	/* De-allocate the temp. vector of probabilities
	   Note that we cannot kill OutMat, since this would de-allocate the data
	   in outSc! It follows that it is up to the user to free this memory! */
	if (!probs)
		Vec_Kill(&Probs);

	return retVal;
}


text:
@interface ECSingleInstanceViewController ()

@end

@implementation ECSingleInstanceViewController

+ (void)load
{
    [JLRoutes addRoute:@"SingleInstance" handler:^BOOL(NSDictionary *parameters) {
        ECSingleInstanceViewController *viewController = [self sharedInstance];
        viewController.hidesBottomBarWhenPushed = YES;

        return [ECLaunch launchSingleInstanceViewController:viewController
                                                      style:[parameters[@"launchStyle"] integerValue]];
    }];
}

+ (instancetype)sharedInstance
{
    static id instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [self new];
    });
    return instance;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = @"SingleInstance";
}

@end

redpajama_set_name: RedPajamaGithub


text:
package com.github.flbaue.jcrypttool.v1;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by Florian Bauer on 02.01.15.
 */
public class Progress {
    private int progress;
    private boolean finished;
    private List<ProgressListener> progressListenerList = new LinkedList<>();
    private long startTime;
    private long endTime;

    public void updateProgress(int value) {
        progress = value;
        ProgressEvent progressEvent = new ProgressEvent(value);

        for (ProgressListener listener : progressListenerList) {
            listener.progressUpdate(progressEvent);
        }
    }

    void setFinished() {
        endTime = System.currentTimeMillis();
        finished = true;
    }

    public boolean isFinished() {
        return finished;
    }

    public void addProgressListener(ProgressListener listener) {
        progressListenerList.add(listener);
    }

    public long getRuntime() {
        return endTime - startTime;
    }

    void start() {
        startTime = System.currentTimeMillis();
    }
}


text:
@interface FEMObjectMapping : FEMMapping

@property (nonatomic, readonly) Class objectClass;

- (id)initWithObjectClass:(Class)objectClass;
- (id)initWithObjectClass:(Class)objectClass rootPath:(NSString *)rootPath;

+ (instancetype)mappingForClass:(Class)objectClass configuration:(void (^)(FEMObjectMapping *mapping))configuration;
+ (instancetype)mappingForClass:(Class)objectClass
                       rootPath:(NSString *)rootPath
		          configuration:(void (^)(FEMObjectMapping *mapping))configuration;

@end


text:
def extractHirikasMTs(item):
	"""
	"Hirika's MTs"
	"""
	vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
	if not (chp or vol or frag) or 'preview' in item['title'].lower():
		return None

	tagmap = {
		'IDWTDIAOG'                                  : 'I Don\'t Want To Die In An Otome Game',
		'SBS'                                        : 'Sleeping Beauty\'s Sweets',
	}

	for tag, sname in tagmap.items():
		if tag in item['tags']:
			return buildReleaseMessageWithType(item, sname, vol, chp, frag=frag)

	return False


text:
<?php

namespace Google\Service\CloudIAP;

class PolicyDelegationSettings extends \Google\Model
{
  /**
   * @var string
   */
  public $iamPermission;
  /**
   * @var string
   */
  public $iamServiceName;
  protected $policyNameType = PolicyName::class;
  protected $policyNameDataType = '';
  protected $resourceType = IapResource::class;
  protected $resourceDataType = '';

  /**
   * @param string
   */
  public function setIamPermission($iamPermission)
  {
    $this->iamPermission = $iamPermission;
  }
  /**
   * @return string
   */
  public function getIamPermission()
  {
    return $this->iamPermission;
  }
  /**
   * @param string
   */
  public function setIamServiceName($iamServiceName)
  {
    $this->iamServiceName = $iamServiceName;
  }
  /**
   * @return string
   */
  public function getIamServiceName()
  {
    return $this->iamServiceName;
  }
  /**
   * @param PolicyName
   */
  public function setPolicyName(PolicyName $policyName)
  {
    $this->policyName = $policyName;
  }
  /**
   * @return PolicyName
   */
  public function getPolicyName()
  {
    return $this->policyName;
  }
  /**
   * @param IapResource
   */
  public function setResource(IapResource $resource)
  {
    $this->resource = $resource;
  }
  /**
   * @return IapResource
   */
  public function getResource()
  {
    return $this->resource;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(PolicyDelegationSettings::class, 'Google_Service_CloudIAP_PolicyDelegationSettings');


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\search\ProductosSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'ProductoID') ?>

    <?= $form->field($model, 'ProductoNombre') ?>

    <?= $form->field($model, 'ProductoDescripcion') ?>

    <?= $form->field($model, 'ProductoModelo') ?>

    <?= $form->field($model, 'ProductoColor') ?>

    <?php // echo $form->field($model, 'ProductoSKU') ?>

    <?php // echo $form->field($model, 'ProductoIm1') ?>

    <?php // echo $form->field($model, 'ProductoIm2') ?>

    <?php // echo $form->field($model, 'ProductoIm3') ?>

    <?php // echo $form->field($model, 'ProductoDisponible') ?>

    <?php // echo $form->field($model, 'ProductoMaximo') ?>

    <?php // echo $form->field($model, 'Productocol') ?>

    <?php // echo $form->field($model, 'ProductoPrecio') ?>

    <?php // echo $form->field($model, 'ProductoIva') ?>

    <?php // echo $form->field($model, 'TipoProductoID') ?>

    <?php // echo $form->field($model, 'ProveedorID') ?>

        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
@interface TPLocationManager : NSObject

+ (instancetype)sharedInstance;

+ (CLLocationCoordinate2D)currentLocation;

+ (NSString* )locationCity;

+ (NSString* )locationCountry;

+ (NSString* )locationCountryCode;

+ (void)startLocation;

+ (void)startLocationWithCompletion:(void(^)(CLLocation* location))callback;

+ (void)stopLocation;

@end


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;

namespace Microsoft.CodeAnalysis.Diagnostics.Telemetry
{
    /// <summary>
    /// Contains telemetry info for a specific analyzer, such as count of registered actions, the total execution time, etc.
    /// </summary>
    public sealed class AnalyzerTelemetryInfo
    {
        private readonly AnalyzerActionCounts _actionCounts;

        /// <summary>
        /// Count of registered compilation start actions.
        /// </summary>
        public int CompilationStartActionsCount => _actionCounts.CompilationStartActionsCount;

        /// <summary>
        /// Count of registered compilation end actions.
        /// </summary>
        public int CompilationEndActionsCount => _actionCounts.CompilationEndActionsCount;

        /// <summary>
        /// Count of registered compilation actions.
        /// </summary>
        public int CompilationActionsCount => _actionCounts.CompilationActionsCount;

        /// <summary>
        /// Count of registered syntax tree actions.
        /// </summary>
        public int SyntaxTreeActionsCount => _actionCounts.SyntaxTreeActionsCount;

        /// <summary>
        /// Count of registered semantic model actions.
        /// </summary>
        public int SemanticModelActionsCount => _actionCounts.SemanticModelActionsCount;

        /// <summary>
        /// Count of registered symbol actions.
        /// </summary>
        public int SymbolActionsCount => _actionCounts.SymbolActionsCount;

        /// <summary>
        /// Count of registered syntax node actions.
        /// </summary>
        public int SyntaxNodeActionsCount => _actionCounts.SyntaxNodeActionsCount;

        /// <summary>
        /// Count of registered code block start actions.
        /// </summary>
        public int CodeBlockStartActionsCount => _actionCounts.CodeBlockStartActionsCount;

        /// <summary>
        /// Count of registered code block end actions.
        /// </summary>
        public int CodeBlockEndActionsCount => _actionCounts.CodeBlockEndActionsCount;

        /// <summary>
        /// Count of registered code block actions.
        /// </summary>
        public int CodeBlockActionsCount => _actionCounts.CodeBlockActionsCount;

        /// <summary>
        /// Total execution time.
        /// </summary>
        public TimeSpan ExecutionTime { get; }

        internal AnalyzerTelemetryInfo(AnalyzerActionCounts actionCounts, TimeSpan executionTime)
        {
            _actionCounts = actionCounts;
            ExecutionTime = executionTime;
        }
    }
}


text:
{% load ossuo_tags wagtailcore_tags wagtailimages_tags %}

    {% for heroItem in hero %}
        {% image heroItem.background fill-1800x978 as imgbanner %}

    {% endfor %}

        {% if primary_title or secondary_title %}

                {% if primary_title %}{{ primary_title }}{% endif %}
                {{ secondary_title }}

        {% endif %}

            {% for heroItem in hero %}

                {% if heroItem.link %}

                {% endif %}

                        {% image heroItem.logo max-270x270 %}

{{ heroItem.text }}

                {% if heroItem.link %}

                {% endif %}

            {% endfor %}


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

/*
 * Ness
 * Cache component
 *
 * Author CurtisBarogla <curtis_barogla@outlook.fr>
 *
 */

namespace NessTest\Component\Cache\Adapter;

use NessTest\Component\Cache\CacheTestCase;
use Ness\Component\Cache\Adapter\NullCacheAdapter;

/**
 * NullCacheAdapter testcase
 *
 * @author CurtisBarogla <curtis_barogla@outlook.fr>
 *
 */
class NullCacheAdapterTest extends CacheTestCase
{

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::get()
     */
    public function testGet(): void
    {
        $adapter = new NullCacheAdapter();

        $this->assertNull($adapter->get("foo"));
    }

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::getMultiple()
     */
    public function testGetMultiple(): void
    {
        $adapter = new NullCacheAdapter();

        $this->assertSame([null, null], $adapter->getMultiple(["foo", "bar"]));
    }

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::set()
     */
    public function testSet(): void
    {
        $adapter = new NullCacheAdapter();

        $this->assertFalse($adapter->set("foo", "bar", null));
    }

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::setMultiple()
     */
    public function testSetMultiple(): void
    {
         $adapter = new NullCacheAdapter();

         $this->assertSame(["foo", "bar"], $adapter->setMultiple(["foo" => ["value" => "bar", "ttl" => null], "bar" => ["value" => "foo", "ttl" => null]]));
    }

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::delete()
     */
    public function testDelete(): void
    {
        $adapter = new NullCacheAdapter();

        $this->assertFalse($adapter->delete("foo"));
    }

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::deleteMultiple()
     */
    public function testDeleteMultiple(): void
    {
        $adapter = new NullCacheAdapter();

        $this->assertSame(["foo", "bar"], $adapter->deleteMultiple(["foo", "bar"]));
    }

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::has()
     */
    public function testHas(): void
    {
        $adapter = new NullCacheAdapter();

        $this->assertFalse($adapter->has("foo"));
    }

    /**
     * @see \Ness\Component\Cache\Adapter\NullCacheAdapter::purge()
     */
    public function testPurge(): void
    {
        $adapter = new NullCacheAdapter();

        $this->assertNull($adapter->purge(null));
    }

}


text:
module Setup
  module SnippetCodeTemplate
    extend ActiveSupport::Concern

    include SnippetCodeTransformation

    def code_extension
      file_extension.presence || ''
    end
  end
end


text:
// Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they would compete for water and both would die.
//
// Given a flowerbed (represented as an array containing 0 and 1, where 0 means empty and 1 means not empty), and a number n, return if n new flowers can be planted in it without violating the no-adjacent-flowers rule.
//
// Example 1:
//
// Input: flowerbed = [1,0,0,0,1], n = 1
// Output: True
//
//
//
// Example 2:
//
// Input: flowerbed = [1,0,0,0,1], n = 2
// Output: False
//
//
//
// Note:
//
// The input array won't violate no-adjacent-flowers rule.
// The input array size is in the range of [1, 20000].
// n is a non-negative integer which won't exceed the input array size.

/**
 * @param {number[]} flowerbed
 * @param {number} n
 * @return {boolean}
 */
var canPlaceFlowers = function(flowerbed, n) {

    for(let i = 0; i < flowerbed.length; i++){
        let left = i === 0 ? 0 : flowerbed[i-1];
        let right = i === flowerbed.length-1 ? 0 : flowerbed[i+1];

        if(left === 0 && flowerbed[i] === 0 && right ===0){
            flowerbed[i] = 1;
            n--;

            if(n <= 0){
                return true;
            }
        }
    }
    return n <= 0;

};


text:
/**
 * Created by Ihar_Cheliadzinski on 12/14/2015.
 */
"use strict";

module.exports = function (sequelize, DataTypes) {
    var Goal = sequelize.define("Goal", {
        id: {
            type: DataTypes.INTEGER,
            autoIncrement: true,
            primaryKey: true,
            allowNull: false
        }
    }, {
        classMethods: {
            associate: function (models) {
                Goal.hasMany(models.UsersGoal);
                Goal.belongsTo(models.State, {
                    onDelete: "CASCADE",
                    foreignKey: {
                        allowNull: false
                    }
                });
                Goal.belongsTo(models.SkillsLevel, {
                    onDelete: "CASCADE",
                    foreignKey: {
                        allowNull: false
                    }
                });
            }
        }
    });

    return Goal;
};


text:
{% extends "base.html" %}
{% block content %}

            {% if form.errors %}

                        <button type="button" class="close" data-dismiss="alert">×</button>
                        Nope!

Your username and password didn't match. Please try again.

            {% endif %}
            {% load widget_tweaks %}
            <form method="post" action="{% url 'django.contrib.auth.views.login' %}" class="form-horizontal">{% csrf_token %}
                <fieldset>
                    <legend>Login</legend>

                        User name

                            {{ form.username|attr:"placeholder:User name"|attr:"class:form-control" }}

                        Password

                            {{ form.password|attr:"placeholder:Password"|attr:"class:form-control" }}

                            <button type="submit" class="btn btn-primary">Submit</button>

                </fieldset>
            </form>

{% endblock %}


text:
var HelloMessage = React.createClass({
  // borrowed from react documentation
  render: function() {
    // render
    return
Hello {this.props.name}
;
  }
});

React.render(<HelloMessage name="John" />, mountNode);


text:
.. meta::
    :author: Cask Data, Inc.
    :copyright: Copyright © 2015 Cask Data, Inc.

.. _cdap-apps-etl-plugins-real-time-sources-jms:

===============================
Real-time Sources: JMS
===============================

.. rubric:: Description

Java Message Service (JMS) real-time source. Emits a record with a field 'message' of type string.

.. rubric:: Use Case

This source is used whenever you want to read from a JMS queue. For example, you may want to read
from an Apache ActiveMQ queue and write to a stream.

.. rubric:: Properties

**jms.destination.name:** Name of the destination from which to retrieve messages.

**jms.messages.receive:** Maximum number of messages that should be retrieved per poll.
The default value is 50.

**jms.factory.initial:** The fully-qualified class name of the factory class that will be used to create
an initial context. This will be passed to the JNDI initial context as ``java.naming.factory.initial``.

**jms.provider.url:** Information for the service provider URL to use. This will be passed
to the JNDI initial context as ``java.naming.provider.url``.

**jms.jndi.connectionfactory.name:** The name of the connection factory from the JNDI. The default
will be ``ConnectionFactory``.

**jms.plugin.name:** Name of the JMS plugin to use. This is the value of the 'name' key defined in the
JSON file for the JMS plugin. Defaults to ``java.naming.factory.initial``.

**jms.plugin.type:** Type of the JMS plugin to use. This is the value of the 'type' key defined in the
JSON file for the JMS plugin. Defaults to ``JMSProvider``.

**jms.plugin.custom.properties:** Provide any required custom properties as a JSON Map.

.. rubric:: Example

::

  {
    "name":"JMS",
    "properties":{
      "jms.messages.receive": 50,
      "jms.destination.name": "purchases",
      "jms.factory.initial": "org.apache.activemq.jndi.ActiveMQInitialContextFactory",
      "jms.provider.url":"tcp://localhost:61616",
      "jms.plugin.custom.properties": "{\"topic.purchases\":\"purchases\"}"
    }
  }

This example will read from an instance of Apache ActiveMQ running on port 61616 on 'localhost'.
It will poll the 'purchases' topic, reading up to 50 messages with each poll. A record is
emitted for each message read from the topic. The record consists of a single field named 'message'
containing the contents of the message.


text:
require 'delegate'
require 'set'
require 'wisper'

module Routemaster
  module Dirty
    # Collects information about entities whose state has changed and need to be
    # refreshed.
    # Typically +mark+ is called when notified state has changed (e.g. from the
    # bus) and +sweep+ when one wants to know what has changed.
    #
    # Use case: when some entites are very volatile, the map will hold a "dirty"
    # state for multiple updates until the client is ready to update.
    #
    class Map
      include Wisper::Publisher
      KEY = 'dirtymap:items'

      def initialize(redis: nil)
        @redis = redis || Config.drain_redis
      end

      # Marks an entity as dirty.
      # Return true if newly marked, false if re-marking.
      def mark(url)
        @redis.sadd(KEY, url).tap do |marked|
          publish(:dirty_entity, url) if marked
        end
      end

      # Runs the block.
      # The entity will only be marked as clean if the block returns truthy.
      def sweep_one(url, &block)
        return unless block.call(url)
        @redis.srem(KEY, url)
      end

      def all
        @redis.smembers(KEY)
      end

      # Yields URLs for dirty entitities.
      # The entity will only be marked as clean if the block returns truthy.
      # It is possible to call +next+ or +break+ from the block.
      def sweep(limit = 0)
        unswept = []
        while url = @redis.spop(KEY)
          unswept.push url
          is_swept = !! yield(url)
          unswept.pop if is_swept
          break if (limit -=1).zero?
        end
      ensure
        @redis.sadd(KEY, unswept) if unswept.any?
      end

      # Number of currently dirty entities.
      def count
        @redis.scard(KEY)
      end
    end
  end
end


text:
extern crate termion;

use self::termion::event;
use self::termion::raw::{RawTerminal, IntoRawMode};
use self::termion::screen::AlternateScreen;
use self::termion::input::TermRead;
use self::termion::cursor;
use self::termion::color;
use std::io::{self, Write};
use std::iter;

use super::base::*;

macro_rules! decode_color {
    ($x:expr, $c:expr) => {{
        match $c {
            Color::Reset => format!("{}", $x(color::Reset)),
            Color::Black => format!("{}", $x(color::Black)),
            Color::White => format!("{}", $x(color::White)),
            Color::Grey => format!("{}", $x(color::LightBlack)),
        }
    }}
}

impl From<event::Key> for Key {
    fn from(k: event::Key) -> Key {
        match k {
            event::Key::Backspace => Key::Backspace,
            event::Key::Left => Key::Left,
            event::Key::Right => Key::Right,
            event::Key::Up => Key::Up,
            event::Key::Down => Key::Down,
            event::Key::Home => Key::Home,
            event::Key::End => Key::End,
            event::Key::PageUp => Key::PageUp,
            event::Key::PageDown => Key::PageDown,
            event::Key::Delete => Key::Delete,
            event::Key::Insert => Key::Insert,
            event::Key::F(n) => Key::F(n),
            event::Key::Char(c) => Key::Char(c),
            event::Key::Alt(c) => Key::Alt(Box::new(Key::Char(c))),
            event::Key::Ctrl(c) => Key::Ctrl(Box::new(Key::Char(c))),
            event::Key::Null => Key::Null,
            event::Key::Esc => Key::Esc,
            event::Key::__IsNotComplete => panic!("got a weird key from termios"),
        }
    }
}

impl From<event::MouseEvent> for MouseEvent {
    fn from(e: event::MouseEvent) -> MouseEvent {
        match e {
            event::MouseEvent::Press(b, x, y) => MouseEvent::Press(MouseButton::from(b), x as i32, y as i32),
            event::MouseEvent::Release(x, y) => MouseEvent::Release(x as i32, y as i32),
            event::MouseEvent::Hold(x, y) => MouseEvent::Hold(x as i32, y as i32),
        }
    }
}

impl From<event::MouseButton> for MouseButton {
    fn from(b: event::MouseButton) -> MouseButton {
        match b {
            event::MouseButton::Left => MouseButton::Left,
            event::MouseButton::Right => MouseButton::Right,
            event::MouseButton::Middle => MouseButton::Middle,
            event::MouseButton::WheelUp => MouseButton::WheelUp,
            event::MouseButton::WheelDown => MouseButton::WheelDown,
        }
    }
}

impl From<event::Event> for Event {
    fn from(e: event::Event) -> Event {
        match e {
            event::Event::Key(k) => Event::Key(k.into()),
            event::Event::Mouse(m) => Event::Mouse(m.into()),
            event::Event::Unsupported(v) => {
                let vals = v.iter().map(|x| *x as u32).collect();
                if vals == [27, 91, 49, 59, 50, 65] { // <Esc>[1;2A
                    Event::Key(Key::Shift(Box::new(Key::Up)))
                } else if vals == [27, 91, 49, 59, 50, 66] { // <Esc>[1;2B
                    Event::Key(Key::Shift(Box::new(Key::Down)))
                } else if vals == [27, 91, 49, 59, 50, 67] { // <Esc>[1;2C
                    Event::Key(Key::Shift(Box::new(Key::Right)))
                } else if vals == [27, 91, 49, 59, 50, 68] { // <Esc>[1;2D
                    Event::Key(Key::Shift(Box::new(Key::Left)))
                } else {
                    Event::Unsupported(vals)
                }
            }
        }
    }
}

pub struct Terminal {
    out: AlternateScreen<RawTerminal<io::Stdout>>,
}

impl Terminal {
    pub fn keys(&mut self) -> iter::Map<termion::input::Events<io::Stdin>, fn(io::Result<event::Event>) -> Event> {
        fn extract(e: io::Result<event::Event>) -> Event { Event::from(e.unwrap()) }
        io::stdin().events().map(extract)
    }
}

impl Write for Terminal {
    fn write(&mut self, data: &[u8]) -> io::Result<usize> {
        self.out.write(data)
    }

    fn flush(&mut self) -> io::Result<()> {
        self.out.flush()
    }
}

impl Default for Terminal {
    fn default() -> Terminal {
        Terminal {
            out: AlternateScreen::from(io::stdout().into_raw_mode().unwrap()),
        }
    }
}

impl TermImpl for Terminal {
    fn get_size(&self) -> (i32, i32) {
        let (x, y) = termion::terminal_size().unwrap();
        (x as i32, y as i32)
    }

    fn goto(&mut self, (x, y): (i32, i32)) {
        write!(self.out, "{}", cursor::Goto(x as u16, y as u16)).unwrap();
    }

    fn set_color_fg(&mut self, c: Color) {
        write!(self.out, "{}", decode_color!(color::Fg, c)).unwrap();
    }

    fn set_color_bg(&mut self, c: Color) {
        write!(self.out, "{}", decode_color!(color::Bg, c)).unwrap();
    }

    fn clear(&mut self) {
        write!(self.out, "{}", termion::clear::All).unwrap();
    }
}


text:
package gfx;

import java.awt.image.BufferedImage;

public class SpriteSheet {

    private BufferedImage image;

    public SpriteSheet(BufferedImage image){
        this.image = image;
    }

    public BufferedImage crop (int x, int y, int width, int height){
        return image.getSubimage(x, y, width, height);
    }
}


text:
package templemore.liftjson.provider

import fixture.{AddressOutputTransformer, AddressInputTransformer, Address}
import org.specs2.Specification
import util.JsonUtilities
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}

class LiftJsonIntegrationSpec extends Specification
                              with LiftJsonIntegration
                              with JsonUtilities { def is =

  "Specification for the trait integrating lift json support"        ^
                                                                     endp^
  "The lift json integration should"                                 ^
    "convert json into a case class instance"                        ! readCaseClassFromJson^
    "convert a case class instance into json"                        ! writeJsonFromCaseClass^
    "convert transformed json into a case class"                     ! readCaseClassFromTransformedJson^
    "convert a case class instance into transformed json"            ! writeTransformedJsonFromCaseClass^
    "convert json into optional case class fields"                   ! readCaseClassWithOptionalsFromJson^
    "convert a optional case class fields into json"                 ! writeJsonFromCaseClassWithOptionals^
    "deal with not being able to map json to a case class"           ! failureToMapJson^
                                                                     end

  protected def config = ProviderConfig()

  def readCaseClassFromJson = {
    val json = """{
          "lines": [ "Line 1" ],
          "town" : "Town",
          "postcode" : "POSTCODE",
          "country" : "UK"
        }"""

    val entityStream = new ByteArrayInputStream(json.getBytes)
    convertFromJson(classOf[Address].asInstanceOf[Class[AnyRef]],
                    entityStream,
                    None) must_== Right(Address(List("Line 1"), "Town", "POSTCODE", "UK"))
  }

  def writeJsonFromCaseClass = {
    val entityStream = new ByteArrayOutputStream()
    convertToJson(Address(List("Line 1"), "Town", "POSTCODE", "UK"),
                  entityStream, None)
      entityStream.toString must_== compact("""{
          "lines": [ "Line 1" ],
          "town" : "Town",
          "postcode" : "POSTCODE",
          "country" : "UK"
        }""")
  }

  def readCaseClassFromTransformedJson = {
    val json = """{
          "line1" : "Line 1",
          "line2" : "Line 2",
          "town" : "Town",
          "postcode" : "POSTCODE",
          "country" : "UK"
        }"""

    val entityStream = new ByteArrayInputStream(json.getBytes)
    convertFromJson(classOf[Address].asInstanceOf[Class[AnyRef]],
                    entityStream,
                    Some(classOf[AddressInputTransformer])) must_== Right(Address(List("Line 1", "Line 2"), "Town", "POSTCODE", "UK"))
  }

  def writeTransformedJsonFromCaseClass = {
    val entityStream = new ByteArrayOutputStream()
    convertToJson(Address(List("Line 1", "Line 2"), "Town", "POSTCODE", "UK"),
                  entityStream, Some(classOf[AddressOutputTransformer]))
      entityStream.toString must_== compact("""{
          "line1" : "Line 1",
          "line2" : "Line 2",
          "town" : "Town",
          "postcode" : "POSTCODE",
          "country" : "UK"
        }""")
  }

  def readCaseClassWithOptionalsFromJson = {
    val json = """{
          "foo" : "Line 1"
        }"""

    val entityStream = new ByteArrayInputStream(json.getBytes)
    convertFromJson(classOf[FooBar].asInstanceOf[Class[AnyRef]],
                    entityStream,
                    None) must_== Right(FooBar(Some("Line 1"), None))
  }

  def writeJsonFromCaseClassWithOptionals = {
    val entityStream = new ByteArrayOutputStream()
    convertToJson(FooBar(Some("Line 1"), None),
                  entityStream, None)
      entityStream.toString must_== compact("""{
          "foo" : "Line 1"
        }""")
  }

  def failureToMapJson = {
    val json = """{
          "invalid" : "Line 1"
        }"""

    val entityStream = new ByteArrayInputStream(json.getBytes)
    convertFromJson(classOf[BarFoo].asInstanceOf[Class[AnyRef]],
                    entityStream,
                    None) must_== Left(new MappingError("No usable value for foo. Did not find value which can be converted into java.lang.String"))
  }
}

case class FooBar(foo: Option[String], bar: Option[String])
case class BarFoo(foo: String)


text:
package factory

import (
	"k8s.io/kubernetes/pkg/storage"
	"k8s.io/kubernetes/pkg/storage/etcd3"
	"k8s.io/kubernetes/pkg/storage/storagebackend"

	"github.com/coreos/etcd/clientv3"
	"github.com/coreos/etcd/pkg/transport"
	"golang.org/x/net/context"
)

func newETCD3Storage(c storagebackend.Config) (storage.Interface, error) {
	tlsInfo := transport.TLSInfo{
		CertFile: c.CertFile,
		KeyFile:  c.KeyFile,
		CAFile:   c.CAFile,
	}
	tlsConfig, err := tlsInfo.ClientConfig()
	if err != nil {
		return nil, err
	}
	// NOTE: Client relies on nil tlsConfig
	// for non-secure connections, update the implicit variable
	if len(c.CertFile) == 0 && len(c.KeyFile) == 0 && len(c.CAFile) == 0 {
		tlsConfig = nil
	}
	cfg := clientv3.Config{
		Endpoints: c.ServerList,
		TLS:       tlsConfig,
	}
	client, err := clientv3.New(cfg)
	if err != nil {
		return nil, err
	}
	etcd3.StartCompactor(context.Background(), client)
	return etcd3.New(client, c.Codec, c.Prefix), nil
}


text:
These are a couple of software test tools. At the
moment there are just a bunch of scripts to try out various ideas I'm having.
Don't expect fancy install scripts or even a python egg.

Requirements:
  - Windows (Sorry!)
  - pyHook: http://sourceforge.net/projects/pyhook/postdownload?source=dlp
  - docopt: pip install docopt
  - pywin32: http://sourceforge.net/projects/pywin32/files/

monkey_test.py
==============

Description
-----------

Similar to http://developer.android.com/tools/help/monkey.html for Android,
this script simulates pseudo-random user input on a Windows Application. For example mouse movement, clicks, keyboard input, ...

Use case
--------

Test software by sending a huge amount of user input to it. This is a very
low-cost test. A configuration can be set up in a couple of minutes. If run
long enough it will eventually execute a combination of user inputs that will
cause a bug in the program under test (That's the theory anyway).

Usage
-----

The kind of user inputs performed can be configured in a configuration file.
Each line contains a user input. During runtime the program rnadomly chooses
from those lines and performs the corresponding user input.

The basic format of a line is: action:parameter

Example:

    mouse_left_up_or_down

    type:'Test'

    key:'enter'

The following command shows all possible user inputs with their parameters:

    python monkey_test.py --show-functions --detail

Some user inputs aks for keys as parameters. A list of all valid keys can be
shown with:

    python monkey_test.py --show-keys

To start the test, run:

    python monkey_test.py --config FILE

A semi-transparent window will appear. Drag and resize the window so that it
covers the area to test (user inputs will only be executed within this window)
and hit the red start button. By default 1000 user inputs will be simulated.

To increase that value use:

    python monkey_test.py --config FILE --actions=2000

Alternatively it is possible to specify how long (in minutes) the test should
run:

    python monkey_test.py --config FILE --duration=5

The test will usually run until the end. This poses a problem if, for example,
the program under test crashes during the test, it will continue simulating
user inputs. Whatever was under underneath the program under test will receive
those user inputs (possibly the windows desktop). To avoid this problem it is
possible to monitor a log file and stop the user inputs if certain strings
appear in the log file:

    python monkey_test.py --config FILE --check-log C:\\test.log ERROR

Regardless, I always recommend to run monke_test.py in a disposable VM. There
is just too much that can go wrong if random inputs are send to a PC. Don't
blame me if you accidentally format your disk!

Running monkey test again will result in exactly the same user inputs so you
can run it again to reproduce issues. the only problem is that it often runs
to fast to be able to observe anything. It is possible to slow it down after a
certain amount of user inputs. If you simulate 1000 user inputs and you notice a problem after about half of it, it makes sense to slow down after 450 user inputs to be able to see what is happening:

    python monkey_test.py --config FILE --slow-after 450

More options are described in the help:

    python monkey_test.py --help

capture.py / replay.py
======================

Description
-----------

capture.py: Captures user input like mouse movement and keys. When pressing a special key (F12) it takes a screenshot.

replay.py: Replays previously captured user input. It also takes screenshots
at the same stages as during the capture.

Use case
--------

There are two use cases:

1. A tester can run this tool in the background while testing a software. When
a bug is found it can easily be easily reproduced.

2. It can act as a quick & dirty regression test for developers. Before making
any changes to the code, the developer can click through all functionality in
the software and take screenshots regularly. After modifying the code, the
developer can replay the previously recorded actions. This will result in two
sets of screenshots. One from before the modification and one after. These
screenshots can then be compared and checked for (unwanted) differences. A
tool like http://www.imagemagick.org/script/compare.php can help with this.

Usage
-----

To capture inputs:

    python capture.py TEST_FOLDER

While capturing there are two special keys:

* F12: Takes a screenshot and saves it into a folder 'expected' under the specified test folder
* F11: Stops the recording

To replay inputs:

    python replay.py TEST_FOLDER

Screenshots will be taken and put in a folder with the current date/time as
its name.

The input will always be recorded relative to the current active window. This
ensures that the replay will still work even if the window has been moved in
the meantime.


text: API service library


text: /* global styles here */


text:
package org.terasology.persistence.typeHandling.coreTypes;

import com.google.common.collect.Sets;
import org.terasology.persistence.typeHandling.DeserializationContext;
import org.terasology.persistence.typeHandling.PersistedData;
import org.terasology.persistence.typeHandling.SerializationContext;
import org.terasology.persistence.typeHandling.SimpleTypeHandler;
import org.terasology.persistence.typeHandling.TypeHandler;

import java.util.Set;

/**
 */
public class SetTypeHandler<T> extends SimpleTypeHandler<Set<T>> {
    private TypeHandler<T> contentsHandler;

    public SetTypeHandler(TypeHandler contentsHandler) {
        this.contentsHandler = contentsHandler;
    }

    public TypeHandler getContentsHandler() {
        return contentsHandler;
    }

    @Override
    public PersistedData serialize(Set<T> value, SerializationContext context) {
        return contentsHandler.serializeCollection(value, context);
    }

    @Override
    public Set<T> deserialize(PersistedData data, DeserializationContext context) {
        return Sets.newLinkedHashSet(contentsHandler.deserializeCollection(data, context));
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
  <Id>85c389da-047f-406c-bb4c-d9ede06884ce</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Contoso</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="word-add-in-commands"/>
  <Description DefaultValue="A template to get started."/>
  <IconUrl DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/assets/icon-64.png"/>
  <SupportUrl DefaultValue="https://docs.microsoft.com/office/dev/add-ins/develop/create-addin-commands"/>
  <AppDomains>
    <AppDomain>https://officedev.github.io</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Document"/>
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/src/taskpane/taskpane.html"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="Contoso.GetStarted.Title"/>
            <Description resid="Contoso.GetStarted.Description"/>
            <LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <FunctionFile resid="Commands.Url"/>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
             <OfficeTab id="TabHome">
				  <!-- Ensure you provide a unique id for the group. Recommendation for any IDs is to namespace using your company name. -->
				  <Group id="Contoso.Group1">
					  <!-- Label for your group. resid must point to a ShortString resource. -->
					  <Label resid="Contoso.Group1Label" />
					  <!-- Icons. Required sizes 16,32,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX. -->
					  <!-- Use PNG icons. All URLs on the resources section must use HTTPS. -->
					  <Icon>
						  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
						  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
						  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
					  </Icon>

					  <!-- Control. It can be of type "Button" or "Menu". -->
					  <Control xsi:type="Button" id="Contoso.TaskpaneButton">
						  <Label resid="Contoso.TaskpaneButton.Label" />
						  <Supertip>
							  <!-- ToolTip title. resid must point to a ShortString resource. -->
							  <Title resid="Contoso.TaskpaneButton.Label" />
							  <!-- ToolTip description. resid must point to a LongString resource. -->
							  <Description resid="Contoso.TaskpaneButton.Tooltip" />
						  </Supertip>
						  <Icon>
							  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
							  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
							  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
						  </Icon>

						  <!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. -->
						  <Action xsi:type="ShowTaskpane">
							  <TaskpaneId>ButtonId1</TaskpaneId>
							  <!-- Provide a URL resource id for the location that will be displayed on the task pane. -->
							  <SourceLocation resid="Contoso.Taskpane.Url" />
						  </Action>
					  </Control>
					  <Control xsi:type="Menu" id="Contoso.Menu">
						  <Label resid="Contoso.Menu.Label" />

						  <Supertip>
							  <Title resid="Contoso.Menu.Label" />
							  <Description resid="Contoso.Menu.Tooltip" />
						  </Supertip>
						  <Icon>
							  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
							  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
							  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
						  </Icon>
						  <Items>
							  <Item id="itemShowTaskPane">
								  <Label resid="Contoso.Item1.Label"/>
								  <Supertip>
									  <Title resid="Contoso.Item1.Label" />
									  <Description resid="Contoso.Item1.Tooltip" />
								  </Supertip>
								  <Icon>
									  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
									  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
									  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
								  </Icon>
								  <Action xsi:type="ShowTaskpane">
									  <TaskpaneId>ButtonId1</TaskpaneId>
									  <SourceLocation resid="Contoso.Taskpane.Url" />
								  </Action>
							  </Item>
							  <Item id="itemExecuteFunction">
								  <Label resid="Contoso.Item2.Label"/>
								  <Supertip>
									  <Title resid="Contoso.Item2.Label" />
									  <Description resid="Contoso.Item2.Tooltip" />
								  </Supertip>
								  <Icon>
									  <bt:Image size="16" resid="Contoso.tpicon_16x16" />
									  <bt:Image size="32" resid="Contoso.tpicon_32x32" />
									  <bt:Image size="80" resid="Contoso.tpicon_80x80" />
								  </Icon>
								  <Action xsi:type="ExecuteFunction">
									  <FunctionName>writeValue</FunctionName>
								  </Action>
							  </Item>
						  </Items>
					  </Control>
				  </Group>
			  </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
		  <bt:Images>
			  <bt:Image id="Contoso.tpicon_16x16" DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/assets/icon-16.png" />
			  <bt:Image id="Contoso.tpicon_32x32" DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/assets/icon-32.png" />
			  <bt:Image id="Contoso.tpicon_80x80" DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/assets/icon-80.png" />
		  </bt:Images>
		  <bt:Urls>
			  <bt:Url id="Commands.Url" DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/src/commands/commands.html" />
			  <bt:Url id="Contoso.Taskpane.Url" DefaultValue="https://officedev.github.io/PnP-OfficeAddins/Samples/office-add-in-commands/word/src/taskpane/taskpane.html" />
			  <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
		  </bt:Urls>
		  <!-- ShortStrings max characters==125. -->
		  <bt:ShortStrings>
			  <bt:String id="Contoso.TaskpaneButton.Label" DefaultValue="Show task pane" />
			  <bt:String id="Contoso.WriteValueButton.Label" DefaultValue="Show task pane" />
			  <bt:String id="Contoso.Item1.Label" DefaultValue="Show task pane" />
			  <bt:String id="Contoso.Item2.Label" DefaultValue="Write value" />
			  <bt:String id="Contoso.Menu.Label" DefaultValue="Dropdown menu" />
			  <bt:String id="Contoso.Group1Label" DefaultValue="Commands group" />
			  <bt:String id="Contoso.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
		  </bt:ShortStrings>
		  <!-- LongStrings max characters==250. -->
		  <bt:LongStrings>
			  <bt:String id="Contoso.TaskpaneButton.Tooltip" DefaultValue="Choose to show a task pane" />
			  <bt:String id="Contoso.Item1.Tooltip" DefaultValue="Choose to show a task pane" />
			  <bt:String id="Contoso.Item2.Tooltip" DefaultValue="Choose to show a task pane" />
			  <bt:String id="Contoso.Menu.Tooltip" DefaultValue="Show the dropdown menu" />

			  <bt:String id="Contoso.WriteValueButton.Tooltip" DefaultValue="Choose to write value to document" />
			  <bt:String id="Contoso.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and choose the 'Show task pane' button to get started." />
		  </bt:LongStrings>
	  </Resources>
  </VersionOverrides>
</OfficeApp>


text:
import defineMemoizedProperty = require( './index' );

// TESTS //

// The function returns `undefined`...
{
	defineMemoizedProperty( {}, 'foo', { 'value': (): string => 'bar' } ); // $ExpectType void
	defineMemoizedProperty( {}, 'foo', { 'configurable': true, 'enumerable': true, 'writable': true, 'value': (): string => 'bar' } ); // $ExpectType void
}

// The compiler throws an error if the function is provided a second argument which is not a valid property name...
{
	defineMemoizedProperty( {}, true, { 'value': (): string => 'bar' } ); // $ExpectError
	defineMemoizedProperty( {}, false, { 'value': (): string => 'bar' } ); // $ExpectError
	defineMemoizedProperty( {}, null, { 'value': (): string => 'bar' } ); // $ExpectError
	defineMemoizedProperty( {}, undefined, { 'value': (): string => 'bar' } ); // $ExpectError
	defineMemoizedProperty( {}, [], { 'value': (): string => 'bar' } ); // $ExpectError
	defineMemoizedProperty( {}, {}, { 'value': (): string => 'bar' } ); // $ExpectError
	defineMemoizedProperty( {}, ( x: number ): number => x, { 'value': (): string => 'bar' } ); // $ExpectError
}

// The compiler throws an error if the function is provided a third argument which is not a valid descriptor object...
{
	defineMemoizedProperty( {}, 'foo', '5' ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', 5 ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', true ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', false ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', null ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', undefined ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', [] ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', {} ); // $ExpectError

	defineMemoizedProperty( {}, 'foo', { 'configurable': true ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', { 'configurable': 'true', 'value': (): string => 'bar' } ); // $ExpectError

	defineMemoizedProperty( {}, 'foo', { 'enumerable': true ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', { 'enumerable': 'true', 'value': (): string => 'bar' } ); // $ExpectError

	defineMemoizedProperty( {}, 'foo', { 'writable': true ); // $ExpectError
	defineMemoizedProperty( {}, 'foo', { 'writable': 'true', 'value': (): string => 'bar' } ); // $ExpectError
}

// The compiler throws an error if the function is provided insufficient arguments...
{
	defineMemoizedProperty(); // $ExpectError
	defineMemoizedProperty( {} ); // $ExpectError
	defineMemoizedProperty( {}, 'foo' ); // $ExpectError
}


text:
package gov.va.med.imaging.core;

import java.util.regex.Pattern;

/**
 * ENUM of all permissible prepositions with synonyms.
 */
public enum Preposition
{
	BY(new String[] { "[bB]y" }),
	LIKE(new String[] { "[lL]ike" });

	private String[] expression;

	Preposition(String[] expression)
	{
		this.expression = expression;
	}

	public String[] getExpression()
	{
		return expression;
	}

	public String getNominalExpression()
	{
		return this.expression[0];
	}

	// for purposes of lookup the synonyms are case-insensitive
	public static Preposition getPreposition(String synonym)
	{
		if (synonym == null)
			return null;

		synonym = synonym.toLowerCase();
		for (Preposition preposition : Preposition.values())
			for (String prepositionSynonym : preposition.getExpression())
				if(Pattern.matches(prepositionSynonym, synonym))
					return preposition;
		return null;
	}

	/**
	 * @return
	 */
	public Object toStringFirstCharUpperCase()
	{
		String result = this.name().toLowerCase();
		result = Character.toUpperCase(result.charAt(0))
				+ result.substring(1);
		return result;
	}
}


text:
<?php

namespace Acacha\Llum\Traits;

/**
 * Class GetSetable.
 */
trait GetSetable
{
    /**
     * Get/set a field.
     *
     * @param string $field
     * @param mixed  $fieldValue
     *
     * @return $this|string
     */
    private function getterSetter($field, $fieldValue)
    {
        if ($fieldValue == null) {
            return $this->$field;
        }

        $this->$field = $fieldValue;

        return $this;
    }
}


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

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
           id="org.apache.cordova.console"
      version="0.2.3">

    <name>Console</name>
    <description>Cordova Console Plugin</description>
    <license>Apache 2.0</license>
    <keywords>cordova,console</keywords>

    <!-- ios -->
    <platform name="ios">

        <config-file target="config.xml" parent="/*">
		<feature name="Console">
			<param name="ios-package" value="CDVLogger"/>
		</feature>
        </config-file>

        <js-module src="www/console-via-logger.js" name="console">
            <clobbers target="console" />
        </js-module>

        <js-module src="www/logger.js" name="logger">
            <clobbers target="cordova.logger" />
        </js-module>

	<header-file src="src/ios/CDVLogger.h" />
	<source-file src="src/ios/CDVLogger.m" />

    </platform>

    <!-- wp7 -->
    <platform name="wp7">
        <config-file target="config.xml" parent="/*">
            <feature name="Console">
                <param name="wp-package" value="DebugConsole"/>
            </feature>
        </config-file>

        <js-module src="www/console-via-logger.js" name="console">
            <clobbers target="console" />
        </js-module>

        <js-module src="www/logger.js" name="logger">
            <clobbers target="cordova.logger" />
        </js-module>

        <source-file src="src/wp/DebugConsole.cs" />
    </platform>

    <!-- wp8 -->
    <platform name="wp8">
        <config-file target="config.xml" parent="/*">
            <feature name="Console">
                <param name="wp-package" value="DebugConsole"/>
            </feature>
        </config-file>

        <js-module src="www/console-via-logger.js" name="console">
            <clobbers target="console" />
        </js-module>

        <js-module src="www/logger.js" name="logger">
            <clobbers target="cordova.logger" />
        </js-module>

        <source-file src="src/wp/DebugConsole.cs" />
    </platform>

        <!-- windows8 -->
    <platform name="windows8">
        <js-module src="www/logger.js" name="logger">
            <clobbers target="cordova.logger" />
        </js-module>
        <js-module src="www/console-via-logger.js" name="console">
            <clobbers target="console" />
        </js-module>

    </platform>

</plugin>


text:
class Grade():
    def __init__(self, grade):
        self._grade = self.assign_grade(grade)

    def assign_grade(self, letter):
        if letter == "A+":
            return 5.3
        elif letter == "A":
            return 5
        elif letter == "A-":
            return 4.7
        elif letter == "B+":
            return 4.3
        elif letter == "B":
            return 4
        elif letter == "B-":
            return 3.7
        elif letter == "C+":
            return 3.3
        elif letter == "C":
            return 3
        elif letter == "C-":
            return 2.7
        elif letter == "D+":
            return 2.3
        elif letter == "D":
            return 2
        elif letter == "D-":
            return 1.7
        elif letter == "F+":
            return 1.3
        elif letter == "F":
            return 1

    def get_grade(self):
        return self._grade

class Student():
    def __init__(self, name, score):
        self._name = name
        self._total_score = score
        self._scores = 1

    def get_name(self):
        return self._name

    def add_quiz(self, grade_object):
        self._total_score += grade_object.get_grade()
        self._scores += 1

    def get_total_score(self):
        return self._total_score

    def get_scores_count(self):
        return self._scores

    def get_average_score(self):
        return self._total_score / self._scores


text:
require "spyme/engine"
require "spyme/model"
require "spyme/controller"

module Spyme
end

ActionController::Base.send :include, Spyme::Controller


text:
/**
 * @author Carsten Könemann
 */
#ifndef __GRAHAM_SCANNER__
#define __GRAHAM_SCANNER__

#include <opencv2/core/core.hpp>

class GrahamScanner
{
  public:
    static cv::Point2f p0;

    static void grahamScan(std::vector<cv::Point2f>& input,
                           std::vector<cv::Point2f>& output);
};

#endif //__GRAHAM_SCANNER__


text: R CMD REMOVE --library=$PREFIX/lib/R/library/ TxDb.Btaurus.UCSC.bosTau9.refGene


text:
package com.github.jonathanxd.wcommands.ext.reflect.processor.exception;

/**
 * Created by jonathan on 12/03/16.
 */
public class InvalidDependency extends RuntimeException {
    public InvalidDependency() {
        super();
    }

    public InvalidDependency(String message) {
        super(message);
    }

    public InvalidDependency(String message, Throwable cause) {
        super(message, cause);
    }

    public InvalidDependency(Throwable cause) {
        super(cause);
    }

    protected InvalidDependency(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}


text:
{% extends "guest_base.html" %}

{% load form_tags %}

{% block head_extra %}
    {% include "accounts/method_select.html"%}
{% endblock %}

{% block content %}

<form action="/login/" name="login_form" method="post">

{% if form.non_field_errors or openid_failure %}

{% if form.non_field_errors %}
    {{form.non_field_errors}}
{% else %}
    {{openid_failure}}
{% endif %}

{% endif %}

{% formfield form.method %}

{% formfield form.email %}
{% formfield form.password %}

{% formfield form.openid %}

<input type="submit" name="submit" value="Login" />

</form>

{% endblock %}


text:
show a schema

### Synopsis

Show a schema, specified by `name`. In successful cases, this command prints JSON. This command corresponds to calling `GET /v1/schemas/{name}`.

```
gestalt schema show {name}
```

### Options inherited from parent commands

```
      --host="localhost:3000": API hostname
      --pretty[=true]: pretty-print responses
      --scheme="http": set the request scheme
      --timeout=20s: set the request timeout
```

### SEE ALSO
* [gestalt schema](gestalt_schema.md)	 - work with schemas

###### Auto generated by spf13/cobra on 22-Dec-2015


text:
using System;
using System.Runtime.InteropServices;

namespace SharpVk.Khronos
{
    /// <summary>
    /// Structure describing display mode properties.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public partial struct DisplayModeProperties
    {
        /// <summary>
        /// A handle to the display mode described in this structure. This
        /// handle will be valid for the lifetime of the Vulkan instance.
        /// </summary>
        public SharpVk.Khronos.DisplayMode DisplayMode
        {
            get;
            set;
        }

        /// <summary>
        /// A DisplayModeParametersKHR structure describing the display
        /// parameters associated with displayMode.
        /// </summary>
        public SharpVk.Khronos.DisplayModeParameters Parameters
        {
            get;
            set;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="pointer">
        /// </param>
        internal static unsafe DisplayModeProperties MarshalFrom(SharpVk.Interop.Khronos.DisplayModeProperties* pointer)
        {
            DisplayModeProperties result = default(DisplayModeProperties);
            result.DisplayMode = new SharpVk.Khronos.DisplayMode(default(SharpVk.PhysicalDevice), pointer->DisplayMode);
            result.Parameters = pointer->Parameters;
            return result;
        }
    }
}


text:
@charset "utf-8";

/* RESET CSS */
* { margin:0; padding:0; outline:0; vertical-align:top; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu nav, section { display:block; }
ul, ol, dl { list-style:none; }
img, video { max-width:100%; border:0; vertical-align:top; }
a {vertical-align:top; text-decoration:none; color:#000; }
table { border-collapse:collapse; border-spacing:0; }
input, select { vertical-align:middle; }
body, th, td, input, select, textarea { color:#444; font-family:'Malgun Gothic','돋움',dotum, sans-serif; font-size:14px; line-height:1.8em;}
button { cursor:pointer; font-family: 'Noto Sans', sans-serif; }
html, body { margin:0; padding:0; width: 100%; height:100%; background-color: #fff;
font-family: 'Noto Sans','Malgun Gothic','돋움',dotum, sans-serif;}
ul, li {margin:0; padding:0; }

/* ///// LAYOUT ///// */
.mapWrap {
	height: 100%;
	background-color: #eee;
}

/* NAV */
.nav {
	position: absolute;
	float: left;
	width: 65px;
	height: 100%;
	background-color: #393946;
	z-index: 9999;
}
.nav li {
	margin-left: 3px;
	padding: 10px 0;
	color: #fff;
	text-align: center;
	/* 	text-indent: -999em; */
	border: none;
	cursor: pointer;
	border-top: 1px solid #484854;
	border-bottom: 1px solid #27272f;
}
.nav li.on {
	color: #67aef7 !important;
	border-radius: 5px 0 0 5px;
	background-color: #fff;
}
.nav li.issue > span {
	display: inline-block;
	min-width: 20px;
	height: 20px;
	padding: 2px;
	cursor: pointer;
	text-align: center;
	border-radius:5px;
	line-height: 1.5em;
	background-color: tomato;
}
nav li.issue > span * {
	vertical-align: middle;
	color: #fff;
}
.nav li.issue {
	background-position: 0 -50px;
}
.nav li.home {
	background-position: 0 -50px;
}
.nav li.regist {
	background-position: 0 -50px;
}
.nav li.search {
	background-position: 0 -50px;
}
.nav li.api {
	background-position: 0 -50px;
}
.nav li.tree {
	background-position: 0 -50px;
}
.nav li.chart {
	background-position: 0 -50px;
}
.nav li.log {
	background-position: 0 -50px;
}
.nav li.attribute {
	background-position: 0 -50px;
}
.nav li.config {
	background-position: 0 -50px;
}

/* ///// LAYER ///// */
.layer {
	display:none;
	position: absolute;
	top:40%;
	left:50%;
	width:450px;
	margin:-250px 0 0 -150px;
	background: #fff;
	z-index: 100;
}
.layerHeader {
	position: relative;
	border-bottom: 1px dotted #0066cc;
	background-color: #fff;
}
.layerHeader > h2 {
	padding: 10px;
	color: #0066cc;
	font-size: 15px;
}
.layerContents > h4 {
	margin:0;
	padding-left: 20px;
	font-size: 16px;
	font-weight: 600;
	background: url(/images/ko/homepage/bullet_h4.png) no-repeat left 50%;
}
.layerHeader > div {
	position: absolute;
	top: 7px;
	right: 3px;
	width: 30px;
	height: 30px;
}
.layerHeader div > button {
	width: 30px;
	height: 30px;
	border: none;
	text-indent: -999em;
	background-image: url(/images/ko/homepage/ico.png);
	background-color: transparent;
	background-position: 1px -264px;
}
.layerHeader div > button:hover {
	border-radius: 15px;
	background-color: #eee;
}

/* CONTENTS */
.layerContents {
	padding: 10px;
	overflow: hidden;
}
.layerContents p.groupTitle {
	margin-bottom: 5px;
	padding: 0 10px;
	color: #2955a6;
	font-weight: bold;
}
.layerContents .group {
	margin-bottom: 20px;
	padding: 10px;
}
.layerContents .group li {
	display: inline-block;
	width: 30%;
	padding: 5px 0;
}
.layerContents table {
	width: 100%;
	margin-bottom: 20px;
	border-top: 2px solid #0066cc;
}
.layerContents table th {
	background-color: #eee;
	border-left: 0px solid #ccc;
	border-bottom: 1px solid #ccc;
}
.layerContents table td {
	padding: 5px;
	text-align: left;
	border-bottom: 1px solid #ccc;
}

/* 버튼 */
.btns {
	margin: 15px 0;
}
.btns > button {
	width: 100%;
	padding: 10px 0;
	border-radius: 3px;
	transition: all 0.5s;
	border: none;
	color: #fff;
	background: #2955a6;
}
.btns > button:hover {
	background: tomato;
}

button.btn {
	padding: 5px 7px;
	border-radius: 3px;
	transition: all 0.5s;
	border: none;
	color: #fff;
	background: #2955a6;
}
button.btn:hover {
	background: tomato;
}
button.btn.on {
	background: tomato;
}

/*Nav Contents 추가 0807 */
.navContents {
	display:none;
	position: absolute;
	float: left;
	width: 442px;
	height: 100%;
	overflow: auto;
	background-color: #fff;
	z-index: 100;
}

.alignRight {
	text-align: right;
}
.navClose {
	width: 27px;
	height: 27px;
	text-indent: -999em;
	border: none;
	background: url(/images/ko/homepage/ico.png) no-repeat -90px -265px;
}

.menuList {
	display:none;
}
.searchWrap {
	display:none;
}
.apiWrap {
	display:none;
}
.insertIssueWrap {
	display:none;
}
.treeWrap {
	display:none;
}
.chartWrap {
	display:none;
}
.logWrap {
	display:none;
}
.attributeWrap {
	display:none;
}
.configWrap {
	display:none;
}

/* Home */
.navContents ul.menuList {
	margin: 10px 15px 0px 80px;
}
.menuList > li {
	position: relative;
	padding: 10px 10px 10px 15px;
	border-bottom: 1px dotted #ccc;
	cursor: pointer;
}
.menuList li:hover {
	background-color: #ffffe0;
}
.menuList > li > ul > li {
	padding-left: 25px;
}

/* issue */
.issueList > li {
	position: relative;
	padding: 5px 10px 0px 75px;
	border-bottom: 1px dotted #ccc;
	cursor: pointer;
}
.issueList li:hover {
	background-color: #ffffe0;
}
.issueList li div.info {
	margin-left: 10px;
}
.issueList li div.info p.title span {
	display: block;
	font-weight: bold;
}
.issueList li div.info p.title {
	margin-bottom: 10px;
	line-height: 1.3em;
}
.issueList li div.info ul.tag {
	margin-top: 5px;
}
.issueList li div.info ul.tag li {
	display: inline-block;
}
.issueList li div.info ul.tag li *{
	vertical-align: middle;
}
.issueList li div.info ul.tag li span {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin: -3px 5px 0 0;
	border-radius: 5px;
}
.issueList li div.info ul.tag li.date {
	position: absolute;
	right: 10px;
	font-size: 12px;
	color: #888;
}
.issueList li > button {
	float: right;
	width: 47px;
	height: 40px;
	margin-top: 5px;
	text-indent: -999em;
	border: none;
	background-image: url(/images/ko/homepage/ico.png);
	background-repeat: no-repeat;
	background-position: 10px -468px;
	background-color: transparent;
}

/* TAG > Issue */
.i1 {
	background-color: #ff3300;
}
.i2 {
	background-color: darkorange;
}
.i3 {
	background-color: darkturquoise;
}
.i4 {
	background-color: deepskyblue;
}
/* TAG > Type */
.t1 {
	background-color: #777;
}
.t2 {
	background-color: #777;
}
.t3 {
	background-color: #777;
}
.t4 {
	background-color: #777;
}

/* Search */
.navContents div.searchWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.searchWrap > div h3 {
	margin-bottom: 8px;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.searchWrap > div {
	padding-bottom: 7px;
/* 	border-bottom: 1px dotted #888; */
}
.searchWrap > div:last-child {
	border-bottom: none;
}
.searchWrap div label {
	display: inline-block;
	margin-right: 10px;
}
.searchList > li {
	position: relative;
	padding: 5px 10px 0px 0px;
	border-bottom: 1px dotted #ccc;
	cursor: pointer;
}
.searchList li:hover {
	background-color: #ffffe0;
}
.searchList li div.info {
	margin-left: 10px;
}
.searchList li div.info p.title span {
	display: block;
	font-weight: bold;
}
.searchList li div.info p.title {
	margin-bottom: 10px;
	line-height: 1.3em;
}
.searchList li div.info ul.tag {
	margin-top: 5px;
}
.searchList li div.info ul.tag li {
	display: inline-block;
}
.searchList li div.info ul.tag li *{
	vertical-align: middle;
}
.searchList li div.info ul.tag li span {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin: -3px 5px 0 0;
	border-radius: 5px;
}
.searchList li div.info ul.tag li.date {
	position: absolute;
	right: 10px;
	font-size: 12px;
	color: #888;
}
.searchList li > button {
	float: right;
	width: 47px;
	height: 40px;
	margin-top: 5px;
	text-indent: -999em;
	border: none;
	background-image: url(/images/ko/homepage/ico.png);
	background-repeat: no-repeat;
	background-position: 10px -468px;
	background-color: transparent;
}

/* API */
.navContents div.apiWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.apiWrap > div h3 {
	margin-bottom: 8px;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.apiLoca > li {
	margin-bottom: 5px;
}
.apiLoca > li label {
	display: inline-block;
	width: 70px;
}
.full {
	width: 100%;
}
.apiWrap > div {
	padding-bottom: 7px;
	border-bottom: 1px dotted #888;
}
.apiWrap > div:last-child {
	border-bottom: none;
}
.apiWrap div label {
	display: inline-block;
	margin-right: 10px;
}

/* ISSUE 등록 */
.navContents div.insertIssueWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.insertIssueWrap h3 {
	margin: 5px 0;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.insertIssueWrap > div {
	padding-bottom: 7px;
	border-bottom: 1px dotted #888;
}
.insertIssueWrap > div:last-child {
	border-bottom: none;
}
.insertIssueWrap div label {
	display: inline-block;
	margin-right: 10px;
}

/* tree */
.navContents div.treeWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.treeWrap > div h3 {
	margin-bottom: 8px;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.treeWrap > div {
	padding-bottom: 7px;
	border-bottom: 1px dotted #888;
}
.treeWrap > div:last-child {
	border-bottom: none;
}
.treeWrap div label {
	display: inline-block;
	margin-right: 10px;
}

/* chart */
.navContents div.chartWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.chartWrap > div h3 {
	margin-bottom: 8px;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.chartWrap > div {
	padding-bottom: 7px;
	//border-bottom: 1px dotted #888;
}
.chartWrap > div:last-child {
	border-bottom: none;
}
.chartWrap div label {
	display: inline-block;
	margin-right: 10px;
}

/* log */
.navContents div.logWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.logWrap > div h3 {
	margin-bottom: 8px;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.logWrap > div {
	padding-bottom: 7px;
	border-bottom: 1px dotted #888;
}
.logWrap > div:last-child {
	border-bottom: none;
}
.logWrap div label {
	display: inline-block;
	margin-right: 10px;
}

/* attribute */
.navContents div.attributeWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.attributeWrap > div h3 {
	margin-bottom: 8px;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.attributeWrap > div {
	padding-bottom: 7px;
	border-bottom: 1px dotted #888;
}
.attributeWrap > div:last-child {
	border-bottom: none;
}
.attributeWrap div label {
	display: inline-block;
	margin-right: 10px;
}

/* 설정 */
.navContents div.configWrap {
	margin: 10px 15px 0px 80px;
}
.navContents div.configWrap > div h3 {
	margin-bottom: 8px;
	font-size: 1em;
	font-weight: normal;
	color: #2955a6;
}
.configWrap > div {
	padding-bottom: 7px;
	border-bottom: 1px dotted #888;
}
.configWrap > div:last-child {
	border-bottom: none;
}
.configWrap div label {
	display: inline-block;
	margin-right: 10px;
}

/* 바로가기 */
.shortcut {
	position: absolute;
	left: 50%;
	transform: translate(-50%);
	display: table;
	margin: 0 auto;
	border-radius: 0 0 10px 10px;
	background-color: tomato;
	z-index: 90;
}
.shortcut > li {
	display: inline-block;
	margin: 3px;
	padding: 3px 10px;
	color: #fff;
	cursor: pointer;
	list-style-position: inside;
	list-style-type: disc;
}
.shortcut > li:hover {
	color: #ff5b59;
	border-radius: 15px;
	background-color: #fff;
}

.select {
	min-width: 30px;
	height: 30px;
	padding-left: 10px;
	font-size: 14px;
	color: #666;
	border: 1px solid #666;
	border-radius: 3px;
}

.color-warning {
	background: rgba(0, 0, 0, 0) url("/images/ko/common/bg_point.png") no-repeat scroll center center;
    display: inline-block;
    height: 4px;
    margin: 0 5px;
    text-indent: -99999px;
    vertical-align: middle;
    width: 6px;
}

/*
	css-only-tooltip version 1.0.0
	ⓒ 2015 AHN JAE-HA http://github.com/eu81273
	MIT License
*/
[data-tooltip-text]:hover {
	position: relative;
}
[data-tooltip-text]:after {
	-webkit-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
	-moz-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
	transition: bottom .3s ease-in-out, opacity .3s ease-in-out;

	background-color: rgba(0, 0, 0, 0.8);

	-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
	-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
	box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);

  	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;

  	color: #FFFFFF;
	font-size: 12px;
	margin-bottom: 10px;
	padding: 7px 12px;
	position: absolute;
	width: auto;
	min-width: 240px;
	max-width: 250px;
	word-wrap: break-word;

	z-index: 9999;

	opacity: 0;
	left: -9999px;
	top: 90%;

	content: attr(data-tooltip-text);
}

[data-tooltip-text]:hover:after {
	top: 50%;
	left: 70px;
	opacity: 1;
}

#geo_ambient_reflection_coef_view {
	width: 3em;
	height: 1.6em;
	top: 50%;
	margin-top: -.8em;
	text-align: center;
	line-height: 1.6em;
}
#geo_diffuse_reflection_coef_view {
	width: 3em;
	height: 1.6em;
	top: 50%;
	margin-top: -.8em;
	text-align: center;
	line-height: 1.6em;
}
#geo_specular_reflection_coef_view {
	width: 3em;
	height: 1.6em;
	top: 50%;
	margin-top: -.8em;
	text-align: center;
	line-height: 1.6em;
}

#objectLabel {
	background-color: transparent;  /* needed because webgl-tutoraisl.css sets canvas bg color to white */
	position: absolute;
	left: 0px;
	top: 0px;
	z-index: 10;
	pointer-events:none;
}

.dataShortcut {
	float: right;
	width: 47px;
	height: 25px;
	margin-top: 5px;
	text-indent: -999em;
	border: none;
	background-image: url(/images/ko/homepage/ico.png);
	background-repeat: no-repeat;
	background-position: 10px -468px;
	background-color: transparent;
}

/* List Table
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.list-table {
	border: 1px solid #d9d9d9; }

.list-table th {
//	font-size: 1.3rem;
//	font-weight: normal;
	color: #000;
	border: 1px solid #d9d9d9;
//	border-top: 2px solid #3b095e;
	background-color: #f5f5f5;
//	height: 25px;
	padding-left: 10px;
	padding-right: 10px; }

.list-table td {
//	font-size: 1.3rem;
	border: 1px solid #d9d9d9;
//	height: 23px;
	padding-left: 10px;
	padding-right: 10px; }

.list-table tr:last-child td {
//	border-bottom-width: 2px; }

.list-header {
	margin-bottom: 10px; }

.list-table a {
	text-decoration: underline; }


text:
from types import FunctionType
from decotools import tracer, timer

def decorateAll(decorator):
    def DecoDecorate(aClass):
        for attr, attrval in aClass.__dict__.items():
            if type(attrval) is FunctionType:
                setattr(aClass, attr, decorator(attrval))        # Not __dict__
        return aClass
    return DecoDecorate

#@decorateAll(tracer)                          # Use a class decorator
#@decorateAll(tracer(timer(label='@@')))

#@decorateAll(timer(label='@@')(tracer))      # Times applying the tracer!
#@decorateAll(tracer(timer(label='@@')))      # Traces applying the timer!

#@decorateAll(tracer)                          # Traces onCall wrapper, times methods
#@decorateAll(timer(label='@@'))

#@decorateAll(timer(label='@@'))
#@decorateAll(tracer)                          # Times onCall wrapper, traces methods

@decorateAll(timer(label='@@'))
@decorateAll(tracer)                       # Times onCall wrapper, traces methods
class Person:                                 # Applies func decorator to methods
    def __init__(self, name, pay):            # Person = decorateAll(..)(Person)
        self.name = name                      # Person = DecoDecorate(Person)
        self.pay  = pay
    def giveRaise(self, percent):
        self.pay *= (1.0 + percent)
    def lastName(self):
        return self.name.split()[-1]

bob = Person('Bob Smith', 50000)
sue = Person('Sue Jones', 100000)
print(bob.name, sue.name)
sue.giveRaise(.10)
print('%.2f' % sue.pay)
print(bob.lastName(), sue.lastName())

# If using timer: total time per method
"""
print('-'*40)
print('%.5f' % Person.__init__.alltime)
print('%.5f' % Person.giveRaise.alltime)
print('%.5f' % Person.lastName.alltime)
"""


text:
<?php

/** @var $product \Magento\Catalog\Model\Product */
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Product');
$product->setTypeId(
    \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
)->setId(
    1
)->setAttributeSetId(
    4
)->setName(
    'Simple Related Product'
)->setSku(
    'simple'
)->setPrice(
    10
)->setVisibility(
    \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH
)->setStatus(
    \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED
)->setWebsiteIds(
    [1]
)->setStockData(
    ['qty' => 100, 'is_in_stock' => 1]
)->save();

$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Catalog\Model\Product');
$product->setTypeId(
    \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
)->setId(
    2
)->setAttributeSetId(
    4
)->setName(
    'Simple Product With Related Product'
)->setSku(
    'simple_with_cross'
)->setPrice(
    10
)->setVisibility(
    \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH
)->setStatus(
    \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED
)->setWebsiteIds(
    [1]
)->setStockData(
    ['qty' => 100, 'is_in_stock' => 1]
)->setRelatedLinkData(
    [1 => ['position' => 1]]
)->save();


text:
namespace relevanced {
namespace stemmer {

class StemmerIf {
 public:
  virtual size_t getStemPos(const char *base, size_t length) = 0;
};

} // stemmer
} // relevanced


text:
case node[:platform]
when "debian", "ubuntu"
  execute "enable_mcrypt" do
    user "root"
    command "php5enmod mcrypt && service apache2 restart"
    only_if { ::File.exist?("/etc/php5/mods-available/mcrypt.ini") }
  end
end


text:
var Bulldozer = new function() {
    /*
     * Public Variables
     */

	this.fn = Object.getPrototypeOf(this);
	this.utils;

	/*
	 * Public
	 */

	 this.init = function(sessionID, socketAccessToken) {
	 	// Show the loading indicator.
	 	Bulldozer.loadingIndicator.show();

	 	// Initialize the socket session.
	 	Bulldozer.socket.init(sessionID, socketAccessToken);

	 	// Run Kepler init.
	 	Kepler.init();
	 };
};


text:
import * as ts from "typescript";
import * as Lint from "../index";
export declare class Rule extends Lint.Rules.TypedRule {
    static metadata: Lint.IRuleMetadata;
    static FAILURE_STRING: string;
    applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program): Lint.RuleFailure[];
}
declare module "typescript" {
    function isExpression(node: ts.Node): node is ts.Expression;
}


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using NUnit.Framework;

namespace Azure.Analytics.Synapse.Tests
{
    /// <summary>
    /// Extension methods to make tests easier to author.
    /// </summary>
    public static partial class TestExtensions
    {
        /// <summary>
        /// Convert an IAsyncEnumerable into a List to make test verification
        /// easier.
        /// </summary>
        /// <typeparam name="T">The item type.</typeparam>
        /// <param name="items">The sequence of items.</param>
        /// <returns>A list of all the items in the sequence.</returns>
        public static async Task<IList<T>> ToListAsync<T>(this IAsyncEnumerable<T> items)
        {
            var all = new List<T>();
            await foreach (T item in items)
            {
                all.Add(item);
            }
            return all;
        }

        public static async Task WaitAndAssertSuccessfulCompletion (this Operation operation)
        {
            Response response = await operation.WaitForCompletionResponseAsync();
            response.AssertSuccess();
        }

        public static void AssertSuccess (this Response response)
        {
            switch (response.Status) {
                case 200:
                case 204:
                    break;
                default:
                    Assert.Fail($"Unexpected status ${response.Status} returned");
                    break;
            }
        }
    }
}


text:
<?php

namespace HealthCareAbroad\InstitutionBundle\Repository;

use HealthCareAbroad\InstitutionBundle\Entity\Doctor;
use HealthCareAbroad\InstitutionBundle\Entity\InstitutionDoctor;
use HealthCareAbroad\InstitutionBundle\Entity\Institution;

use Doctrine\ORM\Query\ResultSetMapping;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\HttpFoundation\Response;
/**
 * InstitutionDoctorRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class InstitutionDoctorRepository extends EntityRepository
{
    function getDoctorsList($institutionId) {

        $qb = $this->_em->createQueryBuilder()
        ->select('b.id, b.firstName, b.middleName, b.lastName')
        ->from('InstitutionBundle:InstitutionDoctor', 'a')
        ->leftJoin('a.doctor', 'b')
        ->add('where','a.institution = :institutionId')
        ->setParameter('institutionId', $institutionId);
        return $qb->getQuery()->getResult();
    }

    public function getDoctorSpecialization()
    {
        $data[] = array('1' => 'Opthalmologist',
                        '2' => 'Orthopedics',
                        '3' => 'Pediatric');

        $response = new Response(json_encode($data));
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }
}


text:
<?php

use Twig\Node\Expression\ArrayExpression;

class_exists('Twig\Node\Expression\ArrayExpression');

@trigger_error('Using the "Twig_Node_Expression_Array" class is deprecated since Twig version 2.7, use "Twig\Node\Expression\ArrayExpression" instead.', \E_USER_DEPRECATED);

if (false) {
    /** @deprecated since Twig 2.7, use "Twig\Node\Expression\ArrayExpression" instead */
    class Twig_Node_Expression_Array extends ArrayExpression
    {
    }
}


text:
angular.module('serviceApp',['ng']);

/**
 * Three way to define a service in AngularJS
 * 1. factory
 * 2. service
 * 3. provider
 */

angular.module("serviceApp")
 	.controller("MainCtrl", MainCtrl);

MainCtrl.$inject = ["$scope", "calculateFactory", "calculateService", "calculateProvider"];
// MainCtrl.$inject = ["$scope", "calculateFactory", "calculateService"];
// MainCtrl.$inject = ["$scope", "calculateFactory"];

function MainCtrl($scope, calculateFactory, calculateService, calculateProvider){
// function MainCtrl($scope, calculateFactory, calculateService){
// function MainCtrl($scope, calculateFactory){
	console.info(calculateProvider.random());
	console.info(calculateService.random());
	console.info(calculateFactory.random());

	this.alert = function(){
		alert(calculateFactory.random());
	}
}

angular.module("serviceApp")
	.config(['calculateProviderProvider', function(calculateProviderProvider){
		console.info("In serviceApp module config calculateProvider at %o", new Date());
		calculateProviderProvider.setBaseValue(10000);
	}]);


text:
using System.Collections.Generic;
using System.Linq;
using AsimovDeploy.WinAgent.Framework.Configuration;
using Newtonsoft.Json;

namespace AsimovDeploy.WinAgent.Framework.Models.UnitActions
{
    [JsonConverter(typeof(AsimovListJsonConverter))]
    [AsimovListType("VerifyUrls", typeof(VerifyUrlsUnitAction))]
    [AsimovListType("VerifyCommand", typeof(VerifyCommandUnitAction))]
    [AsimovListType("Command", typeof(CommandUnitAction))]
    [AsimovListType("PowerShell", typeof(PowerShellUnitAction))]
    public class UnitActionList : List<UnitAction>
    {
        public UnitAction this[string name]
        {
            get
            {
                return this.SingleOrDefault(x => x.Name == name);
            }
        }
    }
}