text:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--

-->
<configuration supports_final="false" supports_adding_forbidden="true">
  <property>
    <name>content</name>
    <display-name>beeline-log4j template</display-name>
    <description>Custom beeline-log4j2.properties</description>
    <value>
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

status = INFO
name = BeelineLog4j2
packages = org.apache.hadoop.hive.ql.log

# list of properties
property.hive.log.level = WARN
property.hive.root.logger = console

# list of all appenders
appenders = console

# console appender
appender.console.type = Console
appender.console.name = console
appender.console.target = SYSTEM_ERR
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} [%t]: %p %c{2}: %m%n

# list of all loggers
loggers = HiveConnection

# HiveConnection logs useful info for dynamic service discovery
logger.HiveConnection.name = org.apache.hive.jdbc.HiveConnection
logger.HiveConnection.level = INFO

# root logger
rootLogger.level = ${sys:hive.log.level}
rootLogger.appenderRefs = root
rootLogger.appenderRef.root.ref = ${sys:hive.root.logger}
  </value>
    <value-attributes>
      <type>content</type>
      <show-property-name>false</show-property-name>
    </value-attributes>
    <on-ambari-upgrade add="true"/>
  </property>
</configuration>


text:
<?php

/**
 * PluginBokiAccountLog form.
 *
 * @package    filters
 * @subpackage BokiAccountLog *
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
abstract class PluginBokiAccountLogFormFilter extends BaseBokiAccountLogFormFilter
{
}

redpajama_set_name: RedPajamaGithub


text:
<?php

class GroepsactiviteitenVrijwilliger extends AppModel
{
    public $name = 'GroepsactiviteitenVrijwilliger';
    public $displayField = 'groepsactiviteit_id';
    //The Associations below have been created with all possible keys, those that are not needed can be removed

    public $actsAs = array('Containable');

    public $belongsTo = array(
        'Groepsactiviteit' => array(
            'className' => 'Groepsactiviteit',
            'foreignKey' => 'groepsactiviteit_id',
            'conditions' => '',
            'fields' => '',
            'order' => '',
        ),
        'Vrijwilliger' => array(
            'className' => 'Vrijwilliger',
            'foreignKey' => 'vrijwilliger_id',
            'conditions' => '',
            'fields' => '',
            'order' => '',
        ),
    );

    public function get_count($groepsactiviteit_id)
    {
        $return = $this->find('list', array(
                'conditions' => array('groepsactiviteit_id' => $groepsactiviteit_id),
                'contain' => array(),
        ));

        $count = count($return);

        return $count;
    }
}


text:
/* Main header for the Vitesse IQ2000.  */

#ifndef SIM_MAIN_H
#define SIM_MAIN_H

/* sim-basics.h includes config.h but cgen-types.h must be included before
   sim-basics.h and cgen-types.h needs config.h.  */
#include "config.h"

#include "symcat.h"
#include "sim-basics.h"
#include "cgen-types.h"
#include "iq2000-desc.h"
#include "iq2000-opc.h"
#include "arch.h"

/* Pull in IQ2000_{DATA,INSN}_{MASK,VALUE}.  */
#include "elf/iq2000.h"

#include "sim-base.h"
#include "cgen-sim.h"
#include "iq2000-sim.h"

/* The _sim_cpu struct.  */

struct _sim_cpu {
  /* sim/common cpu base.  */
  sim_cpu_base base;

  /* Static parts of cgen.  */
  CGEN_CPU cgen_cpu;

  /* CPU specific parts go here.
     Note that in files that don't need to access these pieces WANT_CPU_FOO
     won't be defined and thus these parts won't appear.  This is ok in the
     sense that things work.  It is a source of bugs though.
     One has to of course be careful to not take the size of this
     struct and no structure members accessed in non-cpu specific files can
     go after here.  Oh for a better language.  */
#if defined (WANT_CPU_IQ2000BF)
  IQ2000BF_CPU_DATA cpu_data;
#endif
};

/* The sim_state struct.  */

struct sim_state {
  sim_cpu *cpu[MAX_NR_PROCESSORS];

  CGEN_STATE cgen_state;

  sim_state_base base;
};

/* Misc.  */

/* Catch address exceptions.  */
extern SIM_CORE_SIGNAL_FN iq2000_core_signal;
#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
iq2000_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
		  (TRANSFER), (ERROR))

/* Convert between CPU-internal addresses and sim_core addresses.  */
#define CPU2DATA(addr) (IQ2000_DATA_VALUE + (addr))
#define DATA2CPU(addr) ((addr) - IQ2000_DATA_VALUE)
#define CPU2INSN(addr) (IQ2000_INSN_VALUE + ((addr) & ~IQ2000_INSN_MASK))
#define INSN2CPU(addr) ((addr) - IQ2000_INSN_VALUE)
#define IQ2000_INSN_MEM_SIZE (CPU2INSN(0x800000) - CPU2INSN(0x0000))
#define IQ2000_DATA_MEM_SIZE (CPU2DATA(0x800000) - CPU2DATA(0x0000))

#endif /* SIM_MAIN_H */


text:
from __future__ import absolute_import, unicode_literals

class Site(object):
    """The site supported object which could be mounted to app instance.

    :param name: the name of the supported site.
    """

    def __init__(self, name):
        self.name = name
        self.actions = []

    def record_action(self, method_name, *args, **kwargs):
        """Record the method-calling action.

        The actions expect to be played on an target object.

        :param method_name: the name of called method.
        :param args: the general arguments for calling method.
        :param kwargs: the keyword arguments for calling method.
        """
        self.actions.append((method_name, args, kwargs))

    def play_actions(self, target):
        """Play record actions on the target object.

        :param target: the target which recive all record actions, is a brown
                       ant app instance normally.
        :type target: :class:`~brownant.app.Brownant`
        """
        for method_name, args, kwargs in self.actions:
            method = getattr(target, method_name)
            method(*args, **kwargs)

    def route(self, host, rule, **options):
        """The decorator to register wrapped function as the brown ant app.

        All optional parameters of this method are compatible with the
        :meth:`~brownant.app.Brownant.add_url_rule`.

        Registered functions or classes must be import-able with its qualified
        name. It is different from the :class:`~flask.Flask`, but like a
        lazy-loading mode. Registered objects only be loaded before the first
        using.

        The right way::

            @site.route("www.example.com", "/item/<int:item_id>")
            def spam(request, item_id):
                pass

        The wrong way::

            def egg():
                # the function could not be imported by its qualified name
                @site.route("www.example.com", "/item/<int:item_id>")
                def spam(request, item_id):
                    pass

            egg()

        :param host: the limited host name.
        :param rule: the URL path rule as string.
        :param options: the options to be forwarded to the
                        :class:`werkzeug.routing.Rule` object.
        """
        def decorator(func):
            endpoint = "{func.__module__}:{func.__name__}".format(func=func)
            self.record_action("add_url_rule", host, rule, endpoint, **options)
            return func
        return decorator


text:
package converters

import (
	"log"
	"encoding/xml"
	"os"
	"strings"
	"time"
	"strconv"
	"github.com/tfolkman/budget/models"
	"github.com/astaxie/beego/orm"
	"math"
)

type Transaction struct {
	trnType string   `xml:"TRNTYPE"`
	datePosted string   `xml:"DTPOSTED"`
	trnAmt float64`xml:"TRNAMT"`
	name string`xml:"NAME"`
}

func ReadQfx(fileName string, dedup string) []models.Transactions {
	log.Println("Read QFX...")
	o := orm.NewOrm()
	xmlFile, err := os.Open(fileName)
        if err != nil {
            log.Fatal(err)
        }
	decoder := xml.NewDecoder(xmlFile)
	var transactions []models.Transactions
	var transaction models.Transactions
	var inElement string
	var text string
	var fitid string
	var refnum string
	var date time.Time
	var inflow float64
	var outflow float64
	var payee string
	var cnt int64
	for {
		// Read tokens from the XML document in a stream.
		t, _ := decoder.RawToken()
		if t == nil {
			break
		}
		switch se := t.(type) {
		case xml.CharData:
			text = strings.TrimSpace(string(t.(xml.CharData)))
			if inElement == "DTPOSTED"{
				date, _ = time.Parse("20060102", text[:8])
			}
			if inElement == "TRNAMT"{
				num, _ := strconv.ParseFloat(text, 64)
				if num < 0 {
					outflow = math.Abs(num)
					inflow = 0
				} else {
					inflow = num
					outflow = 0
				}
			}
			if inElement == "NAME"{
				payee = text
			}
			if inElement == "FITID"{
				fitid = text
			}
			if inElement == "REFNUM"{
				refnum = text
			}
		case xml.StartElement:
			inElement = se.Name.Local
		case xml.EndElement:
			// If we just read a StartElement token
			inElement = se.Name.Local
			// ...and its name is "page"
			if inElement == "STMTTRN" {
				transaction.Inflow = inflow
				transaction.Date = date
				transaction.Import = true
				transaction.Outflow = outflow
				transaction.Payee = payee
				transaction.Refnum = refnum
				transaction.Fitid = fitid
				log.Println(transaction)
				if dedup == "true"{
					cnt, _ = o.QueryTable("transactions").Filter("fitid", fitid).
					Filter("payee", payee).Filter("outflow", outflow).
					Filter("inflow", inflow).Count()
					if cnt <= 0 {
						cnt, _ = o.QueryTable("transactions").Filter("refnum", fitid).
						Filter("date", date).Filter("payee", payee).Filter("outflow", outflow).
						Filter("inflow", inflow).Count()
					}
					if cnt == 0{
						transactions = append(transactions, transaction)
					}
				} else {
					transactions = append(transactions, transaction)
				}
			}
		default:
		}
	}
	return transactions
}


text:
using UnityEngine;
using System.Collections;

public class CollisionGameOver : MonoBehaviour {

	void OnTriggerEnter(Collider collider) {
		if (collider.tag != "Goal"){

			GameManagerScript gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent<GameManagerScript>();
			gm.doRestart = true;
			gm.setGameOverLabel("Level Failed!");

		}
	}
}


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

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeGeneration;
using Microsoft.CodeAnalysis.Diagnostics.Analyzers.NamingStyles;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Semantics;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.CodeAnalysis.Simplification;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.InitializeParameter
{
    internal abstract partial class AbstractInitializeMemberFromParameterCodeRefactoringProvider<
        TParameterSyntax,
        TMemberDeclarationSyntax,
        TStatementSyntax,
        TExpressionSyntax,
        TBinaryExpressionSyntax> : AbstractInitializeParameterCodeRefactoringProvider<
            TParameterSyntax,
            TMemberDeclarationSyntax,
            TStatementSyntax,
            TExpressionSyntax,
            TBinaryExpressionSyntax>
        where TParameterSyntax : SyntaxNode
        where TMemberDeclarationSyntax : SyntaxNode
        where TStatementSyntax : SyntaxNode
        where TExpressionSyntax : SyntaxNode
        where TBinaryExpressionSyntax : TExpressionSyntax
    {
        // Standard field/property names we look for when we have a parameter with a given name.
        // We also use the rules to help generate fresh fields/properties.  Note that we always
        // look at these rules *after* the user's own rules.  That way we respect user naming, but
        // also have a reasonably fallback if they don't have any specified preferences.
        private static readonly ImmutableArray<NamingRule> s_builtInRules = ImmutableArray.Create(
                new NamingRule(new SymbolSpecification(
                    Guid.NewGuid(), "Property",
                    ImmutableArray.Create(new SymbolSpecification.SymbolKindOrTypeKind(SymbolKind.Property))),
                    new NamingStyles.NamingStyle(Guid.NewGuid(), capitalizationScheme: Capitalization.PascalCase),
                    enforcementLevel: DiagnosticSeverity.Hidden),
                new NamingRule(new SymbolSpecification(
                    Guid.NewGuid(), "Field",
                    ImmutableArray.Create(new SymbolSpecification.SymbolKindOrTypeKind(SymbolKind.Field))),
                    new NamingStyles.NamingStyle(Guid.NewGuid(), capitalizationScheme: Capitalization.CamelCase),
                    enforcementLevel: DiagnosticSeverity.Hidden),
                new NamingRule(new SymbolSpecification(
                    Guid.NewGuid(), "FieldWithUnderscore",
                    ImmutableArray.Create(new SymbolSpecification.SymbolKindOrTypeKind(SymbolKind.Field))),
                    new NamingStyles.NamingStyle(Guid.NewGuid(), prefix: "_", capitalizationScheme: Capitalization.CamelCase),
                    enforcementLevel: DiagnosticSeverity.Hidden));

        protected abstract SyntaxNode TryGetLastStatement(IBlockStatement blockStatementOpt);

        protected override async Task<ImmutableArray<CodeAction>> GetRefactoringsAsync(
            Document document, IParameterSymbol parameter, TMemberDeclarationSyntax memberDeclaration,
            IBlockStatement blockStatementOpt, CancellationToken cancellationToken)
        {
            // Only supported for constructor parameters.
            var methodSymbol = parameter.ContainingSymbol as IMethodSymbol;
            if (methodSymbol?.MethodKind != MethodKind.Constructor)
            {
                return ImmutableArray<CodeAction>.Empty;
            }

            var assignmentStatement = TryFindFieldOrPropertyAssignmentStatement(
                parameter, blockStatementOpt);
            if (assignmentStatement != null)
            {
                // We're already assigning this parameter to a field/property in this type.
                // So there's nothing more for us to do.
                return ImmutableArray<CodeAction>.Empty;
            }

            // Haven't initialized any fields/properties with this parameter.  Offer to assign
            // to an existing matching field/prop if we can find one, or add a new field/prop
            // if we can't.

            var fieldOrProperty = await TryFindMatchingUninitializedFieldOrPropertySymbolAsync(
                document, parameter, blockStatementOpt, cancellationToken).ConfigureAwait(false);

            if (fieldOrProperty != null)
            {
                // Found a field/property that this parameter should be assigned to.
                // Just offer the simple assignment to it.

                var resource = fieldOrProperty.Kind == SymbolKind.Field
                    ? FeaturesResources.Initialize_field_0
                    : FeaturesResources.Initialize_property_0;

                var title = string.Format(resource, fieldOrProperty.Name);

                return ImmutableArray.Create<CodeAction>(new MyCodeAction(
                    title,
                    c => AddSymbolInitializationAsync(
                        document, parameter, memberDeclaration, blockStatementOpt, fieldOrProperty, c)));
            }
            else
            {
                // Didn't find a field/prop that this parameter could be assigned to.
                // Offer to create new one and assign to that.
                var codeGenService = document.GetLanguageService<ICodeGenerationService>();

                // Get the parts of the parameter name and the appropriate naming rules so
                // that we can name the field/property accordingly.
                var parameterNameParts = this.GetParameterWordParts(parameter);
                var rules = await this.GetNamingRulesAsync(document, cancellationToken).ConfigureAwait(false);

                var field = CreateField(parameter, rules, parameterNameParts);
                var property = CreateProperty(parameter, rules, parameterNameParts);

                // Offer to generate either a property or a field.  Currently we place the property
                // suggestion first (to help users with the immutable object+property pattern). But
                // we could consider swapping this if people prefer creating private fields more.
                return ImmutableArray.Create<CodeAction>(
                    new MyCodeAction(string.Format(FeaturesResources.Create_and_initialize_property_0, property.Name),
                        c => AddSymbolInitializationAsync(document, parameter, memberDeclaration, blockStatementOpt, property, c)),
                    new MyCodeAction(string.Format(FeaturesResources.Create_and_initialize_field_0, field.Name),
                        c => AddSymbolInitializationAsync(document, parameter, memberDeclaration, blockStatementOpt, field, c)));
            }
        }

        private IFieldSymbol CreateField(
            IParameterSymbol parameter, ImmutableArray<NamingRule> rules, ImmutableArray<string> parameterNameParts)
        {
            foreach (var rule in rules)
            {
                if (rule.SymbolSpecification.AppliesTo(SymbolKind.Field, Accessibility.Private))
                {
                    var uniqueName = GenerateUniqueName(parameter, parameterNameParts, rule);

                    return CodeGenerationSymbolFactory.CreateFieldSymbol(
                        default,
                        Accessibility.Private,
                        DeclarationModifiers.ReadOnly,
                        parameter.Type, uniqueName);
                }
            }

            // We place a special rule in s_builtInRules that matches all fields.  So we should
            // always find a matching rule.
            throw ExceptionUtilities.Unreachable;
        }

        private static string GenerateUniqueName(IParameterSymbol parameter, ImmutableArray<string> parameterNameParts, NamingRule rule)
        {
            // Determine an appropriate name to call the new field.
            var containingType = parameter.ContainingType;
            var baseName = rule.NamingStyle.CreateName(parameterNameParts);

            // Ensure that the name is unique in the containing type so we
            // don't stomp on an existing member.
            var uniqueName = NameGenerator.GenerateUniqueName(
                baseName, n => containingType.GetMembers(n).IsEmpty);
            return uniqueName;
        }

        private IPropertySymbol CreateProperty(
            IParameterSymbol parameter, ImmutableArray<NamingRule> rules, ImmutableArray<string> parameterNameParts)
        {
            foreach (var rule in rules)
            {
                if (rule.SymbolSpecification.AppliesTo(SymbolKind.Property, Accessibility.Public))
                {
                    var uniqueName = GenerateUniqueName(parameter, parameterNameParts, rule);

                    var getMethod = CodeGenerationSymbolFactory.CreateAccessorSymbol(
                        default,
                        Accessibility.Public,
                        default);

                    return CodeGenerationSymbolFactory.CreatePropertySymbol(
                        default,
                        Accessibility.Public,
                        new DeclarationModifiers(),
                        parameter.Type,
                        returnsByRef: false,
                        explicitInterfaceImplementations: default,
                        name: uniqueName,
                        parameters: default,
                        getMethod: getMethod,
                        setMethod: null);
                }
            }

            // We place a special rule in s_builtInRules that matches all properties.  So we should
            // always find a matching rule.
            throw ExceptionUtilities.Unreachable;
        }

        private async Task<Document> AddSymbolInitializationAsync(
            Document document, IParameterSymbol parameter, TMemberDeclarationSyntax memberDeclaration,
            IBlockStatement blockStatementOpt, ISymbol fieldOrProperty, CancellationToken cancellationToken)
        {
            var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);

            var workspace = document.Project.Solution.Workspace;
            var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
            var editor = new SyntaxEditor(root, workspace);
            var generator = editor.Generator;

            if (fieldOrProperty.ContainingType == null)
            {
                // We're generating a new field/property.  Place into the containing type,
                // ideally before/after a relevant existing member.

                // First, look for the right containing type (As a type may be partial).
                // We want the type-block that this constructor is contained within.
                var typeDeclaration =
                    parameter.ContainingType.DeclaringSyntaxReferences
                                            .Select(r => GetTypeBlock(r.GetSyntax(cancellationToken)))
                                            .Single(d => memberDeclaration.Ancestors().Contains(d));

                // Now add the field/property to this type.  Use the 'ReplaceNode+callback' form
                // so that nodes will be appropriate tracked and so we can then update the constructor
                // below even after we've replaced the whole type with a new type.
                //
                // Note: We'll pass the appropriate options so that the new field/property
                // is appropriate placed before/after an existing field/property.  We'll try
                // to preserve the same order for fields/properties that we have for the constructor
                // parameters.
                editor.ReplaceNode(
                    typeDeclaration,
                    (currentTypeDecl, _) =>
                    {
                        if (fieldOrProperty is IPropertySymbol property)
                        {
                            return CodeGenerator.AddPropertyDeclaration(
                                currentTypeDecl, property, workspace,
                                GetAddOptions<IPropertySymbol>(parameter, blockStatementOpt, typeDeclaration, cancellationToken));
                        }
                        else if (fieldOrProperty is IFieldSymbol field)
                        {
                            return CodeGenerator.AddFieldDeclaration(
                                currentTypeDecl, field, workspace,
                                GetAddOptions<IFieldSymbol>(parameter, blockStatementOpt, typeDeclaration, cancellationToken));
                        }
                        else
                        {
                            throw ExceptionUtilities.Unreachable;
                        }
                    });
            }

            // Now that we've added any potential members, create an assignment between it
            // and the parameter.
            var initializationStatement = (TStatementSyntax)generator.ExpressionStatement(
                generator.AssignmentStatement(
                    generator.MemberAccessExpression(
                        generator.ThisExpression(),
                        generator.IdentifierName(fieldOrProperty.Name)),
                    generator.IdentifierName(parameter.Name)));

            // Attempt to place the initialization in a good location in the constructor
            // We'll want to keep initialization statements in the same order as we see
            // parameters for the constructor.
            var statementToAddAfterOpt = TryGetStatementToAddInitializationAfter(
                semanticModel, parameter, blockStatementOpt, cancellationToken);

            InsertStatement(editor, memberDeclaration, statementToAddAfterOpt, initializationStatement);

            return document.WithSyntaxRoot(editor.GetChangedRoot());
        }

        private CodeGenerationOptions GetAddOptions<TSymbol>(
            IParameterSymbol parameter, IBlockStatement blockStatementOpt,
            SyntaxNode typeDeclaration, CancellationToken cancellationToken)
            where TSymbol : ISymbol
        {
            var methodSymbol = (IMethodSymbol)parameter.ContainingSymbol;
            var parameterIndex = methodSymbol.Parameters.IndexOf(parameter);

            for (var i = parameterIndex - 1; i >= 0; i--)
            {
                var statement = TryFindFieldOrPropertyAssignmentStatement(
                    methodSymbol.Parameters[i], blockStatementOpt, out var fieldOrProperty);

                if (statement != null &&
                    fieldOrProperty is TSymbol symbol)
                {
                    var symbolSyntax = symbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken);
                    if (symbolSyntax.Ancestors().Contains(typeDeclaration))
                    {
                        // Found an existing field/property that corresponds to a preceding parameter.
                        // Place ourselves directly after it.
                        return new CodeGenerationOptions(afterThisLocation: symbolSyntax.GetLocation());
                    }
                }
            }

            for (var i = parameterIndex + 1; i < methodSymbol.Parameters.Length; i++)
            {
                var statement = TryFindFieldOrPropertyAssignmentStatement(
                    methodSymbol.Parameters[i], blockStatementOpt, out var fieldOrProperty);

                if (statement != null &&
                    fieldOrProperty is TSymbol symbol)
                {
                    // Found an existing field/property that corresponds to a following parameter.
                    // Place ourselves directly before it.
                    var symbolSyntax = symbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken);
                    if (symbolSyntax.Ancestors().Contains(typeDeclaration))
                    {
                        return new CodeGenerationOptions(beforeThisLocation: symbolSyntax.GetLocation());
                    }
                }
            }

            return null;
        }

        private SyntaxNode TryGetStatementToAddInitializationAfter(
            SemanticModel semanticModel,
            IParameterSymbol parameter,
            IBlockStatement blockStatementOpt,
            CancellationToken cancellationToken)
        {
            var methodSymbol = (IMethodSymbol)parameter.ContainingSymbol;
            var parameterIndex = methodSymbol.Parameters.IndexOf(parameter);

            // look for an existing assignment for a parameter that comes before us.
            // If we find one, we'll add ourselves after that parameter check.
            for (var i = parameterIndex - 1; i >= 0; i--)
            {
                var statement = TryFindFieldOrPropertyAssignmentStatement(
                    methodSymbol.Parameters[i], blockStatementOpt);
                if (statement != null)
                {
                    return statement.Syntax;
                }
            }

            // look for an existing check for a parameter that comes before us.
            // If we find one, we'll add ourselves after that parameter check.
            for (var i = parameterIndex + 1; i < methodSymbol.Parameters.Length; i++)
            {
                var statement = TryFindFieldOrPropertyAssignmentStatement(
                    methodSymbol.Parameters[i], blockStatementOpt);
                if (statement != null)
                {
                    var statementIndex = blockStatementOpt.Statements.IndexOf(statement);
                    return statementIndex > 0 ? blockStatementOpt.Statements[statementIndex - 1].Syntax : null;
                }
            }

            // We couldn't find a reasonable location for the new initialization statement.
            // Just place ourselves after the last statement in the constructor.
            return TryGetLastStatement(blockStatementOpt);
        }

        private IOperation TryFindFieldOrPropertyAssignmentStatement(IParameterSymbol parameter, IBlockStatement blockStatementOpt)
            => TryFindFieldOrPropertyAssignmentStatement(parameter, blockStatementOpt, out var fieldOrProperty);

        private IOperation TryFindFieldOrPropertyAssignmentStatement(
            IParameterSymbol parameter, IBlockStatement blockStatementOpt, out ISymbol fieldOrProperty)
        {
            if (blockStatementOpt != null)
            {
                var containingType = parameter.ContainingType;
                foreach (var statement in blockStatementOpt.Statements)
                {
                    // look for something of the form:  "this.s = s" or "this.s = s ?? ..."
                    if (IsFieldOrPropertyAssignment(statement, containingType, out var assignmentExpression, out fieldOrProperty) &&
                        IsParameterReferenceOrCoalesceOfParameterReference(assignmentExpression, parameter))
                    {
                        return statement;
                    }
                }
            }

            fieldOrProperty = null;
            return null;
        }

        private static bool IsParameterReferenceOrCoalesceOfParameterReference(
           IAssignmentExpression assignmentExpression, IParameterSymbol parameter)
        {
            if (IsParameterReference(assignmentExpression.Value, parameter))
            {
                // We already have a member initialized with this parameter like:
                //      this.field = parameter
                return true;
            }

            if (UnwrapImplicitConversion(assignmentExpression.Value) is INullCoalescingExpression coalesceExpression &&
                IsParameterReference(coalesceExpression.PrimaryOperand, parameter))
            {
                // We already have a member initialized with this parameter like:
                //      this.field = parameter ?? ...
                return true;
            }

            return false;
        }

        private async Task<ISymbol> TryFindMatchingUninitializedFieldOrPropertySymbolAsync(
            Document document, IParameterSymbol parameter, IBlockStatement blockStatementOpt, CancellationToken cancellationToken)
        {
            // Look for a field/property that really looks like it corresponds to this parameter.
            // Use a variety of heuristics around the name/type to see if this is a match.

            var rules = await GetNamingRulesAsync(document, cancellationToken).ConfigureAwait(false);
            var parameterWords = GetParameterWordParts(parameter);

            var containingType = parameter.ContainingType;
            var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);

            // Walk through the naming rules against this parameter's name to see what
            // name the user would like for it as a member in this type.  Note that we
            // have some fallback rules that use the standard conventions around
            // properties /fields so that can still find things even if the user has no
            // naming preferences set.

            foreach (var rule in rules)
            {
                var memberName = rule.NamingStyle.CreateName(parameterWords);
                foreach (var memberWithName in containingType.GetMembers(memberName))
                {
                    // We found members in our type with that name.  If it's a writable
                    // field that we could assign this parameter to, and it's not already
                    // been assigned to, then this field is a good candidate for us to
                    // hook up to.
                    if (memberWithName is IFieldSymbol field &&
                        !field.IsConst &&
                        IsImplicitConversion(compilation, source: parameter.Type, destination: field.Type) &&
                        !ContainsMemberAssignment(blockStatementOpt, field))
                    {
                        return field;
                    }

                    // If it's a writable property that we could assign this parameter to, and it's
                    // not already been assigned to, then this property is a good candidate for us to
                    // hook up to.
                    if (memberWithName is IPropertySymbol property &&
                        property.IsWritableInConstructor() &&
                        IsImplicitConversion(compilation, source: parameter.Type, destination: property.Type) &&
                        !ContainsMemberAssignment(blockStatementOpt, property))
                    {
                        return property;
                    }
                }
            }

            // Couldn't find any existing member.  Just return nothing so we can offer to
            // create a member for them.
            return null;
        }

        private bool ContainsMemberAssignment(
            IBlockStatement blockStatementOpt, ISymbol member)
        {
            if (blockStatementOpt != null)
            {
                foreach (var statement in blockStatementOpt.Statements)
                {
                    if (IsFieldOrPropertyAssignment(statement, member.ContainingType, out var assignmentExpression) &&
                        UnwrapImplicitConversion(assignmentExpression.Target) is IMemberReferenceExpression memberReference &&
                        member.Equals(memberReference.Member))
                    {
                        return true;
                    }
                }
            }

            return false;
        }

        private async Task<ImmutableArray<NamingRule>> GetNamingRulesAsync(
            Document document, CancellationToken cancellationToken)
        {
            var options = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false);
            var namingStyleOptions = options.GetOption(SimplificationOptions.NamingPreferences);

            // Add our built-in-rules at the end so that we always respect user naming rules
            // first, but we always have something to fall-back upon if there are no matches.
            var rules = namingStyleOptions.CreateRules().NamingRules.AddRange(s_builtInRules);
            return rules;
        }

        /// <summary>
        /// Get the individual words in the parameter name.  This way we can generate
        /// appropriate field/property names based on the user's preference.
        /// </summary>
        private ImmutableArray<string> GetParameterWordParts(IParameterSymbol parameter)
        {
            var parts = StringBreaker.GetWordParts(parameter.Name);
            var result  = CreateWords(parts, parameter.Name);
            parts.Free();
            return result;
        }

        private ImmutableArray<string> CreateWords(ArrayBuilder<TextSpan> parts, string name)
        {
            var result = ArrayBuilder<string>.GetInstance(parts.Count);
            foreach (var part in parts)
            {
                result.Add(name.Substring(part.Start, part.Length));
            }

            return result.ToImmutableAndFree();
        }
    }
}


text:
[![CI Status](http://img.shields.io/travis/Amine Bezzarga/ConnectSDK-CompanionLibrary-iOS.svg?style=flat)](https://travis-ci.org/Amine Bezzarga/ConnectSDK-CompanionLibrary-iOS)
[![Version](https://img.shields.io/cocoapods/v/ConnectSDK-CompanionLibrary-iOS.svg?style=flat)](http://cocoapods.org/pods/ConnectSDK-CompanionLibrary-iOS)
[![License](https://img.shields.io/cocoapods/l/ConnectSDK-CompanionLibrary-iOS.svg?style=flat)](http://cocoapods.org/pods/ConnectSDK-CompanionLibrary-iOS)
[![Platform](https://img.shields.io/cocoapods/p/ConnectSDK-CompanionLibrary-iOS.svg?style=flat)](http://cocoapods.org/pods/ConnectSDK-CompanionLibrary-iOS)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

ConnectSDK-CompanionLibrary-iOS is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "ConnectSDK-CompanionLibrary-iOS"
```

## Author

Amine Bezzarga, abezzarg@gmail.com

## License

ConnectSDK-CompanionLibrary-iOS is available under the Apache license. See the LICENSE file for more info.


text:
<template name="newQuestion">
	{{#contentWrapper}}

				{{#autoForm collection="Questions" id="insertQuestionForm" type="insert"}}
					{{> afQuickField name="question" autocomplete="off"}}
					{{#if isSpeechProject}}
						{{> afQuickField name="type" options="allowed"}}
					{{else}}
						{{> afQuickField name="type" firstOption="Question-Answer" disabled=true}}
					{{/if}}
					{{#if afFieldValueIs name="type" value="Vocable"}}
						{{> afQuickField name="answer" autocomplete="off"}}
					{{else}}
						{{> answerEditor}}
			  	{{/if}}

					<button type="submit" class="btn waves-effect blue accent-2">Submit</button>
				{{/autoForm}}

	{{/contentWrapper}}
</template>

<template name="newQuestionToolbar">

New Question

</template>


text:
namespace omaha {

// Test generation of int32 time values (which uses Time64ToInt32 internally).
TEST(TimeTest, SystemTimeToInt32NearEpoch) {
  // Try a simple value near the start of int32 time.
  SYSTEMTIME system_time = {1970,  // year
                            1,     // month (1 == January)
                            0,     // day of week (0 == Sunday)
                            2,     // day of month
                            0,     // hour
                            0,     // minute
                            0,     // second
                            0};    // msec
  system_time.wMilliseconds = 0;
  int32 time1 = SystemTimeToInt32(&system_time);
  system_time.wMilliseconds = 999;
  int32 time2 = SystemTimeToInt32(&system_time);

  // Make sure result is independent of milliseconds value.
  ASSERT_EQ(time1, time2);

  // 00:00:00 on 1970/01/02 should return the number of seconds in 1 day.
  ASSERT_EQ(time1, (60*60*24));
}

// Test an empirical value taken from running dumpbin.exe on a DLL.
// (IMPORTANT: ran this *after* setting machine's time zone to GMT,
//  without daylight savings).
// 40AEE7AA time date stamp Sat May 22 05:39:54 2004
TEST(TimeTest, SystemTimeToInt32) {
  SYSTEMTIME system_time = {2004, 5, 6, 22, 5, 39, 54, 0};
  int32 time = SystemTimeToInt32(&system_time);
  ASSERT_EQ(time, 0x40AEE7AA);
}

// Test conversion between int32 and time64 values.
// By testing SystemTimeToInt32 above, we've already checked Time64ToInt32
// against empirical values, so it's okay to simply test back-and-forth
// conversion here.
TEST(TimeTest, Conversion) {
  // Simple checks when starting with int32 values, because time64 has more
  // precision.
  ASSERT_EQ(Time64ToInt32(Int32ToTime64(0x12345678)), 0x12345678);
  ASSERT_EQ(Time64ToInt32(Int32ToTime64(INT_MAX)), INT_MAX);
  ASSERT_EQ(Time64ToInt32(Int32ToTime64(0)), 0);

  // Extra conversions when going opposite direction because int32 has less
  // precision.
  ASSERT_EQ(Int32ToTime64(Time64ToInt32(Int32ToTime64(0x12345678))),
            Int32ToTime64(0x12345678));
  ASSERT_EQ(Int32ToTime64(Time64ToInt32(Int32ToTime64(INT_MAX))),
            Int32ToTime64(INT_MAX));
  ASSERT_EQ(Int32ToTime64(Time64ToInt32(Int32ToTime64(0))),
            Int32ToTime64(0));
}

void TimeToStringTest(FILETIME *ft, bool daylight_savings_time) {
  CTime t(*ft, daylight_savings_time);
  CString date1(t.FormatGmt(_T("%a, %d %b %Y %H:%M:%S GMT")));
  CString date2(ConvertTimeToGMTString(ft));

  ASSERT_STREQ(date1, date2);
}

// Disabling this test since TimeTest.TimeToStringTest is broken on VS2015.
// https://github.com/google/omaha/issues/74
TEST(TimeTest, DISABLED_TimeToStringTest) {
  bool daylight_savings_time = false;
  TIME_ZONE_INFORMATION tz;
  if (GetTimeZoneInformation(&tz) == TIME_ZONE_ID_DAYLIGHT) {
    daylight_savings_time = true;
  }

  FILETIME file_time;
  ::GetSystemTimeAsFileTime(&file_time);
  TimeToStringTest(&file_time, daylight_savings_time);

  uint64 t = FileTimeToTime64(file_time);

  // months
  for (int i = 0; i < 13; i++) {
    t += (24 * kHoursTo100ns) * 28;
    Time64ToFileTime(t, &file_time);
    TimeToStringTest(&file_time, daylight_savings_time);
  }

  // days
  for (int i = 0; i < 30; i++) {
    t += (24 * kHoursTo100ns);
    Time64ToFileTime(t, &file_time);
    TimeToStringTest(&file_time, daylight_savings_time);
  }

  // hours
  for (int i = 0; i < 24; i++) {
    t += (24 * kHoursTo100ns);
    Time64ToFileTime(t, &file_time);
    TimeToStringTest(&file_time, daylight_savings_time);
  }
}

TEST(TimeTest, RFC822TimeParsing) {
  SYSTEMTIME time = {0};
  ASSERT_TRUE(RFC822DateToSystemTime(_T("Mon, 16 May 2005 15:44:18 -0700"),
                                     &time,
                                     false));
  ASSERT_EQ(time.wYear , 2005);
  ASSERT_EQ(time.wMonth , 5);
  ASSERT_EQ(time.wDay , 16);
  ASSERT_EQ(time.wHour , 22);
  ASSERT_EQ(time.wMinute , 44);
  ASSERT_EQ(time.wSecond , 18);

  ASSERT_TRUE(RFC822DateToSystemTime(_T("Mon, 16 May 2005 15:44:18 -0700"),
                                     &time,
                                     true));
  ASSERT_EQ(time.wYear , 2005);
  ASSERT_EQ(time.wMonth , 5);
  ASSERT_EQ(time.wDay , 16);
  ASSERT_TRUE(time.wHour == 15 || time.wHour == 14);  // daylight saving time
  ASSERT_EQ(time.wMinute , 44);
  ASSERT_EQ(time.wSecond , 18);

  ASSERT_TRUE(RFC822DateToSystemTime(_T("Tue, 17 May 2005 02:56:18 +0400"),
                                     &time,
                                     false));
  ASSERT_EQ(time.wYear , 2005);
  ASSERT_EQ(time.wMonth , 5);
  ASSERT_EQ(time.wDay , 16);
  ASSERT_EQ(time.wHour , 22);
  ASSERT_EQ(time.wMinute , 56);
  ASSERT_EQ(time.wSecond , 18);

  ASSERT_TRUE(RFC822DateToSystemTime(_T("Tue, 17 May 2005 02:56:18 +0400"),
                                     &time,
                                     true));
  ASSERT_EQ(time.wYear , 2005);
  ASSERT_EQ(time.wMonth , 5);
  ASSERT_EQ(time.wDay , 16);
  ASSERT_TRUE(time.wHour == 15 || time.wHour == 14);  // daylight saving time
  ASSERT_EQ(time.wMinute , 56);
  ASSERT_EQ(time.wSecond , 18);
}

TEST(TimeTest, FileTimeToInt64) {
  {
  FILETIME file_time = {0};
  EXPECT_EQ(0, FileTimeToInt64(file_time));
  }

  {
  FILETIME file_time = {LONG_MAX, 0};
  EXPECT_EQ(LONG_MAX, FileTimeToInt64(file_time));
  }

  {
  FILETIME file_time = {ULONG_MAX, 0};
  EXPECT_EQ(ULONG_MAX, FileTimeToInt64(file_time));
  }

  {
  FILETIME file_time = {ULONG_MAX, LONG_MAX};
  EXPECT_EQ(kint64max, FileTimeToInt64(file_time));
  }

  {
  FILETIME file_time = {ULONG_MAX, ULONG_MAX};
  EXPECT_EQ(0, FileTimeToInt64(file_time));
  }
}

}  // namespace omaha


text:
'use strict';

const msRest = require('ms-rest');
const msRestAzure = require('ms-rest-azure');
const WebResource = msRest.WebResource;

/**
 * Gets all of the available subnet delegations for this resource group in this
 * region.
 *
 * @param {string} location The location of the domain name.
 *
 * @param {string} resourceGroupName The name of the resource group.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link AvailableDelegationsResult} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _list(location, resourceGroupName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let apiVersion = '2019-02-01';
  // Validate
  try {
    if (location === null || location === undefined || typeof location.valueOf() !== 'string') {
      throw new Error('location cannot be null or undefined and it must be of type string.');
    }
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations';
  requestUrl = requestUrl.replace('{location}', encodeURIComponent(location));
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['AvailableDelegationsResult']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Gets all of the available subnet delegations for this resource group in this
 * region.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link AvailableDelegationsResult} for more
 *                      information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['AvailableDelegationsResult']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/** Class representing a AvailableResourceGroupDelegations. */
class AvailableResourceGroupDelegations {
  /**
   * Create a AvailableResourceGroupDelegations.
   * @param {NetworkManagementClient} client Reference to the service client.
   */
  constructor(client) {
    this.client = client;
    this._list = _list;
    this._listNext = _listNext;
  }

  /**
   * Gets all of the available subnet delegations for this resource group in this
   * region.
   *
   * @param {string} location The location of the domain name.
   *
   * @param {string} resourceGroupName The name of the resource group.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<AvailableDelegationsResult>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listWithHttpOperationResponse(location, resourceGroupName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._list(location, resourceGroupName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Gets all of the available subnet delegations for this resource group in this
   * region.
   *
   * @param {string} location The location of the domain name.
   *
   * @param {string} resourceGroupName The name of the resource group.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {AvailableDelegationsResult} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link AvailableDelegationsResult} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  list(location, resourceGroupName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._list(location, resourceGroupName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._list(location, resourceGroupName, options, optionalCallback);
    }
  }

  /**
   * Gets all of the available subnet delegations for this resource group in this
   * region.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<AvailableDelegationsResult>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Gets all of the available subnet delegations for this resource group in this
   * region.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {AvailableDelegationsResult} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link AvailableDelegationsResult} for more
   *                      information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listNext(nextPageLink, options, optionalCallback);
    }
  }

}

module.exports = AvailableResourceGroupDelegations;


text:
// This file was automatically generated from handlers.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace relief.handlers.templates.
 */

goog.provide('relief.handlers.templates');

goog.require('soy');
goog.require('soydata');

/**
 * @param {Object.<string, *>=} opt_data
 * @param {(null|undefined)=} opt_ignored
 * @return {string}
 * @suppress {checkTypes|uselessCode}
 */
relief.handlers.templates.genericError = function(opt_data, opt_ignored) {
  return '

' + soy.$$escapeHtml(opt_data.header) + '

' + soy.$$escapeHtml(opt_data.details) + '

';
};
if (goog.DEBUG) {
  relief.handlers.templates.genericError.soyTemplateName = 'relief.handlers.templates.genericError';
}


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Ciudad\Bundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Description of Ciudad
 *
 * @author montillajcx
 */
/**
* @ORM\Entity
* @ORM\Table(name="Cupon_Ciudad")
*/
class Ciudad {

    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue
     */
    protected $id;
    /** @ORM\Column(type="string", length=100) */
    protected $nombre;
    /** @ORM\Column(type="string", length=100) */
    protected $slug;

    public function getId()
    {
        return $this->id;
    }
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;
    }
    public function getNombre()
    {
        return $this->nombre;
    }
    public function setSlug($slug)
    {
        $this->slug = $slug;
    }
    public function getSlug()
    {
        return $this->slug;
    }
    public function __toString()
    {
        return $this->getNombre();
    }
}


text:
{{ model.title }}

    {{ model.description }}

    <button class="btn btn-primary" ng-click="$close()">Yes</button>
    <button class="btn btn-warning" ng-click="$dismiss()">No</button>


text:
/* Sets a nice gradient for the body */
body {
    padding-top: 50px;
    background: #085078; /* fallback for old browsers */
    background: -webkit-linear-gradient(to left, #085078 , #85D8CE); /* Chrome 10-25, Safari 5.1-6 */
    background: linear-gradient(to left, #085078 , #85D8CE); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

}

.starter-template {
    padding: 40px 15px;
    text-align: center;
}


text:
<?php

class TestAssets extends WP_UnitTestCase {

	function setUp() {
		parent::setUp();
		pmp_register_assets();
	}

	function test_pmp_enqueue_assets_pmp_search() {
		// The page variable must be set for `pmp_enqueue_assets` to work
		$_GET['page'] = 'pmp-search';

		pmp_enqueue_assets();

		global $wp_styles, $wp_scripts;
		$this->assertTrue(!empty($wp_styles->registered['pmp-common']));
		$this->assertTrue(!empty($wp_scripts->registered['pmp-search']));
	}

	function test_pmp_enqueue_assets_pmp_groups_menu() {
		// The page variable must be set for `pmp_enqueue_assets` to work
		$_GET['page'] = 'pmp-groups-menu';

		pmp_enqueue_assets();

		global $wp_styles, $wp_scripts;
		$this->assertTrue(!empty($wp_styles->registered['pmp-common']));
		$this->assertTrue(!empty($wp_scripts->registered['pmp-groups-menu']));
	}

	function test_pmp_enqueue_assets_pmp_series_properties_menu() {
		// The page variable must be set for `pmp_enqueue_assets` to work
		$_GET['page'] = 'pmp-series-menu';

		pmp_enqueue_assets();

		global $wp_styles, $wp_scripts;
		$this->assertTrue(!empty($wp_styles->registered['pmp-common']));
		$this->assertTrue(!empty($wp_scripts->registered['pmp-collections-menu']));
	}

	function test_pmp_enqueue_assets_pmp_options_menu() {
		// The page variable must be set for `pmp_enqueue_assets` to work
		$_GET['page'] = 'pmp-options-menu';

		pmp_enqueue_assets();

		global $wp_styles, $wp_scripts;
		$this->assertTrue(!empty($wp_scripts->registered['pmp-options-menu']));
	}

	function test_pmp_modal_underscore_template() {
		// TODO: this isn't a very good test.
		$this->expectOutputRegex('/id="pmp-modal-tmpl"/');
		pmp_modal_underscore_template();
	}

	function test_pmp_save_search_query_template() {
		// TODO: this isn't a very good test.
		$this->expectOutputRegex('/id="pmp-save-query-tmpl"/');
		pmp_save_search_query_template();
	}

	function test_pmp_async_select_template() {
		$this->markTestIncomplete('This test has not been implemented yet.');
	}

	function test_pmp_json_obj() {
		$pmp_obj = pmp_json_obj(array('test_key' => 'test value'));

		$this->assertEquals($pmp_obj['test_key'], 'test value');
		$this->assertTrue(!empty($pmp_obj['creators']));
		$this->assertTrue(!empty($pmp_obj['ajax_nonce']));
	}

}


text:
(function() {

var localStorage = {}, sessionStorage = {};
try { localStorage = window.localStorage; } catch (e) { }
try { sessionStorage = window.sessionStorage; } catch (e) { }

function createSourceLinks() {
    $('.method_details_list .source_code').
        before("[View source]");
    $('.toggleSource').toggle(function() {
       $(this).parent().nextAll('.source_code').slideDown(100);
       $(this).text("Hide source");
    },
    function() {
        $(this).parent().nextAll('.source_code').slideUp(100);
        $(this).text("View source");
    });
}

function createDefineLinks() {
    var tHeight = 0;
    $('.defines').after(" more...");
    $('.toggleDefines').toggle(function() {
        tHeight = $(this).parent().prev().height();
        $(this).prev().css('display', 'inline');
        $(this).parent().prev().height($(this).parent().height());
        $(this).text("(less)");
    },
    function() {
        $(this).prev().hide();
        $(this).parent().prev().height(tHeight);
        $(this).text("more...");
    });
}

function createFullTreeLinks() {
    var tHeight = 0;
    $('.inheritanceTree').toggle(function() {
        tHeight = $(this).parent().prev().height();
        $(this).parent().toggleClass('showAll');
        $(this).text("(hide)");
        $(this).parent().prev().height($(this).parent().height());
    },
    function() {
        $(this).parent().toggleClass('showAll');
        $(this).parent().prev().height(tHeight);
        $(this).text("show all");
    });
}

function searchFrameButtons() {
  $('.full_list_link').click(function() {
    toggleSearchFrame(this, $(this).attr('href'));
    return false;
  });
  window.addEventListener('message', function(e) {
    if (e.data === 'navEscape') {
      $('#search_frame').slideUp(100);
      $('#search a').removeClass('active inactive');
      $(window).focus();
    }
  });

  $(window).resize(function() {
    if ($('#search:visible').length === 0) {
      $('#search_frame').slideUp(100);
      $('#search a').removeClass('active inactive');
      $(window).focus();
    }
  });
}

function toggleSearchFrame(id, link) {
  var frame = $('#search_frame');
  $('#search a').removeClass('active').addClass('inactive');
  if (frame.attr('src') === link && frame.css('display') !== "none") {
    frame.slideUp(100);
    $('#search a').removeClass('active inactive');
  }
  else {
    $(id).addClass('active').removeClass('inactive');
    if (frame.attr('src') !== link) frame.attr('src', link);
    frame.slideDown(100);
  }
}

function linkSummaries() {
  $('.summary_signature').click(function() {
    document.location = $(this).find('a').attr('href');
  });
}

function summaryToggle() {
  $('.summary_toggle').click(function(e) {
    e.preventDefault();
    localStorage.summaryCollapsed = $(this).text();
    $('.summary_toggle').each(function() {
      $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
      var next = $(this).parent().parent().nextAll('ul.summary').first();
      if (next.hasClass('compact')) {
        next.toggle();
        next.nextAll('ul.summary').first().toggle();
      }
      else if (next.hasClass('summary')) {
        var list = $('
');
        list.html(next.html());
        list.find('.summary_desc, .note').remove();
        list.find('a').each(function() {
          $(this).html($(this).find('strong').html());
          $(this).parent().html($(this)[0].outerHTML);
        });
        next.before(list);
        next.toggle();
      }
    });
    return false;
  });
  if (localStorage.summaryCollapsed == "collapse") {
    $('.summary_toggle').first().click();
  } else { localStorage.summaryCollapsed = "expand"; }
}

function generateTOC() {
  if ($('#filecontents').length === 0) return;
  var _toc = $('

');
  var show = false;
  var toc = _toc;
  var counter = 0;
  var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
  var i;
  if ($('#filecontents h1').length > 1) tags.unshift('h1');
  for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
  var lastTag = parseInt(tags[0][1], 10);
  $(tags.join(', ')).each(function() {
    if ($(this).parents('.method_details .docstring').length != 0) return;
    if (this.id == "filecontents") return;
    show = true;
    var thisTag = parseInt(this.tagName[1], 10);
    if (this.id.length === 0) {
      var proposedId = $(this).attr('toc-id');
      if (typeof(proposedId) != "undefined") this.id = proposedId;
      else {
        var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
        if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
        this.id = proposedId;
      }
    }
    if (thisTag > lastTag) {
      for (i = 0; i < thisTag - lastTag; i++) {
        var tmp = $('
'); toc.append(tmp); toc = tmp;
      }
    }
    if (thisTag < lastTag) {
      for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
    }
    var title = $(this).attr('toc-title');
    if (typeof(title) == "undefined") title = $(this).text();
    toc.append('
' + title + '
');
    lastTag = thisTag;
  });
  if (!show) return;
  html = '

Table of Contents

';
  $('#content').prepend(html);
  $('#toc').append(_toc);
  $('#toc .hide_toc').toggle(function() {
    $('#toc .top').slideUp('fast');
    $('#toc').toggleClass('hidden');
    $('#toc .title small').toggle();
  }, function() {
    $('#toc .top').slideDown('fast');
    $('#toc').toggleClass('hidden');
    $('#toc .title small').toggle();
  });
}

function navResizeFn(e) {
  if (e.which !== 1) {
    navResizeFnStop();
    return;
  }

  sessionStorage.navWidth = e.pageX.toString();
  $('.nav_wrap').css('width', e.pageX);
  $('.nav_wrap').css('-ms-flex', 'inherit');
}

function navResizeFnStop() {
  $(window).unbind('mousemove', navResizeFn);
  window.removeEventListener('message', navMessageFn, false);
}

function navMessageFn(e) {
  if (e.data.action === 'mousemove') navResizeFn(e.data.event);
  if (e.data.action === 'mouseup') navResizeFnStop();
}

function navResizer() {
  $('#resizer').mousedown(function(e) {
    e.preventDefault();
    $(window).mousemove(navResizeFn);
    window.addEventListener('message', navMessageFn, false);
  });
  $(window).mouseup(navResizeFnStop);

  if (sessionStorage.navWidth) {
    navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)});
  }
}

function navExpander() {
  var done = false, timer = setTimeout(postMessage, 500);
  function postMessage() {
    if (done) return;
    clearTimeout(timer);
    var opts = { action: 'expand', path: pathId };
    document.getElementById('nav').contentWindow.postMessage(opts, '*');
    done = true;
  }

  window.addEventListener('message', function(event) {
    if (event.data === 'navReady') postMessage();
    return false;
  }, false);
}

function mainFocus() {
  $('#main')[0].focus();
}

$(document).ready(function() {
  navResizer();
  navExpander();
  createSourceLinks();
  createDefineLinks();
  createFullTreeLinks();
  searchFrameButtons();
  linkSummaries();
  summaryToggle();
  generateTOC();
  mainFocus();
});

})();


text:
using System;
using UPT.BOT.Dominio.Entidades.Shared;

namespace UPT.BOT.Dominio.Entidades.BOT
{
    public class MensajeEntity : IEstadoObjeto
    {
        public long CodigoMensaje { get; set; }
        public string CodigoCliente { get; set; }
        public string DescripcionActividad { get; set; }
        public string DescripcionCanal { get; set; }
        public string DescripcionLocalidad { get; set; }
        public string DescripcionServicio { get; set; }
        public string DescripcionContenido { get; set; }
        public string DescripcionTipoContenido { get; set; }
        public string DescripcionIntencion { get; set; }
        public decimal PorIntencion { get; set; }
        public DateTime? FechaMensaje { get; set; }
        public EstadoObjeto EstadoObjeto { get; set; }

        public MensajeEntity()
        {

        }

        public static MensajeEntity Crear(
            string codigoCliente
            , string descripcionActividad
            , string descripcionCanal
            , string descripcionLocalidad
            , string descripcionServicio
            , string descripcionContenido
            , string descripcionTipoContenido
            , string descripcionIntencion
            , decimal porcentajeIntencion
            , DateTime fechaMensaje)
        {
            return new MensajeEntity
            {
                CodigoCliente = codigoCliente,
                DescripcionActividad = descripcionActividad,
                DescripcionCanal = descripcionCanal,
                DescripcionLocalidad = descripcionLocalidad,
                DescripcionServicio = descripcionServicio,
                DescripcionContenido = descripcionContenido,
                DescripcionTipoContenido = descripcionTipoContenido,
                DescripcionIntencion = descripcionIntencion,
                PorIntencion = porcentajeIntencion,
                FechaMensaje = fechaMensaje,
                EstadoObjeto = EstadoObjeto.Nuevo
            };
        }
    }
}


text:
CREATE TABLE [dbo].[LINK_LINK_CHANGE_ACTIONS]
(
	Id bigint identity(1,1) NOT NULL primary key,
	SessionGroupUniqueId uniqueidentifier NOT NULL,
	SessionUniqueId uniqueidentifier NOT NULL,
	SourceId uniqueidentifier NOT NULL,
	ActionId uniqueidentifier NOT NULL,
	ArtifactLinkId int NOT NULL,
	--IsDeferred bit NOT NULL,
	Status int NOT NULL, -- 1: DeltaComputed; 2. Translated; 3. ReadyForMigration; 4. Completed
	LinkChangeGroupId bigint NULL,
	ExecutionOrder int NULL,
	Conflicted bit NOT NULL
);


text:
'use strict';

/**
 * Module dependencies.
 */

var Runnable = require('./runnable');
var create = require('lodash.create');
var isString = require('./utils').isString;

/**
 * Expose `Test`.
 */

module.exports = Test;

/**
 * Initialize a new `Test` with the given `title` and callback `fn`.
 *
 * @api private
 * @param {String} title
 * @param {Function} fn
 */
function Test (title, fn) {
  if (!isString(title)) {
    throw new Error('Test `title` should be a "string" but "' + typeof title + '" was given instead.');
  }
  Runnable.call(this, title, fn);
  this.pending = !fn;
  this.type = 'test';
}

/**
 * Inherit from `Runnable.prototype`.
 */
Test.prototype = create(Runnable.prototype, {
  constructor: Test
});

Test.prototype.clone = function () {
  var test = new Test(this.title, this.fn);
  test.timeout(this.timeout());
  test.slow(this.slow());
  test.enableTimeouts(this.enableTimeouts());
  test.retries(this.retries());
  test.currentRetry(this.currentRetry());
  test.globals(this.globals());
  test.parent = this.parent;
  test.file = this.file;
  test.ctx = this.ctx;
  return test;
};