text:
package dns

// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"net/http"
)

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// RecordSetsClient is the client for managing DNS zones and record.
type RecordSetsClient struct {
	BaseClient
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// NewRecordSetsClient creates an instance of the RecordSetsClient client.
func NewRecordSetsClient(subscriptionID string) RecordSetsClient {
	return NewRecordSetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// NewRecordSetsClientWithBaseURI creates an instance of the RecordSetsClient client.
func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) RecordSetsClient {
	return RecordSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// CreateOrUpdate creates a RecordSet within a DNS zone.
//
// resourceGroupName is the name of the resource group. zoneName is the name of the zone without a terminating dot.
// recordType is the type of DNS record. relativeRecordSetName is the name of the RecordSet, relative to the name
// of the zone. parameters is parameters supplied to the CreateOrUpdate operation. ifMatch is the etag of
// RecordSet. ifNoneMatch is defines the If-None-Match condition. Set to '*' to force Create-If-Not-Exist. Other
// values will be ignored.
func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) {
	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, recordType, relativeRecordSetName, parameters, ifMatch, ifNoneMatch)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request")
		return
	}

	resp, err := client.CreateOrUpdateSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", resp, "Failure sending request")
		return
	}

	result, err = client.CreateOrUpdateResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", resp, "Failure responding to request")
	}

	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client RecordSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, parameters RecordSet, ifMatch string, ifNoneMatch string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"recordType":            autorest.Encode("path", recordType),
		"relativeRecordSetName": relativeRecordSetName,
		"resourceGroupName":     autorest.Encode("path", resourceGroupName),
		"subscriptionId":        autorest.Encode("path", client.SubscriptionID),
		"zoneName":              autorest.Encode("path", zoneName),
	}

	const APIVersion = "2015-05-04-preview"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPut(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
		autorest.WithJSON(parameters),
		autorest.WithQueryParameters(queryParameters))
	if len(ifMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	}
	if len(ifNoneMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
	}
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (result RecordSet, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// Delete removes a RecordSet from a DNS zone.
//
// resourceGroupName is the name of the resource group. zoneName is the name of the zone without a terminating dot.
// recordType is the type of DNS record. relativeRecordSetName is the name of the RecordSet, relative to the name
// of the zone. ifMatch is defines the If-Match condition. The delete operation will be performed only if the ETag
// of the zone on the server matches this value.
func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, ifMatch string) (result autorest.Response, err error) {
	req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, recordType, relativeRecordSetName, ifMatch)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request")
		return
	}

	resp, err := client.DeleteSender(req)
	if err != nil {
		result.Response = resp
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", resp, "Failure sending request")
		return
	}

	result, err = client.DeleteResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", resp, "Failure responding to request")
	}

	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// DeletePreparer prepares the Delete request.
func (client RecordSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string, ifMatch string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"recordType":            autorest.Encode("path", recordType),
		"relativeRecordSetName": relativeRecordSetName,
		"resourceGroupName":     autorest.Encode("path", resourceGroupName),
		"subscriptionId":        autorest.Encode("path", client.SubscriptionID),
		"zoneName":              autorest.Encode("path", zoneName),
	}

	const APIVersion = "2015-05-04-preview"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsDelete(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	if len(ifMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	}
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByClosing())
	result.Response = resp
	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// Get gets a RecordSet.
//
// resourceGroupName is the name of the resource group. zoneName is the name of the zone without a terminating dot.
// recordType is the type of DNS record. relativeRecordSetName is the name of the RecordSet, relative to the name
// of the zone.
func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string) (result RecordSet, err error) {
	req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, recordType, relativeRecordSetName)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request")
		return
	}

	resp, err := client.GetSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", resp, "Failure sending request")
		return
	}

	result, err = client.GetResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", resp, "Failure responding to request")
	}

	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// GetPreparer prepares the Get request.
func (client RecordSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, relativeRecordSetName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"recordType":            autorest.Encode("path", recordType),
		"relativeRecordSetName": relativeRecordSetName,
		"resourceGroupName":     autorest.Encode("path", resourceGroupName),
		"subscriptionId":        autorest.Encode("path", client.SubscriptionID),
		"zoneName":              autorest.Encode("path", zoneName),
	}

	const APIVersion = "2015-05-04-preview"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) GetSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordSet, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// List lists the RecordSets of a specified type in a DNS zone.
//
// resourceGroupName is the name of the resource group that contains the zone. zoneName is the name of the zone
// from which to enumerate RecordsSets. recordType is the type of record sets to enumerate. top is query
// parameters. If null is passed returns the default number of zones. filter is the filter to apply on the
// operation.
func (client RecordSetsClient) List(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top string, filter string) (result RecordSetListResultPage, err error) {
	result.fn = client.listNextResults
	req, err := client.ListPreparer(ctx, resourceGroupName, zoneName, recordType, top, filter)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "List", nil, "Failure preparing request")
		return
	}

	resp, err := client.ListSender(req)
	if err != nil {
		result.rslr.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "List", resp, "Failure sending request")
		return
	}

	result.rslr, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "List", resp, "Failure responding to request")
	}

	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListPreparer prepares the List request.
func (client RecordSetsClient) ListPreparer(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top string, filter string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"recordType":        autorest.Encode("path", recordType),
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
		"zoneName":          autorest.Encode("path", zoneName),
	}

	const APIVersion = "2015-05-04-preview"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(top) > 0 {
		queryParameters["$top"] = autorest.Encode("query", top)
	}
	if len(filter) > 0 {
		queryParameters["$filter"] = autorest.Encode("query", filter)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) ListSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client RecordSetsClient) ListResponder(resp *http.Response) (result RecordSetListResult, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// listNextResults retrieves the next set of results, if any.
func (client RecordSetsClient) listNextResults(lastResults RecordSetListResult) (result RecordSetListResult, err error) {
	req, err := lastResults.recordSetListResultPreparer()
	if err != nil {
		return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listNextResults", nil, "Failure preparing next results request")
	}
	if req == nil {
		return
	}
	resp, err := client.ListSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listNextResults", resp, "Failure sending next results request")
	}
	result, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listNextResults", resp, "Failure responding to next results request")
	}
	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client RecordSetsClient) ListComplete(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top string, filter string) (result RecordSetListResultIterator, err error) {
	result.page, err = client.List(ctx, resourceGroupName, zoneName, recordType, top, filter)
	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListAll lists all RecordSets in a DNS zone.
//
// resourceGroupName is the name of the resource group that contains the zone. zoneName is the name of the zone
// from which to enumerate RecordSets. top is query parameters. If null is passed returns the default number of
// zones. filter is the filter to apply on the operation.
func (client RecordSetsClient) ListAll(ctx context.Context, resourceGroupName string, zoneName string, top string, filter string) (result RecordSetListResultPage, err error) {
	result.fn = client.listAllNextResults
	req, err := client.ListAllPreparer(ctx, resourceGroupName, zoneName, top, filter)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAll", nil, "Failure preparing request")
		return
	}

	resp, err := client.ListAllSender(req)
	if err != nil {
		result.rslr.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAll", resp, "Failure sending request")
		return
	}

	result.rslr, err = client.ListAllResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "ListAll", resp, "Failure responding to request")
	}

	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListAllPreparer prepares the ListAll request.
func (client RecordSetsClient) ListAllPreparer(ctx context.Context, resourceGroupName string, zoneName string, top string, filter string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
		"zoneName":          autorest.Encode("path", zoneName),
	}

	const APIVersion = "2015-05-04-preview"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}
	if len(top) > 0 {
		queryParameters["$top"] = autorest.Encode("query", top)
	}
	if len(filter) > 0 {
		queryParameters["$filter"] = autorest.Encode("query", filter)
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/recordsets", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client RecordSetsClient) ListAllSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListAllResponder handles the response to the ListAll request. The method always
// closes the http.Response Body.
func (client RecordSetsClient) ListAllResponder(resp *http.Response) (result RecordSetListResult, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// listAllNextResults retrieves the next set of results, if any.
func (client RecordSetsClient) listAllNextResults(lastResults RecordSetListResult) (result RecordSetListResult, err error) {
	req, err := lastResults.recordSetListResultPreparer()
	if err != nil {
		return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listAllNextResults", nil, "Failure preparing next results request")
	}
	if req == nil {
		return
	}
	resp, err := client.ListAllSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listAllNextResults", resp, "Failure sending next results request")
	}
	result, err = client.ListAllResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listAllNextResults", resp, "Failure responding to next results request")
	}
	return
}

// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2015-05-04-preview/dns instead.
// ListAllComplete enumerates all values, automatically crossing page boundaries as required.
func (client RecordSetsClient) ListAllComplete(ctx context.Context, resourceGroupName string, zoneName string, top string, filter string) (result RecordSetListResultIterator, err error) {
	result.page, err = client.ListAll(ctx, resourceGroupName, zoneName, top, filter)
	return
}


text:
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

import { Contact } from '../contact';

@Component({
  selector: 'app-contact-list',
  templateUrl: './contact-list.component.html',
  styleUrls: ['./contact-list.component.css']
})
export class ContactListComponent implements OnInit {

  @Input()
  contacts: Contact[];

  @Output()
  select: EventEmitter<Contact> = new EventEmitter();

  constructor() {
    console.log("ContactListComponent : constructor",this.contacts);
  }

  ngOnInit() {
    console.log("ContactListComponent : ngOnInit",this.contacts);
  }

  selectContact(contact) {
    console.log("ContactListComponent : selectContact", contact);
    this.select.emit(contact);
  }

}

redpajama_set_name: RedPajamaGithub


text:
using SharpNet;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System
{
    public static class MyExtensions
    {
        public static void Shuffle<T>(this List<T> list)
        {
            int n = list.Count;
            while (n > 1)
            {
                n--;
                int k = RandomHelpers.Next(n + 1);
                T value = list[k];
                list[k] = list[n];
                list[n] = value;
            }
        }
    }
}


text:
package shiver.me.timbers.waiting.execution;

import shiver.me.timbers.waiting.Wait;

import java.util.concurrent.Callable;

public class CanAddExtraWaitingIncludeMethod implements WaitingInclude {

    @Wait(includes = IllegalStateException.class)
    @Override
    public <T> T includeMethod(Callable<T> callable) throws Exception {
        return callable.call();
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
        <meta http-equiv="content-language" content="pt-br"/>
        <meta name="robots" content="index, follow"/>
        <meta name="author" content="Alberto Cerqueira"/>
        <meta name="reply-to" content="alberto.cerqueira1990@gmail.com"/>
        <meta name="format-detection" content="telephone=no" />
		<meta name="keywords" content="programador, java, ti, desenvolvedor, desenvolvimento, programação, api, framework, projeto"/>
		<meta name="description" content="Spring Corp - Framework"/>

		<title>Email Marketing</title>
	</head>
	<body>
		Teste - Email Marketing - Precisa testar layout...
	</body>
</html>


text:
<?php echo $objModulo->descripcion ?>

    <div id="slide-relacionados-modulo-<?php echo $objModulo->idModulo ?>" class="owl-carousel owl-theme">
        <?php foreach ($objModulo->getListaProductos($this->objSectorCiudad) as $objProducto): ?>

                <?php
                $this->renderPartial('/catalogo/_productoSlide', array(
                    'objProducto' => $objProducto,
                    'objPrecio' => new PrecioProducto($objProducto, $this->objSectorCiudad, Yii::app()->shoppingCart->getCodigoPerfil()),
                ));
                ?>

        <?php endforeach; ?>


text:
package calendar.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

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

/**
 * Class AuthorizationChecker
 *
 * A facade object for other packages to easily see if the current user can manage parts of another
 * user which is found by their id.
 *
 * @author Axel Nilsson (axnion)
 */
@Component
public class AuthorizationChecker {
    @Autowired
    private CurrentUser currentUser;
    @Autowired
    private UserDAO dao;

    /**
     * A facade method which helps other packages check if the current logged in user can manage
     * another users account.
     *
     * @param id    The id of the target user
     * @return      True if the current user can manage the other user. False if not
     */
    public boolean currentUserCanManage(String id) {
        String email = currentUser.getEmailAddress();
        User user = dao.getUserByEmail(email);
        User target = dao.getUserById(id);

        return user != null && target != null && user.canManage(target);
    }

    public List<String> getAllUserIds() {
        ArrayList<User> users;
        List<String> ids = new ArrayList<>();

        users = dao.getAllUsers();

        for(User user : users) {
            ids.add(user.getId());
        }

        return ids;
    }
}


text:
package org.apache.geode.management.internal.cli.shell;

import java.io.File;
import java.lang.reflect.Method;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;

import org.springframework.shell.core.ExecutionStrategy;
import org.springframework.shell.core.Shell;
import org.springframework.shell.event.ParseResult;
import org.springframework.util.Assert;

import org.apache.geode.internal.GemFireVersion;
import org.apache.geode.internal.classloader.ClassPathLoader;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.Result.Status;
import org.apache.geode.management.internal.cli.CliAroundInterceptor;
import org.apache.geode.management.internal.cli.CommandRequest;
import org.apache.geode.management.internal.cli.GfshParseResult;
import org.apache.geode.management.internal.cli.LogWrapper;
import org.apache.geode.management.internal.cli.remote.CommandExecutor;
import org.apache.geode.management.internal.cli.result.CommandResult;
import org.apache.geode.management.internal.cli.result.model.ResultModel;
import org.apache.geode.security.NotAuthorizedException;

/**
 * Defines the {@link ExecutionStrategy} for commands that are executed in GemFire Shell (gfsh).
 *
 * @since GemFire 7.0
 */
public class GfshExecutionStrategy implements ExecutionStrategy {
  private final Class<?> mutex = GfshExecutionStrategy.class;
  private Gfsh shell;
  private final LogWrapper logWrapper;

  GfshExecutionStrategy(Gfsh shell) {
    this.shell = shell;
    logWrapper = shell.getGfshFileLogger();
  }

  /**
   * Executes the method indicated by the {@link ParseResult} which would always be
   * {@link GfshParseResult} for GemFire defined commands. If the command Method is decorated with
   * {@link CliMetaData#shellOnly()} set to false, {@link OperationInvoker} is used to
   * send the command for processing on a remote GemFire node.
   *
   * @param parseResult that should be executed (never presented as null)
   * @return an object which will be rendered by the {@link Shell} implementation (may return null)
   *         this returns a CommandResult for all the online commands. For offline-commands,
   *         this can return either a CommandResult or ExitShellRequest
   * @throws RuntimeException which is handled by the {@link Shell} implementation
   */
  @Override
  public Object execute(ParseResult parseResult) {
    Method method = parseResult.getMethod();

    // check if it's a shell only command
    if (isShellOnly(method)) {
      Assert.notNull(parseResult, "Parse result required");
      synchronized (mutex) {
        Assert.isTrue(isReadyForCommands(), "Not yet ready for commands");

        Object exeuctionResult = new CommandExecutor(null).execute((GfshParseResult) parseResult);
        if (exeuctionResult instanceof ResultModel) {
          return new CommandResult((ResultModel) exeuctionResult);
        }
        return exeuctionResult;

      }
    }

    // check if it's a GfshParseResult
    if (!(parseResult instanceof GfshParseResult)) {
      throw new IllegalStateException("Configuration error!");
    }

    ResultModel resultModel = executeOnRemote((GfshParseResult) parseResult);

    if (resultModel == null) {
      return null;
    }
    return new CommandResult(resultModel);
  }

  /**
   * Whether the command is available only at the shell or on GemFire member too.
   *
   * @param method the method to check the associated annotation
   * @return true if CliMetaData is added to the method & CliMetaData.shellOnly is set to true,
   *         false otherwise
   */
  private boolean isShellOnly(Method method) {
    CliMetaData cliMetadata = method.getAnnotation(CliMetaData.class);
    return cliMetadata != null && cliMetadata.shellOnly();
  }

  private String getInterceptor(Method method) {
    CliMetaData cliMetadata = method.getAnnotation(CliMetaData.class);
    return cliMetadata != null ? cliMetadata.interceptor() : CliMetaData.ANNOTATION_NULL_VALUE;
  }

  /**
   * Indicates commands are able to be presented. This generally means all important system startup
   * activities have completed. Copied from {@link ExecutionStrategy#isReadyForCommands()}.
   *
   * @return whether commands can be presented for processing at this time
   */
  @Override
  public boolean isReadyForCommands() {
    return true;
  }

  /**
   * Indicates the execution runtime should be terminated. This allows it to cleanup before
   * returning control flow to the caller. Necessary for clean shutdowns. Copied from
   * {@link ExecutionStrategy#terminate()}.
   */
  @Override
  public void terminate() {
    shell = null;
  }

  /**
   * Sends the user input (command string) via {@link OperationInvoker} to a remote GemFire node for
   * processing & execution.
   *
   * @return result of execution/processing of the command
   * @throws IllegalStateException if gfsh doesn't have an active connection.
   */
  private ResultModel executeOnRemote(GfshParseResult parseResult) {
    Path tempFile = null;

    if (!shell.isConnectedAndReady()) {
      shell.logWarning(
          "Can't execute a remote command without connection. Use 'connect' first to connect.",
          null);
      logWrapper.info("Can't execute a remote command \"" + parseResult.getUserInput()
          + "\" without connection. Use 'connect' first to connect to GemFire.");
      return null;
    }

    List<File> fileData = null;
    CliAroundInterceptor interceptor = null;

    String interceptorClass = getInterceptor(parseResult.getMethod());

    // 1. Pre Remote Execution
    if (!CliMetaData.ANNOTATION_NULL_VALUE.equals(interceptorClass)) {
      try {
        interceptor = (CliAroundInterceptor) ClassPathLoader.getLatest().forName(interceptorClass)
            .newInstance();
      } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) {
        shell.logWarning("Configuration error", e);
      }

      if (interceptor == null) {
        return ResultModel.createError("Interceptor Configuration Error");
      }

      ResultModel preExecResult = interceptor.preExecution(parseResult);
      if (preExecResult.getStatus() != Status.OK) {
        return preExecResult;
      }
      fileData = preExecResult.getFileList();
    }

    // 2. Remote Execution
    Object response = null;
    final Map<String, String> env = shell.getEnv();
    try {
      response = shell.getOperationInvoker()
          .processCommand(new CommandRequest(parseResult, env, fileData));

      if (response == null) {
        return ResultModel.createError("Response was null for: " + parseResult.getUserInput());
      }
    } catch (NotAuthorizedException e) {
      return ResultModel.createError("Unauthorized. Reason : " + e.getMessage());
    } catch (Exception e) {
      shell.logSevere(e.getMessage(), e);
      return ResultModel.createError(
          "Error occurred while executing \"" + parseResult.getUserInput() + "\" on manager.");
    } finally {
      env.clear();
    }

    // the response could be a string which is a json representation of the
    // ResultModel object
    // it can also be a Path to a temp file downloaded from the rest http request
    ResultModel commandResult = null;
    if (response instanceof String) {
      try {
        commandResult = ResultModel.fromJson((String) response);
      } catch (Exception e) {
        logWrapper.severe("Unable to parse the remote response.", e);
        String clientVersion = GemFireVersion.getGemFireVersion();
        String remoteVersion = null;
        try {
          remoteVersion = shell.getOperationInvoker().getRemoteVersion();
        } catch (Exception exception) {
          // unable to get the remote version (pre-1.5.0 manager does not have this capability)
          // ignore
        }
        String message = "Unable to parse the remote response. This might due to gfsh client "
            + "version(" + clientVersion + ") mismatch with the remote cluster version"
            + ((remoteVersion == null) ? "." : "(" + remoteVersion + ").");
        return ResultModel.createError(message);
      }
    } else if (response instanceof Path) {
      tempFile = (Path) response;
    }

    // 3. Post Remote Execution
    if (interceptor != null) {
      try {
        commandResult =
            interceptor.postExecution(parseResult, commandResult, tempFile);

      } catch (Exception e) {
        logWrapper.severe("error running post interceptor", e);
        commandResult = ResultModel.createError(e.getMessage());
      }
    }

    if (commandResult == null) {
      commandResult =
          ResultModel.createError("Unable to build ResultModel using the remote response.");
    }

    return commandResult;
  }
}


text:
package source;

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

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.data.WifiDataItem;
import com.wifi_zombie.R;

public class ChListAdapter extends ArrayAdapter<int[]> {
	private final int maxProgress = 100;
	private Context mContext;
    private int mResource;
    private ArrayList<int[]> mList;
    private LayoutInflater mInflater;

	public ChListAdapter(Context context, int textViewResourceId, ArrayList<int[]> objects) {
		super(context, textViewResourceId, objects);
		// TODO Auto-generated constructor stub
		this.mContext = context;
		this.mResource = textViewResourceId;
		this.mList = objects;
		this.mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		// channel °è
	}
	@Override
    public View getView(int position, View convertView, ViewGroup parent)
    {
		int[] item = mList.get(position);

        if(convertView == null)
        {
            convertView = mInflater.inflate(mResource, null);
        }

        if(item != null)
        {
            TextView channel = (TextView) convertView.findViewById(R.id.chlist_item_channel);
            TextView percent = (TextView) convertView.findViewById(R.id.chlist_item_percent);
            TextView aps = (TextView) convertView.findViewById(R.id.chlist_item_aps);
            TextView overlapping = (TextView) convertView.findViewById(R.id.chlist_item_overlapping);
            ProgressBar rating = (ProgressBar) convertView.findViewById(R.id.chlist_item_progressbar);

            rating.setMax(100);

            channel.setText(item[0]+"");	// ä³Î
            percent.setText(item[1]+"%");
            aps.setText(item[2]+" Aps");
            overlapping.setText(item[3]+" Overlapping Aps");
            rating.setProgress(item[1]);

            if(item[1] > 70)
            	rating.setProgressDrawable(mContext.getResources().getDrawable(R.drawable.progress_horizontal_green));
            else if(item[1] > 30)
            	rating.setProgressDrawable(mContext.getResources().getDrawable(R.drawable.progress_horizontal_yellow));
            else
                rating.setProgressDrawable(mContext.getResources().getDrawable(R.drawable.progress_horizontal_red));
        }

		return convertView;
    }

}


text:
angular.module('orderCloud')
    .factory('ocAuthNet', AuthorizeNet)
;

function AuthorizeNet( $q, $resource, OrderCloudSDK, apiurl, ocCreditCardUtility) {
    return {
        'CreateCreditCard': _createCreateCard,
        'UpdateCreditCard': _updateCreditCard,
        'DeleteCreditCard' : _deleteCreditCard,
        'MakeAuthnetCall' : _makeApiCall

    };

    function _createCreateCard(creditCard, buyerID) {
        var ExpirationDate = ocCreditCardUtility.ExpirationDateFormat(creditCard.ExpirationMonth, creditCard.ExpirationYear);
        return _makeApiCall('POST', {
            'buyerID' : buyerID ? buyerID : OrderCloudSDK.BuyerID.Get(),
            'TransactionType' : 'createCreditCard',
            'CardDetails' : {
                'CardholderName' : creditCard.CardholderName,
                'CardType' : creditCard.CardType,
                'CardNumber' : creditCard.CardNumber,
                'ExpirationDate' : ExpirationDate,
                'CardCode' : creditCard.CardCode
            }
        });
    }

    function _updateCreditCard(creditCard, buyerID) {
        var ExpirationDate = ocCreditCardUtility.ExpirationDateFormat(creditCard.ExpirationMonth, creditCard.ExpirationYear);
        return _makeApiCall('POST', {
            'buyerID' : buyerID ? buyerID : OrderCloudSDK.BuyerID.Get(),
            'TransactionType' : 'updateCreditCard',
            'CardDetails' : {
                'CreditCardID' : creditCard.ID,
                'CardholderName' : creditCard.CardholderName,
                'CardType' : creditCard.CardType,
                'CardNumber' : 'XXXX'+ creditCard.PartialAccountNumber,
                'ExpirationDate' : ExpirationDate
            }
        });

    }
    function _deleteCreditCard(creditCard, buyerID) {
        return _makeApiCall('POST', {
            'buyerID': buyerID ? buyerID : OrderCloudSDK.BuyerID.Get(),
            'TransactionType': 'deleteCreditCard',
            'CardDetails': {
                'CreditCardID': creditCard.ID
            }
        });
    }

    function _makeApiCall(method, requestBody) {
        var apiUrl = apiurl +'/v1/integrationproxy/authorizenettest';
        var d = $q.defer();
        $resource(apiUrl, null, {
            callApi: {
                method: method,
                headers: {
                    'Authorization': 'Bearer ' + OrderCloudSDK.Auth.ReadToken()
                }
            }
        }).callApi(requestBody).$promise
            .then(function(data) {
                d.resolve(data);
            })
            .catch(function(ex) {
                d.reject(ex);
            });
        return d.promise;
    }
}


text:
#include <aws/core/utils/xml/XmlSerializer.h>

#include <aws/core/utils/StringUtils.h>
#include <aws/core/external/tinyxml2/tinyxml2.h>

#include <utility>
#include <algorithm>
#include <iostream>

using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

Aws::String Aws::Utils::Xml::DecodeEscapedXmlText(const Aws::String& textToDecode)
{
    Aws::String decodedString = textToDecode;
    StringUtils::Replace(decodedString, """, "\"");
    StringUtils::Replace(decodedString, "'", "'");
    StringUtils::Replace(decodedString, "<", "<");
    StringUtils::Replace(decodedString, ">", ">");
    StringUtils::Replace(decodedString, "&;", "&");

    return std::move(decodedString);
}

XmlNode::XmlNode(const XmlNode& other) : m_node(other.m_node), m_doc(other.m_doc)
{
}

XmlNode& XmlNode::operator=(const XmlNode& other)
{
    if(this == &other)
    {
        return *this;
    }

    m_node = other.m_node;
    m_doc = other.m_doc;

    return *this;
}

const Aws::String XmlNode::GetName() const
{
    return m_node->Value();
}

void XmlNode::SetName(const Aws::String& name)
{
    m_node->SetValue(name.c_str(), false);
}

const Aws::String XmlNode::GetAttributeValue(const Aws::String& name) const
{
    return m_node->ToElement()->Attribute(name.c_str(), nullptr);
}

void XmlNode::SetAttributeValue(const Aws::String& name, const Aws::String& value)
{
    m_node->ToElement()->SetAttribute(name.c_str(), value.c_str());
}

bool XmlNode::HasNextNode() const
{
    return m_node->NextSibling() != nullptr;
}

XmlNode XmlNode::NextNode() const
{
    return XmlNode(m_node->NextSiblingElement(), *m_doc);
}

XmlNode XmlNode::NextNode(const char* name) const
{
    return XmlNode(m_node->NextSiblingElement(name), *m_doc);
}

XmlNode XmlNode::NextNode(const Aws::String& name) const
{
    return NextNode(name.c_str());
}

XmlNode XmlNode::FirstChild() const
{
    return XmlNode(m_node->FirstChildElement(), *m_doc);
}

XmlNode XmlNode::FirstChild(const char* name) const
{
    return XmlNode(m_node->FirstChildElement(name), *m_doc);
}

XmlNode XmlNode::FirstChild(const Aws::String& name) const
{
    return FirstChild(name.c_str());
}

bool XmlNode::HasChildren() const
{
    return !m_node->NoChildren();
}

XmlNode XmlNode::Parent() const
{
    return XmlNode(m_node->Parent()->ToElement(), *m_doc);
}

Aws::String XmlNode::GetText() const
{
    if (m_node != nullptr)
    {
        Aws::External::tinyxml2::XMLPrinter printer;
        Aws::External::tinyxml2::XMLNode* node = m_node->FirstChild();
        while (node != nullptr)
        {
            node->Accept(&printer);
            node = node->NextSibling();
        }

        return printer.CStr();
    }

    return "";
}

void XmlNode::SetText(const Aws::String& textValue)
{
    if (m_node != nullptr)
    {
        Aws::External::tinyxml2::XMLText* text = m_doc->m_doc->NewText(textValue.c_str());
        m_node->InsertEndChild(text);
    }
}

XmlNode XmlNode::CreateChildElement(const Aws::String& name)
{
    Aws::External::tinyxml2::XMLElement* element = m_doc->m_doc->NewElement(name.c_str());
    return XmlNode(m_node->InsertEndChild(element), *m_doc);
}

XmlNode XmlNode::CreateSiblingElement(const Aws::String& name)
{
    Aws::External::tinyxml2::XMLElement* element = m_doc->m_doc->NewElement(name.c_str());
    return XmlNode(m_node->Parent()->InsertEndChild(element), *m_doc);
}

bool XmlNode::IsNull()
{
    return m_node == nullptr;
}

static const char* allocationTag = "XmlDocument";

XmlDocument::XmlDocument()
{
    m_doc = Aws::New<Aws::External::tinyxml2::XMLDocument>(allocationTag, true, Aws::External::tinyxml2::Whitespace::PRESERVE_WHITESPACE);
}

XmlDocument::XmlDocument(XmlDocument&& doc) : m_doc{ std::move(doc.m_doc) } // take the innards
{
    doc.m_doc = nullptr; // leave nothing behind
}

XmlDocument::~XmlDocument()
{
    Aws::Delete(m_doc);
}

XmlNode XmlDocument::GetRootElement() const
{
    return XmlNode(m_doc->FirstChildElement(), *this);
}

bool XmlDocument::WasParseSuccessful() const
{
    return !m_doc->Error();
}

Aws::String XmlDocument::GetErrorMessage() const
{
    return !WasParseSuccessful() ? m_doc->ErrorName() : "";
}

Aws::String XmlDocument::ConvertToString() const
{
    Aws::External::tinyxml2::XMLPrinter printer;
    printer.PushHeader(false, true);
    m_doc->Accept(&printer);

    return printer.CStr();
}

XmlDocument XmlDocument::CreateFromXmlStream(Aws::IOStream& xmlStream)
{
    Aws::String xmlString((Aws::IStreamBufIterator(xmlStream)), Aws::IStreamBufIterator());
    return CreateFromXmlString(xmlString);
}

XmlDocument XmlDocument::CreateFromXmlString(const Aws::String& xmlText)
{
    XmlDocument xmlDocument;
    xmlDocument.m_doc->Parse(xmlText.c_str(), xmlText.size());
    return std::move(xmlDocument);
}

XmlDocument XmlDocument::CreateWithRootNode(const Aws::String& rootNodeName)
{
    XmlDocument xmlDocument;
    Aws::External::tinyxml2::XMLElement* rootNode = xmlDocument.m_doc->NewElement(rootNodeName.c_str());
    xmlDocument.m_doc->LinkEndChild(rootNode);

    return std::move(xmlDocument);
}


text:
@CHARSET "UTF-8";

.ux-mu-status-value {
	float: right;
	min-width: 16px;
	height: 16px;
	background-repeat: no-repeat;
	margin: 0 3px 0 2px;
	cursor: pointer;
	overflow: hidden;
}

.icon-help {
	background-image: url(../img/help.png) !important;
}

/*
 * Action icons
 */
.ux-mu-icon-action-ok {
	background-image: url(../img/tick.png) !important;
}

.ux-mu-icon-action-upload {
	background-image: url(../img/arrow_up.png) !important;
}

.ux-mu-icon-action-abort {
	background-image: url(../img/cancel.png) !important;
}

.ux-mu-icon-action-remove {
	background-image: url(../img/delete.png) !important;
}

.ux-mu-icon-action-browse {
	background-image: url(../img/folder.png) !important;
}

/*
 * Upload status icons
 */
.ux-mu-icon-upload-ready { /*
    background-image: url(../img/ready.png) !important;
    */

}

.ux-mu-icon-upload-uploading {
	background-image: url(../img/loading.gif) !important;
}

.ux-mu-icon-upload-uploaded {
	background-image: url(../img/accept.png) !important;
}

.ux-mu-icon-upload-uploaderror {
	background-image: url(../img/exclamation.png) !important;
}


text:
/**
 * A* pathfinding algorithm implementation by Leo Martel (http://lpm.io)
 * Use it if you want it; MIT License.
 *
 * {Location} can be any object that works with ===. Just make sure your grid, start, and target are all {Location}s.
 *
 * @param {Array.Location} all       array of all possible grid locations
 * @param {Location} start           the starting location
 * @param {Location} target          the ending location
 * @param {Object} options :
 *      neighbors: function(Location) => {Array.Location}   produces all viable neighbors.
 *          Default: assumes Location is a [x,y] tuple on a rectangular grid.
 *      heuristic: function(Location) => {Number}           a function that "guesses" the distance and never overestimates
 *          (for example, Manhattan distance on a rectangular grid)
 *          Default: always guesses 0. This reduces A* to Dijkstra's algorithm.
 *      cost: function(Location) => {Number}                a function that calculates the movement cost through the given location.
 *          Default: all Locations cost 1 to move through.
 */
A_star = function a_star(all, start, target, options){
    var neighborsFn = options["neighbors"] || function(point){
        return [
            [ point[0] - 1, point[1] ],
            [ point[0] + 1, point[1] ],
            [ point[0], point[1] - 1 ],
            [ point[0], point[1] + 1 ]
        ];
    };
    var heuristicFn = options["heuristic"] || function(point){ return 0; };
    var costFn = options["cost"] || function(point){ return 1; };

    var todo = [];
    var visited = [];
    var done = [];
    for(var i = 0; i < all.length; i++){
        todo.push(new Node(all[i]));
    }
    var startNode = visit(start, 0); //this.getlocation

    var pq = new PriorityQueue();
    pq.push(startNode, priority(startNode));

    var u;
    while(Object.keys(visited).length > 0){
        u = pq.pop();
        var d = finalize(u);
        if(u.coords === target) break;
        var neighbors = neighborsFn(u.coords); // u.hex.getNeighbors();
        for(var i = 0; i < neighbors.length; i++){
            var loc = neighbors[i];
            //var loc = hex.getLocation();
            var L = costFn(loc);

            var v = todo[find(todo, loc)];
            if(v){
                visit(v.coords, d + L);
                v.parent = u;
                pq.push(v, priority(v));
            }
            v = visited[find(visited, loc)];
            if(v && v.candidate > d + L){
                v.candidate = d + L;
                v.parent = u;
                pq.move(v, priority(v));
            }
        }
    }

    // Path does not include start node
    var path = [];
    while(u.parent !== null){
        path.push(u.coords);
        u = u.parent;
    }

    // reverse to get start => finish
    return path.reverse();

    function find(array, coords){
        for(var i = 0; i < array.length; i++){
            if(array[i].coords === coords) return i;
        }
        return false;
    }

    //Generates priority value, including A* heuristic function
    function priority(cur){
        return cur.candidate + heuristicFn(cur.coords);
    }

    function Node(coords){
        this.coords = coords;
        this.parent = null;
        this.candidate = null;
    }

    function visit(coords, candidate){
        var i = find(todo, coords);
        var node = todo.splice(i, 1)[0];

        node.candidate = candidate;
        visited.push(node);
        return node;
    }

    function finalize(node){
        node.distance = node.candidate;
        done.push(node);
        visited.splice(find(visited, node.coords), 1);
        return node.distance;
    }

};


text:
using NanoByte.Common.Native;

namespace NanoByte.Common.Controls;

/// <summary>
/// A simple dialog displaying selectable multi-line text.
/// </summary>
public sealed partial class OutputBox : Form
{
    private OutputBox()
    {
        InitializeComponent();
        Font = DefaultFonts.Modern;
        HandleCreated += delegate { WindowsTaskbar.PreventPinning(Handle); };
    }

    /// <summary>
    /// Displays an output box with some text.
    /// </summary>
    /// <param name="owner">The parent window for the dialogs; can be <c>null</c>.</param>
    /// <param name="title">The text to display above the <paramref name="message"/>.</param>
    /// <param name="message">The selectable multi-line text to display to the user.</param>
    public static void Show(IWin32Window? owner, [Localizable(true)] string title, [Localizable(true)] string message)
    {
        #region Sanity checks
        if (title == null) throw new ArgumentNullException(nameof(title));
        if (message == null) throw new ArgumentNullException(nameof(message));
        #endregion

        using var outputBox = new OutputBox
        {
            Text = Application.ProductName,
            labelTitle = {Text = title},
            textMessage = {Text = message.Replace("\n", Environment.NewLine)},
            ShowInTaskbar = owner == null
        };
        // ReSharper disable once AccessToDisposedClosure
        outputBox.Shown += delegate { outputBox.SetForegroundWindow(); };
        outputBox.ShowDialog(owner);
    }
}


text:
import React, { Component, PropTypes } from 'react';

export default class Comment extends Component {
  render() {
    console.log("Comment.render");
    return (
      <li>
        {this.props.text}
      </li>
    );
  }
}

Comment.propTypes = {
  text: PropTypes.string.isRequired,
};


text:
package com.messente.enums;

/**
 * Enumeration of HTTP protocols used by this library.
 *
 * @author Lennar Kallas
 */
public enum HttpProtocol {

    HTTP("http"),
    HTTPS("https");

    private final String httpProtocol;

    private HttpProtocol(final String httpProtocol) {
        this.httpProtocol = httpProtocol;
    }

    @Override
    public String toString() {
        return httpProtocol;
    }
}


text:
'use babel';

import { isArray, isFunction } from 'lodash';
import childProcess from 'child_process';

import { parseBlame } from './blameFormatter';

/**
 * @module GitCommander
 *
 * Utility for executing git commands on a repo in a given working directory.
 */
export default class GitCommander {

  constructor(path) {
    this.workingDirectory = path;
  }

  /**
   * Spawns a process to execute a git command in the GitCommander instances
   * working directory.
   *
   * @param {array|string} args - arguments to call `git` with on the command line
   * @param {function} callback - node callback for error and command output
   */
  exec(args, callback) {
    if (!isArray(args) || !isFunction(callback)) {
      return;
    }

    const gitBinary = atom.config.get('git-blame.gitBinaryPath') || 'git';

    const child = childProcess.spawn(gitBinary, args, {cwd: this.workingDirectory});
    let stdout = '';
    let stderr = '';
    let processError;

    child.stdout.on('data', function (data) {
      stdout += data;
    });

    child.stderr.on('data', function (data) {
      stderr += data;
    });

    child.on('error', function (error) {
      processError = error;
    });

    child.on('close', function (errorCode) {
      if (processError) {
        return callback(processError);
      }

      if (errorCode) {
        const error = new Error(stderr);
        error.code = errorCode;
        return callback(error);
      }

      return callback(null, stdout.trimRight());
    });
  }

  /**
   * Executes git blame on the input file in the instances working directory
   *
   * @param {string} fileName - name of file to blame, relative to the repos
   *   working directory
   * @param {function} callback - callback funtion to call with results or error
   */
  blame(fileName, callback) {
    const args = ['blame', '--line-porcelain'];

    // ignore white space based on config
    if (atom.config.get('git-blame.ignoreWhiteSpaceDiffs')) {
      args.push('-w');
    }

    args.push(fileName);

    // Execute blame command and parse
    this.exec(args, function (err, blameStdOut) {
      if (err) {
        return callback(err, blameStdOut);
      }

      return callback(null, parseBlame(blameStdOut));
    });
  }

  /**
   * Executes git config --get
   *
   * @param {string} name - the name of the variable to look up eg: "group.varName"
   * @param {function} callback - callback funtion to call with results or error
   */
  config(name, callback) {
    const args = ['config', '--get', name];

    // Execute config command
    this.exec(args, function (err, configStdOut) {
      if (err) {
        // Error code 1 means, this variable is not present in the config
        if (err.code === 1) {
          return callback(null, '');
        }
        return callback(err, configStdOut);
      }

      return callback(null, configStdOut);
    });
  }
}


text:
package org.javamoney.examples.cdi.payment.qualifiers;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.inject.Qualifier;
import java.lang.annotation.RetentionPolicy;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;

@Qualifier
@Target({TYPE, METHOD, FIELD, PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface Amount {
}


text:
import json

from openstack_horizon.api import heat

from openstack_horizon.dashboards.project.stacks import mappings
from openstack_horizon.dashboards.project.stacks import sro

class Stack(object):
    pass

def d3_data(request, stack_id=''):
    try:
        stack = heat.stack_get(request, stack_id)
    except Exception:
        stack = Stack()
        stack.id = stack_id
        stack.stack_name = request.session.get('stack_name', '')
        stack.stack_status = 'DELETE_COMPLETE'
        stack.stack_status_reason = 'DELETE_COMPLETE'

    try:
        resources = heat.resources_list(request, stack.stack_name)
    except Exception:
        resources = []

    d3_data = {"nodes": [], "stack": {}}
    if stack:
        stack_image = mappings.get_resource_image(stack.stack_status, 'stack')
        stack_node = {
            'stack_id': stack.id,
            'name': stack.stack_name,
            'status': stack.stack_status,
            'image': stack_image,
            'image_size': 60,
            'image_x': -30,
            'image_y': -30,
            'text_x': 40,
            'text_y': ".35em",
            'in_progress': (stack.status == 'IN_PROGRESS'),
            'info_box': sro.stack_info(stack, stack_image)
        }
        d3_data['stack'] = stack_node

    if resources:
        for resource in resources:
            resource_image = mappings.get_resource_image(
                resource.resource_status,
                resource.resource_type)
            resource_status = mappings.get_resource_status(
                resource.resource_status)
            if resource_status in ('IN_PROGRESS', 'INIT'):
                in_progress = True
            else:
                in_progress = False
            resource_node = {
                'name': resource.resource_name,
                'status': resource.resource_status,
                'image': resource_image,
                'required_by': resource.required_by,
                'image_size': 50,
                'image_x': -25,
                'image_y': -25,
                'text_x': 35,
                'text_y': ".35em",
                'in_progress': in_progress,
                'info_box': sro.resource_info(resource)
            }
            d3_data['nodes'].append(resource_node)
    return json.dumps(d3_data)


text:
<?php

namespace DoctrineORMModule\Proxy\__CG__\ORM\Entity;

/**
 * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
 */
class Usuario extends \ORM\Entity\Usuario implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
     *      three parameters, being respectively the proxy object to be initialized, the method that triggered the
     *      initialization process and an array of ordered parameters that were passed to that method.
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setInitializer
     */
    public $__initializer__;

    /**
     * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setCloner
     */
    public $__cloner__;

    /**
     * @var boolean flag indicating if this object was already initialized
     *
     * @see \Doctrine\Common\Persistence\Proxy::__isInitialized
     */
    public $__isInitialized__ = false;

    /**
     * @var array properties to be lazy loaded, with keys being the property
     *            names and values being their default values
     *
     * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties
     */
    public static $lazyPropertiesDefaults = array();

    /**
     * @param \Closure $initializer
     * @param \Closure $cloner
     */
    public function __construct($initializer = null, $cloner = null)
    {

        $this->__initializer__ = $initializer;
        $this->__cloner__      = $cloner;
    }

    /**
     *
     * @return array
     */
    public function __sleep()
    {
        if ($this->__isInitialized__) {
            return array('__isInitialized__', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioNickname', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioNombres', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioApellidos', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioTipoDoc', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioNumDoc', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioTelefono', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioEmail', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioFechaRegistro', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'meGustaCompartirCompartir', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuariocatCatalogo', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioCompraCompra');
        }

        return array('__isInitialized__', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioNickname', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioNombres', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioApellidos', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioTipoDoc', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioNumDoc', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioTelefono', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioEmail', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioFechaRegistro', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'meGustaCompartirCompartir', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuariocatCatalogo', '' . "\0" . 'ORM\\Entity\\Usuario' . "\0" . 'usuarioCompraCompra');
    }

    /**
     *
     */
    public function __wakeup()
    {
        if ( ! $this->__isInitialized__) {
            $this->__initializer__ = function (Usuario $proxy) {
                $proxy->__setInitializer(null);
                $proxy->__setCloner(null);

                $existingProperties = get_object_vars($proxy);

                foreach ($proxy->__getLazyProperties() as $property => $defaultValue) {
                    if ( ! array_key_exists($property, $existingProperties)) {
                        $proxy->$property = $defaultValue;
                    }
                }
            };

        }
    }

    /**
     *
     */
    public function __clone()
    {
        $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', array());
    }

    /**
     * Forces initialization of the proxy
     */
    public function __load()
    {
        $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', array());
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __isInitialized()
    {
        return $this->__isInitialized__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitialized($initialized)
    {
        $this->__isInitialized__ = $initialized;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitializer(\Closure $initializer = null)
    {
        $this->__initializer__ = $initializer;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __getInitializer()
    {
        return $this->__initializer__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setCloner(\Closure $cloner = null)
    {
        $this->__cloner__ = $cloner;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific cloning logic
     */
    public function __getCloner()
    {
        return $this->__cloner__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     * @static
     */
    public function __getLazyProperties()
    {
        return self::$lazyPropertiesDefaults;
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioNickname()
    {
        if ($this->__isInitialized__ === false) {
            return  parent::getUsuarioNickname();
        }

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioNickname', array());

        return parent::getUsuarioNickname();
    }

    /**
     * {@inheritDoc}
     */
    public function setUsuarioNombres($usuarioNombres)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuarioNombres', array($usuarioNombres));

        return parent::setUsuarioNombres($usuarioNombres);
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioNombres()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioNombres', array());

        return parent::getUsuarioNombres();
    }

    /**
     * {@inheritDoc}
     */
    public function setUsuarioApellidos($usuarioApellidos)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuarioApellidos', array($usuarioApellidos));

        return parent::setUsuarioApellidos($usuarioApellidos);
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioApellidos()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioApellidos', array());

        return parent::getUsuarioApellidos();
    }

    /**
     * {@inheritDoc}
     */
    public function setUsuarioTipoDoc($usuarioTipoDoc)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuarioTipoDoc', array($usuarioTipoDoc));

        return parent::setUsuarioTipoDoc($usuarioTipoDoc);
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioTipoDoc()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioTipoDoc', array());

        return parent::getUsuarioTipoDoc();
    }

    /**
     * {@inheritDoc}
     */
    public function setUsuarioNumDoc($usuarioNumDoc)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuarioNumDoc', array($usuarioNumDoc));

        return parent::setUsuarioNumDoc($usuarioNumDoc);
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioNumDoc()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioNumDoc', array());

        return parent::getUsuarioNumDoc();
    }

    /**
     * {@inheritDoc}
     */
    public function setUsuarioTelefono($usuarioTelefono)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuarioTelefono', array($usuarioTelefono));

        return parent::setUsuarioTelefono($usuarioTelefono);
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioTelefono()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioTelefono', array());

        return parent::getUsuarioTelefono();
    }

    /**
     * {@inheritDoc}
     */
    public function setUsuarioEmail($usuarioEmail)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuarioEmail', array($usuarioEmail));

        return parent::setUsuarioEmail($usuarioEmail);
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioEmail()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioEmail', array());

        return parent::getUsuarioEmail();
    }

    /**
     * {@inheritDoc}
     */
    public function setUsuarioFechaRegistro($usuarioFechaRegistro)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUsuarioFechaRegistro', array($usuarioFechaRegistro));

        return parent::setUsuarioFechaRegistro($usuarioFechaRegistro);
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioFechaRegistro()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioFechaRegistro', array());

        return parent::getUsuarioFechaRegistro();
    }

    /**
     * {@inheritDoc}
     */
    public function getMeGustaCompartirCompartir()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getMeGustaCompartirCompartir', array());

        return parent::getMeGustaCompartirCompartir();
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuariocatCatalogo()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuariocatCatalogo', array());

        return parent::getUsuariocatCatalogo();
    }

    /**
     * {@inheritDoc}
     */
    public function getUsuarioCompraCompra()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsuarioCompraCompra', array());

        return parent::getUsuarioCompraCompra();
    }

}


text:
<?php

namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;

use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPass;
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Form\AbstractType;

/**
 * @group legacy
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class FormPassTest extends TestCase
{
    public function testDoNothingIfFormExtensionNotLoaded()
    {
        $container = $this->createContainerBuilder();

        $container->compile();

        $this->assertFalse($container->hasDefinition('form.extension'));
    }

    public function testAddTaggedTypes()
    {
        $container = $this->createContainerBuilder();

        $container->setDefinition('form.extension', $this->createExtensionDefinition());
        $container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type');
        $container->register('my.type2', __CLASS__.'_Type2')->addTag('form.type');

        $container->compile();

        $extDefinition = $container->getDefinition('form.extension');

        $this->assertEquals(
            new ServiceLocatorArgument(array(
                __CLASS__.'_Type1' => new Reference('my.type1'),
                __CLASS__.'_Type2' => new Reference('my.type2'),
            )),
            $extDefinition->getArgument(0)
        );
    }

    /**
     * @dataProvider addTaggedTypeExtensionsDataProvider
     */
    public function testAddTaggedTypeExtensions(array $extensions, array $expectedRegisteredExtensions)
    {
        $container = $this->createContainerBuilder();

        $container->setDefinition('form.extension', $this->createExtensionDefinition());

        foreach ($extensions as $serviceId => $tag) {
            $container->register($serviceId, 'stdClass')->addTag('form.type_extension', $tag);
        }

        $container->compile();

        $extDefinition = $container->getDefinition('form.extension');
        $this->assertEquals($expectedRegisteredExtensions, $extDefinition->getArgument(1));
    }

    /**
     * @return array
     */
    public function addTaggedTypeExtensionsDataProvider()
    {
        return array(
            array(
                array(
                    'my.type_extension1' => array('extended_type' => 'type1'),
                    'my.type_extension2' => array('extended_type' => 'type1'),
                    'my.type_extension3' => array('extended_type' => 'type2'),
                ),
                array(
                    'type1' => new IteratorArgument(array(
                        new Reference('my.type_extension1'),
                        new Reference('my.type_extension2'),
                    )),
                    'type2' => new IteratorArgument(array(new Reference('my.type_extension3'))),
                ),
            ),
            array(
                array(
                    'my.type_extension1' => array('extended_type' => 'type1', 'priority' => 1),
                    'my.type_extension2' => array('extended_type' => 'type1', 'priority' => 2),
                    'my.type_extension3' => array('extended_type' => 'type1', 'priority' => -1),
                    'my.type_extension4' => array('extended_type' => 'type2', 'priority' => 2),
                    'my.type_extension5' => array('extended_type' => 'type2', 'priority' => 1),
                    'my.type_extension6' => array('extended_type' => 'type2', 'priority' => 1),
                ),
                array(
                    'type1' => new IteratorArgument(array(
                        new Reference('my.type_extension2'),
                        new Reference('my.type_extension1'),
                        new Reference('my.type_extension3'),
                    )),
                    'type2' => new IteratorArgument(array(
                        new Reference('my.type_extension4'),
                        new Reference('my.type_extension5'),
                        new Reference('my.type_extension6'),
                    )),
                ),
            ),
        );
    }

    /**
     * @expectedException \InvalidArgumentException
     * @expectedExceptionMessage extended-type attribute, none was configured for the "my.type_extension" service
     */
    public function testAddTaggedFormTypeExtensionWithoutExtendedTypeAttribute()
    {
        $container = $this->createContainerBuilder();

        $container->setDefinition('form.extension', $this->createExtensionDefinition());
        $container->register('my.type_extension', 'stdClass')
            ->addTag('form.type_extension');

        $container->compile();
    }

    public function testAddTaggedGuessers()
    {
        $container = $this->createContainerBuilder();

        $definition1 = new Definition('stdClass');
        $definition1->addTag('form.type_guesser');
        $definition2 = new Definition('stdClass');
        $definition2->addTag('form.type_guesser');

        $container->setDefinition('form.extension', $this->createExtensionDefinition());
        $container->setDefinition('my.guesser1', $definition1);
        $container->setDefinition('my.guesser2', $definition2);

        $container->compile();

        $extDefinition = $container->getDefinition('form.extension');

        $this->assertEquals(
            new IteratorArgument(array(
                new Reference('my.guesser1'),
                new Reference('my.guesser2'),
            )),
            $extDefinition->getArgument(2)
        );
    }

    /**
     * @dataProvider privateTaggedServicesProvider
     */
    public function testPrivateTaggedServices($id, $tagName, array $tagAttributes = array())
    {
        $container = $this->createContainerBuilder();

        $container->setDefinition('form.extension', $this->createExtensionDefinition());
        $container->register($id, 'stdClass')->setPublic(false)->addTag($tagName, $tagAttributes);

        $container->compile();
    }

    public function privateTaggedServicesProvider()
    {
        return array(
            array('my.type', 'form.type'),
            array('my.type_extension', 'form.type_extension', array('extended_type' => 'Symfony\Component\Form\Extension\Core\Type\FormType')),
            array('my.guesser', 'form.type_guesser'),
        );
    }

    private function createContainerBuilder()
    {
        $container = new ContainerBuilder();
        $container->addCompilerPass(new FormPass());

        return $container;
    }

    private function createExtensionDefinition()
    {
        $definition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension');
        $definition->setArguments(array(
            new ServiceLocatorArgument(array()),
            array(),
            new IteratorArgument(array()),
        ));

        return $definition;
    }
}

class FormPassTest_Type1 extends AbstractType
{
}

class FormPassTest_Type2 extends AbstractType
{
}


text: "$JAVA_HOME"/bin/java -jar lib/${project.artifactId}-${project.version}.jar $@


text:
import Ember from 'ember';
import ListFormController from 'ember-flexberry/controllers/list-form';

export default ListFormController.extend({
  filterByAnyWord: false,

  filterByAllWords: false,

  queryParams: ['filterCondition'],
  filterCondition: undefined,

  /**
    Observes current state of FilterCondition parameter
    & set right filter option after reload page.

    @method  _currentFilterCondition
    @private
  */
  _currentFilterCondition: Ember.observer('filterCondition', function() {
    let filterCondition = this.get('filterCondition');
    if (filterCondition === 'or') {
      this.set('filterByAnyWord', true);
      this.set('filterByAllWords', false);
    }else if (filterCondition === 'and') {
      this.set('filterByAnyWord', false);
      this.set('filterByAllWords', true);
    }

    return filterCondition;
  }),

  customButtons: Ember.computed('filterByAnyWord', 'filterByAllWords', function() {
    return [{
      buttonName: 'filterByAnyWord',
      buttonAction: 'toggleFilterByAnyWord',
      buttonClasses: this.get('filterByAnyWord') ? 'positive' : '',
    }, {
      buttonName: 'filterByAllWords',
      buttonAction: 'toggleFilterByAllWords',
      buttonClasses: this.get('filterByAllWords') ? 'positive' : '',
    }];
  }),

  actions: {
    toggleFilterByAnyWord() {
      this.toggleProperty('filterByAnyWord');
      if (this.get('filterByAnyWord')) {
        this.set('filterByAllWords', false);
      }
    },

    toggleFilterByAllWords() {
      this.toggleProperty('filterByAllWords');
      if (this.get('filterByAllWords')) {
        this.set('filterByAnyWord', false);
      }
    },

    componentForFilter(type, relation) {
      switch (type) {
        case 'decimal': return { name: 'flexberry-textbox', properties: { class: 'compact fluid' } };
        default: return {};
      }
    },

    conditionsByType(type) {
      switch (type) {
        case 'file':
          return null;

        case 'date':
        case 'number':
          return ['eq', 'neq', 'le', 'ge'];

        case 'string':
          return ['eq', 'neq', 'like', 'empty'];

        case 'boolean':
          return ['eq'];

        default:
          return ['eq', 'neq'];
      }
    },
  }
});


text:
package gnu.xml.dom;

/**
 *
 Abstract implemention of nodes describing external DTD-related
 * objects.  This facilitates reusing code for Entity, Notation, and
 * DocumentType (really, external subset) nodes.  Such support is not
 * part of the core DOM; it's for the "XML" feature.

 *
 *
 Note that you are strongly advised to avoid using the DOM
 * features that take advantage of this class, since (as of L2) none
 * of them is defined fully enough to permit full use of the
 * XML feature they partially expose.

 *
 * @author David Brownell
 * @author Chris Burdess
 */
public abstract class DomExtern
  extends DomNode
{

  private final String name;
  private final String publicId;
  private final String systemId;

  /**
   * Constructs a node associated with the specified document,
   * with the specified descriptive data.
   *
   * @param owner The document with which this object is associated
   * @param name Name of this object
   * @param publicId If non-null, provides the entity's PUBLIC identifier
   * @param systemId If non-null, provides the entity's SYSTEM identifier
   */
  // package private
  DomExtern(short nodeType,
            DomDocument owner,
            String name,
            String publicId,
            String systemId)
  {
    super(nodeType, owner);
    this.name = name;
    this.publicId = publicId;
    this.systemId = systemId;
  }

  /**
   * DOM L1
   * Returns the SYSTEM identifier associated with this object, if any.
   */
  public final String getSystemId()
  {
    return systemId;
  }

  /**
   * DOM L1
   * Returns the PUBLIC identifier associated with this object, if any.
   */
  public final String getPublicId()
  {
    return publicId;
  }

  /**
   * DOM L1
   * Returns the object's name.
   */
  public final String getNodeName()
  {
    return name;
  }

  public final String getLocalName()
  {
    return name;
  }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.code.gson</groupId>
  <artifactId>gson</artifactId>
  <packaging>jar</packaging>
  <version>1.8-SNAPSHOT</version>
  <inceptionYear>2008</inceptionYear>
  <name>Gson</name>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>5</version>
  </parent>
  <url>http://code.google.com/p/google-gson/</url>
  <description>Google Gson library</description>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:svn:http://google-gson.googlecode.com/svn/trunk/gson</connection>
    <developerConnection>scm:svn:https://google-gson.googlecode.com/svn/trunk/gson</developerConnection>
    <url>http://google-gson.googlecode.com/svn/trunk/gson</url>
  </scm>
  <issueManagement>
    <system>Google Code Issue Tracking</system>
    <url>http://code.google.com/p/google-gson/issues/list</url>
  </issueManagement>
  <organization>
    <name>Google, Inc.</name>
    <url>http://www.google.com</url>
  </organization>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <!-- Activate PGP signing only when performing a release -->
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.2</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <build>
    <defaultGoal>package</defaultGoal>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
            <manifestEntries>
              <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
              <Export-Package><![CDATA[com.google.gson;version=1.7.1, com.google.gson.annotations;version=1.7.1, com.google.gson.reflect;version=1.7.1, com.google.gson.stream;version=1.7.1, com.google.gson.internal;version=1.7.1]]></Export-Package>
              <Bundle-Version>1.7</Bundle-Version>
              <Bundle-ContactAddress>http://code.google.com/p/google-gson/</Bundle-ContactAddress>
              <Bundle-Vendor>Google Gson Project</Bundle-Vendor>
              <Bundle-Name>${project.name}</Bundle-Name>
              <Bundle-Description>${project.description}</Bundle-Description>
              <Bundle-ClassPath>.</Bundle-ClassPath>
              <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
              <Bundle-SymbolicName>com.google.gson</Bundle-SymbolicName>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
       <!-- TODO(inder): add manifest entry for maven group, artifact, and classifier ids -->
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-source-plugin</artifactId>
         <version>2.1.2</version>
         <executions>
           <execution>
             <id>attach-sources</id>
             <phase>verify</phase>
             <goals>
               <goal>jar</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
       <plugin>
         <!-- TODO(inder): add manifest entry for maven group, artifact, and classifier ids -->
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
         <version>2.7</version>
         <executions>
           <execution>
             <id>attach-javadocs</id>
             <goals>
               <goal>jar</goal>
             </goals>
           </execution>
         </executions>
         <configuration>
           <links>
             <link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
           </links>
           <version>true</version>
           <show>public</show>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-eclipse-plugin</artifactId>
         <version>2.8</version>
         <configuration>
           <downloadSources>true</downloadSources>
           <downloadJavadocs>true</downloadJavadocs>
           <workspace>
             ../eclipse-ws/
           </workspace>
           <workspaceCodeStylesURL>
             file:///${basedir}/../lib/gson-formatting-styles.xml
           </workspaceCodeStylesURL>
         </configuration>
       </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <targetJdk>1.5</targetJdk>
          <rulesets>
            <ruleset>/rulesets/basic.xml</ruleset>
            <ruleset>/rulesets/imports.xml</ruleset>
            <ruleset>/rulesets/unusedcode.xml</ruleset>
            <ruleset>/rulesets/finalizers.xml</ruleset>
          </rulesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <!-- configLocation>config/sun_checks.xml</configLocation -->
          <configLocation>config/maven_checks.xml</configLocation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <multipleLineComments>true</multipleLineComments>
          <tags>
            <tag>TODO</tag>
          </tags>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>clean</id>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <arguments>-DenableCiProfile=true</arguments>
          <tagBase>https://google-gson.googlecode.com/svn/tags/</tagBase>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2.1</version>
        <configuration>
          <descriptor>assembly-descriptor.xml</descriptor>
          <finalName>google-gson-${project.version}</finalName>
          <outputDirectory>target/dist</outputDirectory>
          <workDirectory>target/assembly/work</workDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <xmlOutput>true</xmlOutput>
          <!-- Optional derectory to put findbugs xdoc xml report -->
          <xmlOutputDirectory>target/site</xmlOutputDirectory>
        </configuration>
      </plugin>
      <plugin>
        <!--  if this fails, it means you have no svn installed -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changelog-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <type>range</type>
          <range>3650</range>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
        <version>2.4</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>changes-report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
  <developers>
    <developer>
      <name>Inderjeet Singh</name>
      <organization>Google Inc.</organization>
    </developer>
    <developer>
      <name>Joel Leitch</name>
      <organization>Google Inc.</organization>
    </developer>
    <developer>
      <name>Jesse Wilson</name>
      <organization>Google Inc.</organization>
    </developer>
  </developers>
</project>


text:
'use strict';

var httpRoot = 'http://localhost:5006';

angular.module('appServices', [ ])

.factory('_', ['$window', function($window) {
	return $window._; // assumes underscore has already been loaded on the page
}])
.factory('Settings', function() {
	var settings = {'default_locale':'en'};
	return {
		get: function(key){
			return settings[key];
		}
	}
})
.factory("LanguageService", ['$rootScope', function($rootScope) {
	return {
		set: function(lang) {
			$rootScope.currentLang = lang;
		},
		get: function(){
			/**
			 * default language is en
			 */
			if (!$rootScope.currentLang || !$rootScope.currentLang.trim()){
				$rootScope.currentLang = 'en';
			}
			return $rootScope.currentLang;
		}
	}
}])
.factory("PageService", ['$rootScope', function($rootScope) {
	return {
		set: function(slug) {
			$rootScope.currentPage = slug;
		},
		get: function(){
			if (!$rootScope.currentPage || !$rootScope.currentPage.trim()){
				$rootScope.currentPage = 'home';
			}
			return $rootScope.currentPage;
		}
	}
}])
.factory("FlashService", ['$rootScope', function($rootScope) {
	return {
		set: function(message) {
			$rootScope.flash = message;
		},
		clear: function() {
			$rootScope.flash = "";
		},
		get: function(){
			return $rootScope.flash;
		}
	}
}])
.factory('Content', function($http) {
	return {
		all: function(){
			return $http.get(httpRoot + '/api/contents');
		},
		query: function(slug) {
			return $http.get(httpRoot + '/api/page/' + slug);
		}
	}
})
.factory('Resource', function($resource) {
	return $resource('/api/t/resource/:id', {id: '@id'}, {
        update: {method:'PUT'}
    });
});


text:
package kr.debop4j.data.ogm;

import kr.debop4j.data.hibernate.unitofwork.UnitOfWorks;
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * kr.debop4j.data.ogm.GridDatastoreTestBase
 *
 * @author 배성혁 ( sunghyouk.bae@gmail.com )
 * @since 13. 4. 16. 오후 12:05
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { GridDatastoreConfiguration.class })
public class GridDatastoreTestBase {

    @Before
    public void before() {
        UnitOfWorks.start();
    }

    @After
    public void after() {
        UnitOfWorks.stop();
    }
}


text:
/**
   @file ParallelRunner.h

   Defines the ParallelRunner class

   @author Daniel Abercrombie <dabercro@mit.edu>
*/

#ifndef CROMBIETOOLS_COMMONTOOLS_PARALLELRUNNER_H
#define CROMBIETOOLS_COMMONTOOLS_PARALLELRUNNER_H

#include <vector>
#include <queue>

#include "TMutex.h"
#include "TThread.h"

#include "FileConfigReader.h"

TMutex queue_lock;
TMutex output_lock;
TMutex root_lock;  // For doing sketchy ROOT things

/**
   @ingroup commongroup
   @class ParallelRunner
   Class for running over FileInfos in parallel
*/

class ParallelRunner : public FileConfigReader {
 public:
  /// Set the number of cores to use in the plotting
  void SetNumThreads ( UInt_t nthreads ) { fNumThreads = nthreads; }

 protected:
  /// Run over all of the filled FileInfos
  void RunThreads ();

  /// Virtual function that must be implemented in inheriting class
  virtual void RunFile (FileInfo& info) = 0;

 private:
  /// Number of cores to prepare plots with
  UInt_t fNumThreads {1};

  /// Files to run over in parallel
  std::priority_queue<FileInfo>  file_queue;

  /// Runs a single thread over files
  static void* RunThread (void* prep);

  static unsigned numfiles;
  static unsigned maxfiles;
};

unsigned ParallelRunner::numfiles = 0;
unsigned ParallelRunner::maxfiles = 0;

void ParallelRunner::RunThreads() {
  for (auto type : gFileTypes) {
    const auto& infos = *(GetFileInfo(type));
    numfiles += infos.size();
    for (auto info : infos)
      file_queue.push(*info);
  }

  maxfiles = numfiles;

  if (not fNumThreads)
    fNumThreads++;

  std::vector<TThread*> threads;
  for (decltype(fNumThreads) i_thread = 0; i_thread < fNumThreads; ++i_thread) {
    TThread* temp = new TThread(RunThread, this);
    threads.push_back(temp);
    temp->Run(this);
  }

  for (auto thread : threads) {
    thread->Join();
    root_lock.Lock();
    delete thread;
    root_lock.UnLock();
  }
}

void* ParallelRunner::RunThread(void* prep) {
  auto* runner = reinterpret_cast<ParallelRunner*>(prep);
  bool running = true;
  FileInfo info;
  while(true) {
    queue_lock.Lock();
    running = !runner->file_queue.empty();
    if (running) {
      info = runner->file_queue.top();
      runner->file_queue.pop();
    }
    queue_lock.UnLock();

    if (not running)
      break;

    runner->RunFile(info);
    output_lock.Lock();
    std::cout << "Files remaining: " << --numfiles << "/" << maxfiles
              << " Finished: " << info.fFileName << std::endl;
    output_lock.UnLock();
  }
  return nullptr;
}

#endif


text:
<!DOCTYPE html>

<title>Server Error</title>

An error occurred.

Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the log of this application for details.

Faithfully yours, ares.


text:
- some basic examples for Spring Boot
- usage of *egg* here is [SSCCE](http://sscce.org/) **not** a [hidden feature](https://en.wikipedia.org/wiki/Easter_egg_(media))


text:
namespace LinqInfer.Data.Serialisation
{
    public interface IBinaryExportable
    {
        byte[] ToByteArray();
    }
}