text:
nark
====

Nark is an alerting and dashboard frontend for graphite.

##Targets
In Nark, one can use all the syntax that Graphite understands. In addition to this, Nark understands additional syntax that makes viewing dashboards more convenient. The following section describes how to use this functionality in a declaring targets.

###Variables
Nark targets can include variables. These are represented as text inputs in the dashboard view An example of how this can be helpful is when a dashboard should allow viewers to select a particular server to view.

A variable should be placed between two % signs. The variable name can be optionally followed by a default value, specified using an = sign.

      ex.   stats.counters.servers.%variable-name=default-value%.requests.count

When creating additional targets and graphs, using the same variable name will result in the targets sharing the same value for that variable across the dashboard. The default value of the variable will be the first default value declared by a target. Thus, it is only necessary to provide a default value the first time a target declares the variable.

###Options
Nark targets can also include options. An option provides a variable with a set of acceptable values. Options are represented in the dashboard view as a dropdown menu.

An option should be declared between two % signs. The variable name is followed by | sign and value pairs.

      ex.   stats.%type|counters|gauges|timers%.servers.10-0-33-33.requests.count

When creating additional targets and graphs, using the same option name will result in targets sharing the same value across the dashboard. The values in the dropdown menu are the union of all values declared for that option in all targets. If a target can simply use the values of options declared elsewhere, simple put a | sign after the variable name.

      ex.   stats.%type|%.servers.10-0-33-33.requests.count (will inherit the values for 'type' declared in other targets)


text:
using System;
using Microsoft.AspNet.Razor.Parser;
using Microsoft.AspNet.Razor.Parser.SyntaxTree;

namespace Microsoft.AspNet.Razor.Generator
{
    public abstract class RazorCodeGenerator : ParserVisitor
    {
        private CodeGeneratorContext _context;

        protected RazorCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host)
        {
            if (String.IsNullOrEmpty(className))
            {
                throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "className");
            }
            if (rootNamespaceName == null)
            {
                throw new ArgumentNullException("rootNamespaceName");
            }
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            ClassName = className;
            RootNamespaceName = rootNamespaceName;
            SourceFileName = sourceFileName;
            GenerateLinePragmas = String.IsNullOrEmpty(SourceFileName) ? false : true;
            Host = host;
        }

        // Data pulled from constructor
        public string ClassName { get; private set; }
        public string RootNamespaceName { get; private set; }
        public string SourceFileName { get; private set; }
        public RazorEngineHost Host { get; private set; }

        // Generation settings
        public bool GenerateLinePragmas { get; set; }
        public bool DesignTimeMode { get; set; }

        public CodeGeneratorContext Context
        {
            get
            {
                EnsureContextInitialized();
                return _context;
            }
        }

        public override void VisitStartBlock(Block block)
        {
            block.CodeGenerator.GenerateStartBlockCode(block, Context);
        }

        public override void VisitEndBlock(Block block)
        {
            block.CodeGenerator.GenerateEndBlockCode(block, Context);
        }

        public override void VisitSpan(Span span)
        {
            span.CodeGenerator.GenerateCode(span, Context);
        }

        private void EnsureContextInitialized()
        {
            if (_context == null)
            {
                _context = CodeGeneratorContext.Create(Host, ClassName, RootNamespaceName, SourceFileName, GenerateLinePragmas);
                Initialize(_context);
            }
        }

        protected virtual void Initialize(CodeGeneratorContext context)
        {
        }
    }
}

redpajama_set_name: RedPajamaGithub


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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>vicnode</groupId>
	<artifactId>daris-vicnode</artifactId>
	<version>1.1.0</version>
	<packaging>jar</packaging>
	<name>daris-vicnode</name>
	<url>https://github.com/vicnode/daris-vicnode</url>
	<description>DaRIS domain specific addon package for VicNode.</description>
	<organization>
		<name>VicNode</name>
		<url>https://daris.vicnode.org.au</url>
	</organization>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.7</maven.compiler.source>
		<maven.compiler.target>1.7</maven.compiler.target>
		<maven.build.timestamp.format>dd-MMM-yyyy HH:mm:ss z</maven.build.timestamp.format>
		<require.mflux.version>4.2.033</require.mflux.version>
	</properties>
	<!-- DaRIS maven repository on github.com -->
	<repositories>
		<repository>
			<id>daris-maven-repo</id>
			<name>DaRIS maven repository on github.com</name>
			<url>https://github.com/uom-daris/mvn-repo/raw/master</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>com.arcitecta</groupId>
			<artifactId>aplugin</artifactId>
			<version>4.4.011</version>
			<!-- provided so that we do not deploy -->
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>au.edu.unimelb.daris</groupId>
			<artifactId>daris-commons</artifactId>
			<version>1.1.0</version>
			<!-- provided so that we do not deploy -->
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<!-- maven-replacer-plugin -->
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.3</version>
				<executions>
					<execution>
						<id>manifest_xml</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<file>${project.basedir}/src/main/mfpkg/__manifest.xml</file>
							<outputFile>${project.build.directory}/__manifest.xml</outputFile>
							<regex>false</regex>
							<replacements>
								<replacement>
									<token>@MFPKG@</token>
									<value>${project.artifactId}</value>
								</replacement>
								<replacement>
									<token>@VERSION@</token>
									<value>${project.version}</value>
								</replacement>
								<replacement>
									<token>@BUILD-TIME@</token>
									<value>${maven.build.timestamp}</value>
								</replacement>
								<replacement>
									<token>@VENDOR@</token>
									<value>${project.organization.name}</value>
								</replacement>
								<replacement>
									<token>@URL@</token>
									<value>${project.organization.url}</value>
								</replacement>
								<replacement>
									<token>@DESCRIPTION@</token>
									<value>${project.description}</value>
								</replacement>
								<replacement>
									<token>@SERVER-VERSION@</token>
									<value>${require.mflux.version}</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
					<!--
					<execution>
						<id>tcl_files</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
						<configuration>
							<basedir>${project.basedir}/src/main/mfpkg</basedir>
							<outputBasedir>${project.build.directory}</outputBasedir>
							<outputDir>.</outputDir>
							<includes>
								<include>__install.tcl</include>
								<include>__uninstall.tcl</include>
							</includes>
							<regex>false</regex>
							<replacements>
								<replacement>
									<token>@ORG@</token>
									<value>${org.name.short}</value>
								</replacement>
								<replacement>
									<token>@PKG@</token>
									<value>${java.package}</value>
								</replacement>
								<replacement>
									<token>@ARTIFACT_ID@</token>
									<value>${project.artifactId}</value>
								</replacement>
								<replacement>
									<token>@VERSION@</token>
									<value>${project.version}</value>
								</replacement>
							</replacements>
						</configuration>
					</execution>
					-->
				</executions>
			</plugin>
			<!-- maven-assembly-plugin -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.5.4</version>
				<executions>
					<execution>
						<!-- make plugin jar -->
						<id>plugin-jar</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<finalName>${project.artifactId}-plugin</finalName>
							<descriptors>
								<descriptor>src/main/assembly/plugin-jar.xml</descriptor>
							</descriptors>
							<attach>false</attach>
						</configuration>
					</execution>
					<execution>
						<!-- make plugin zip -->
						<id>plugin-zip</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<finalName>${project.artifactId}-plugin</finalName>
							<descriptors>
								<descriptor>src/main/assembly/plugin-zip.xml</descriptor>
							</descriptors>
							<attach>false</attach>
						</configuration>
					</execution>
					<execution>
						<!-- make mfpkg zip -->
						<id>mfpkg-zip</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<finalName>mfpkg-${project.artifactId}-${project.version}</finalName>
							<descriptors>
								<descriptor>src/main/assembly/mfpkg-zip.xml</descriptor>
							</descriptors>
							<attach>false</attach>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
const path = require('path')

module.exports = {
  env: require('./env'),
  assetBuildPath: path.resolve(__dirname, '..', '..', 'build')
}


text:
package com.google.cloud.broker.apps.brokerserver.accesstokens.providers;

import java.io.IOException;
import java.util.List;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ImpersonatedCredentials;
import io.grpc.Status;

import com.google.cloud.broker.apps.brokerserver.accesstokens.AccessToken;

public class ServiceAccountProvider extends AbstractProvider {

    @Override
    public AccessToken getAccessToken(String googleIdentity, List<String> scopes) {
        if (! googleIdentity.endsWith(".iam.gserviceaccount.com")) {
            throw new IllegalArgumentException("Google identity `" + googleIdentity + "` is not a service account");
        }
        try {
            GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();
            ImpersonatedCredentials impersonatedCredentials = ImpersonatedCredentials.create(credentials, googleIdentity, null, scopes, 3600);
            com.google.auth.oauth2.AccessToken token = impersonatedCredentials.refreshAccessToken();
            return new AccessToken(token.getTokenValue(), token.getExpirationTime().getTime());
        } catch (IOException e) {
            throw Status.PERMISSION_DENIED.asRuntimeException();
        }
    }

}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class User extends CI_Model {

    function __construct()
    {
        parent::__construct();
    }

    public function checkLogin($email, $password)
    {
    	$this->db->select('*')
		  		 ->from('users')
                 ->where('email', $email)
				 ->where('password', $password);
		$query = $this->db->get();
    	return $query->result();
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

  login
  GVoice

  GVoice

Searching...

No Matches


text:
package com.daedafusion.knowledge.trinity.triples.query;

import com.daedafusion.knowledge.trinity.QueryException;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.TripleMatch;
import com.hp.hpl.jena.graph.impl.GraphBase;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;
import org.apache.log4j.Logger;

import java.io.IOException;
import java.util.Iterator;

/**
 * Created by mphilpot on 7/8/14.
 */
public class JenaAdapter extends GraphBase
{
    private static final Logger log = Logger.getLogger(JenaAdapter.class);

    private QueryContext context;

    @Override
    protected ExtendedIterator<Triple> graphBaseFind(TripleMatch tm)
    {
        try
        {
            // this is very odd behavior -- clean up a bit
            return context.find(
                    tm.getMatchSubject() != null ? tm.getMatchSubject() : ((Triple)tm).getSubject(),
                    tm.getMatchPredicate() != null ? tm.getMatchPredicate() : ((Triple)tm).getPredicate(),
                    tm.getMatchObject() != null ? tm.getMatchObject() : ((Triple)tm).getObject());
        }
        catch (IOException e)
        {
            log.error("", e);
            throw new QueryException(e);
        }
    }

    public void init(QueryContext context)
    {
        this.context = context;
    }

}


text:
package org.yeastrc.www.philiusws;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each Java content interface and Java
 * element interface generated in the org.yeastrc.www.philiusws package.
 * <p>
 * An ObjectFactory allows you to programatically construct new instances of the
 * Java representation for XML content. The Java representation of XML content
 * can consist of schema derived interfaces and classes representing the binding
 * of schema type definitions, element declarations and model groups. Factory
 * methods for each of these are provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

	private final static QName _IsJobDoneResponse_QNAME = new QName(
			"http://ws.philius.yeastrc.org/", "isJobDoneResponse");
	private final static QName _GetResults_QNAME = new QName(
			"http://ws.philius.yeastrc.org/", "getResults");
	private final static QName _GetResultsResponse_QNAME = new QName(
			"http://ws.philius.yeastrc.org/", "getResultsResponse");
	private final static QName _PhiliusWSException_QNAME = new QName(
			"http://ws.philius.yeastrc.org/", "PhiliusWSException");
	private final static QName _SubmitSequenceResponse_QNAME = new QName(
			"http://ws.philius.yeastrc.org/", "submitSequenceResponse");
	private final static QName _SubmitSequence_QNAME = new QName(
			"http://ws.philius.yeastrc.org/", "submitSequence");
	private final static QName _IsJobDone_QNAME = new QName(
			"http://ws.philius.yeastrc.org/", "isJobDone");

	/**
	 * Create a new ObjectFactory that can be used to create new instances of
	 * schema derived classes for package: org.yeastrc.www.philiusws
	 *
	 */
	public ObjectFactory() {
	}

	/**
	 * Create an instance of {@link IsJobDone }
	 *
	 */
	public IsJobDone createIsJobDone() {
		return new IsJobDone();
	}

	/**
	 * Create an instance of {@link PhiliusSequenceAnnotationWS }
	 *
	 */
	public PhiliusSequenceAnnotationWS createPhiliusSequenceAnnotationWS() {
		return new PhiliusSequenceAnnotationWS();
	}

	/**
	 * Create an instance of {@link IsJobDoneResponse }
	 *
	 */
	public IsJobDoneResponse createIsJobDoneResponse() {
		return new IsJobDoneResponse();
	}

	/**
	 * Create an instance of {@link PhiliusSPSegmentWS }
	 *
	 */
	public PhiliusSPSegmentWS createPhiliusSPSegmentWS() {
		return new PhiliusSPSegmentWS();
	}

	/**
	 * Create an instance of {@link GetResults }
	 *
	 */
	public GetResults createGetResults() {
		return new GetResults();
	}

	/**
	 * Create an instance of {@link PhiliusWSException }
	 *
	 */
	public PhiliusWSException createPhiliusWSException() {
		return new PhiliusWSException();
	}

	/**
	 * Create an instance of {@link PhiliusSegmentWS }
	 *
	 */
	public PhiliusSegmentWS createPhiliusSegmentWS() {
		return new PhiliusSegmentWS();
	}

	/**
	 * Create an instance of {@link GetResultsResponse }
	 *
	 */
	public GetResultsResponse createGetResultsResponse() {
		return new GetResultsResponse();
	}

	/**
	 * Create an instance of {@link SubmitSequenceResponse }
	 *
	 */
	public SubmitSequenceResponse createSubmitSequenceResponse() {
		return new SubmitSequenceResponse();
	}

	/**
	 * Create an instance of {@link SubmitSequence }
	 *
	 */
	public SubmitSequence createSubmitSequence() {
		return new SubmitSequence();
	}

	/**
	 * Create an instance of {@link JAXBElement }{@code <}
	 * {@link IsJobDoneResponse }{@code >}
	 *
	 */
	@XmlElementDecl(namespace = "http://ws.philius.yeastrc.org/", name = "isJobDoneResponse")
	public JAXBElement<IsJobDoneResponse> createIsJobDoneResponse(
			IsJobDoneResponse value) {
		return new JAXBElement<IsJobDoneResponse>(_IsJobDoneResponse_QNAME,
				IsJobDoneResponse.class, null, value);
	}

	/**
	 * Create an instance of {@link JAXBElement }{@code <}{@link GetResults }
	 * {@code >}
	 *
	 */
	@XmlElementDecl(namespace = "http://ws.philius.yeastrc.org/", name = "getResults")
	public JAXBElement<GetResults> createGetResults(GetResults value) {
		return new JAXBElement<GetResults>(_GetResults_QNAME, GetResults.class,
				null, value);
	}

	/**
	 * Create an instance of {@link JAXBElement }{@code <}
	 * {@link GetResultsResponse }{@code >}
	 *
	 */
	@XmlElementDecl(namespace = "http://ws.philius.yeastrc.org/", name = "getResultsResponse")
	public JAXBElement<GetResultsResponse> createGetResultsResponse(
			GetResultsResponse value) {
		return new JAXBElement<GetResultsResponse>(_GetResultsResponse_QNAME,
				GetResultsResponse.class, null, value);
	}

	/**
	 * Create an instance of {@link JAXBElement }{@code <}
	 * {@link PhiliusWSException }{@code >}
	 *
	 */
	@XmlElementDecl(namespace = "http://ws.philius.yeastrc.org/", name = "PhiliusWSException")
	public JAXBElement<PhiliusWSException> createPhiliusWSException(
			PhiliusWSException value) {
		return new JAXBElement<PhiliusWSException>(_PhiliusWSException_QNAME,
				PhiliusWSException.class, null, value);
	}

	/**
	 * Create an instance of {@link JAXBElement }{@code <}
	 * {@link SubmitSequenceResponse }{@code >}
	 *
	 */
	@XmlElementDecl(namespace = "http://ws.philius.yeastrc.org/", name = "submitSequenceResponse")
	public JAXBElement<SubmitSequenceResponse> createSubmitSequenceResponse(
			SubmitSequenceResponse value) {
		return new JAXBElement<SubmitSequenceResponse>(
				_SubmitSequenceResponse_QNAME, SubmitSequenceResponse.class,
				null, value);
	}

	/**
	 * Create an instance of {@link JAXBElement }{@code <}{@link SubmitSequence }
	 * {@code >}
	 *
	 */
	@XmlElementDecl(namespace = "http://ws.philius.yeastrc.org/", name = "submitSequence")
	public JAXBElement<SubmitSequence> createSubmitSequence(SubmitSequence value) {
		return new JAXBElement<SubmitSequence>(_SubmitSequence_QNAME,
				SubmitSequence.class, null, value);
	}

	/**
	 * Create an instance of {@link JAXBElement }{@code <}{@link IsJobDone }
	 * {@code >}
	 *
	 */
	@XmlElementDecl(namespace = "http://ws.philius.yeastrc.org/", name = "isJobDone")
	public JAXBElement<IsJobDone> createIsJobDone(IsJobDone value) {
		return new JAXBElement<IsJobDone>(_IsJobDone_QNAME, IsJobDone.class,
				null, value);
	}

}


text:
using System;

using Xunit;

namespace UnitTests.Random.DefaultClasses
{
    public class DateTimeGenerator
    {
        [Fact]
        public void Next()
        {
            Utilities.Random.DefaultClasses.DateTimeGenerator Generator = new Utilities.Random.DefaultClasses.DateTimeGenerator();
            Assert.InRange(Generator.Next(new System.Random()), DateTime.MinValue, DateTime.MaxValue);
            Assert.InRange(Generator.Next(new System.Random(), new DateTime(1900, 1, 1), new DateTime(2000, 1, 1)), new DateTime(1900, 1, 1), new DateTime(2000, 1, 1));
        }
    }
}


text:
using System;
using System.Collections.Generic;
using Azure.Core;

namespace Azure.ResourceManager.DataFactory.Models
{
    /// <summary> Azure Data Lake Storage Gen2 linked service. </summary>
    public partial class AzureBlobFSLinkedService : FactoryLinkedServiceDefinition
    {
        /// <summary> Initializes a new instance of AzureBlobFSLinkedService. </summary>
        /// <param name="uri"> Endpoint for the Azure Data Lake Storage Gen2 service. Type: string (or Expression with resultType string). </param>
        /// <exception cref="ArgumentNullException"> <paramref name="uri"/> is null. </exception>
        public AzureBlobFSLinkedService(BinaryData uri)
        {
            Argument.AssertNotNull(uri, nameof(uri));

            Uri = uri;
            LinkedServiceType = "AzureBlobFS";
        }

        /// <summary> Initializes a new instance of AzureBlobFSLinkedService. </summary>
        /// <param name="linkedServiceType"> Type of linked service. </param>
        /// <param name="connectVia"> The integration runtime reference. </param>
        /// <param name="description"> Linked service description. </param>
        /// <param name="parameters"> Parameters for linked service. </param>
        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
        /// <param name="additionalProperties"> Additional Properties. </param>
        /// <param name="uri"> Endpoint for the Azure Data Lake Storage Gen2 service. Type: string (or Expression with resultType string). </param>
        /// <param name="accountKey"> Account key for the Azure Data Lake Storage Gen2 service. Type: string (or Expression with resultType string). </param>
        /// <param name="servicePrincipalId"> The ID of the application used to authenticate against the Azure Data Lake Storage Gen2 account. Type: string (or Expression with resultType string). </param>
        /// <param name="servicePrincipalKey">
        /// The Key of the application used to authenticate against the Azure Data Lake Storage Gen2 account.
        /// Please note <see cref="FactorySecretBaseDefinition"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
        /// The available derived classes include <see cref="FactorySecretString"/> and <see cref="AzureKeyVaultSecretReference"/>.
        /// </param>
        /// <param name="tenant"> The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string). </param>
        /// <param name="azureCloudType"> Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions' cloud type. Type: string (or Expression with resultType string). </param>
        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). </param>
        /// <param name="credential"> The credential reference containing authentication information. </param>
        /// <param name="servicePrincipalCredentialType"> The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string). </param>
        /// <param name="servicePrincipalCredential">
        /// The credential of the service principal object in Azure Active Directory. If servicePrincipalCredentialType is 'ServicePrincipalKey', servicePrincipalCredential can be SecureString or AzureKeyVaultSecretReference. If servicePrincipalCredentialType is 'ServicePrincipalCert', servicePrincipalCredential can only be AzureKeyVaultSecretReference.
        /// Please note <see cref="FactorySecretBaseDefinition"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
        /// The available derived classes include <see cref="FactorySecretString"/> and <see cref="AzureKeyVaultSecretReference"/>.
        /// </param>
        internal AzureBlobFSLinkedService(string linkedServiceType, IntegrationRuntimeReference connectVia, string description, IDictionary<string, EntityParameterSpecification> parameters, IList<BinaryData> annotations, IDictionary<string, BinaryData> additionalProperties, BinaryData uri, BinaryData accountKey, BinaryData servicePrincipalId, FactorySecretBaseDefinition servicePrincipalKey, BinaryData tenant, BinaryData azureCloudType, BinaryData encryptedCredential, FactoryCredentialReference credential, BinaryData servicePrincipalCredentialType, FactorySecretBaseDefinition servicePrincipalCredential) : base(linkedServiceType, connectVia, description, parameters, annotations, additionalProperties)
        {
            Uri = uri;
            AccountKey = accountKey;
            ServicePrincipalId = servicePrincipalId;
            ServicePrincipalKey = servicePrincipalKey;
            Tenant = tenant;
            AzureCloudType = azureCloudType;
            EncryptedCredential = encryptedCredential;
            Credential = credential;
            ServicePrincipalCredentialType = servicePrincipalCredentialType;
            ServicePrincipalCredential = servicePrincipalCredential;
            LinkedServiceType = linkedServiceType ?? "AzureBlobFS";
        }

        /// <summary>
        /// Endpoint for the Azure Data Lake Storage Gen2 service. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData Uri { get; set; }
        /// <summary>
        /// Account key for the Azure Data Lake Storage Gen2 service. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData AccountKey { get; set; }
        /// <summary>
        /// The ID of the application used to authenticate against the Azure Data Lake Storage Gen2 account. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData ServicePrincipalId { get; set; }
        /// <summary>
        /// The Key of the application used to authenticate against the Azure Data Lake Storage Gen2 account.
        /// Please note <see cref="FactorySecretBaseDefinition"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
        /// The available derived classes include <see cref="FactorySecretString"/> and <see cref="AzureKeyVaultSecretReference"/>.
        /// </summary>
        public FactorySecretBaseDefinition ServicePrincipalKey { get; set; }
        /// <summary>
        /// The name or ID of the tenant to which the service principal belongs. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData Tenant { get; set; }
        /// <summary>
        /// Indicates the azure cloud type of the service principle auth. Allowed values are AzurePublic, AzureChina, AzureUsGovernment, AzureGermany. Default value is the data factory regions' cloud type. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData AzureCloudType { get; set; }
        /// <summary>
        /// The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData EncryptedCredential { get; set; }
        /// <summary> The credential reference containing authentication information. </summary>
        public FactoryCredentialReference Credential { get; set; }
        /// <summary>
        /// The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string).
        /// <para>
        /// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
        /// </para>
        /// <para>
        /// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
        /// </para>
        /// <para>
        /// Examples:
        /// <list type="bullet">
        /// <item>
        /// <term>BinaryData.FromObjectAsJson("foo")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("\"foo\"")</term>
        /// <description>Creates a payload of "foo".</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// <item>
        /// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
        /// <description>Creates a payload of { "key": "value" }.</description>
        /// </item>
        /// </list>
        /// </para>
        /// </summary>
        public BinaryData ServicePrincipalCredentialType { get; set; }
        /// <summary>
        /// The credential of the service principal object in Azure Active Directory. If servicePrincipalCredentialType is 'ServicePrincipalKey', servicePrincipalCredential can be SecureString or AzureKeyVaultSecretReference. If servicePrincipalCredentialType is 'ServicePrincipalCert', servicePrincipalCredential can only be AzureKeyVaultSecretReference.
        /// Please note <see cref="FactorySecretBaseDefinition"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
        /// The available derived classes include <see cref="FactorySecretString"/> and <see cref="AzureKeyVaultSecretReference"/>.
        /// </summary>
        public FactorySecretBaseDefinition ServicePrincipalCredential { get; set; }
    }
}


text:
[![npm Version](https://img.shields.io/npm/v/angular-contents.svg)](https://www.npmjs.com/package/angular-contents)
[![Build Status](https://travis-ci.org/zurfyx/angular-contents.svg?branch=master)](https://travis-ci.org/zurfyx/angular-contents)

> Angular Table of Contents that follow you while you scroll down.

## Demo

[zurfyx.github.io/angular-contents](https://zurfyx.github.io/angular-contents/)

## Install

```
npm install angular-contents
```

## Getting started

**If you are using Angular Material, you are most likely going to have to use [Scrolling View.](#full-scrolling-view)**

[my-module.module.ts](https://github.com/zurfyx/angular-contents/blob/master/example/app/app.module.ts)

```
import { ContentsModule } from 'angular-contents';

@NgModule({
  imports: [
    ...
    ContentsModule,
    ...
  ],
```

[my-module.component.ts](https://github.com/zurfyx/angular-contents/blob/master/example/app/default.component.ts)

∅

[my-module.component.html](https://github.com/zurfyx/angular-contents/blob/master/example/app/default.component.html)

```
<div class="columnify" contents>
  <!-- Body -->
  <div>
    <div [contentsSection]="'section-one'">
      <h1>Section One</h1>
      ...
    </div>

    <div [contentsSection]="'section-two'">
      <h1>Section Two</h1>
      ...
    </div>
  <!-- Table of Contents -->
  <div class="table-column">
    <ul class="contents-table" contentsTable>
      <li><a href="#section-one" contentsLink>Section One</a></li>
      <li><a href="#section-two" contentsLink>Section Two</a></li>
    </ul>
  </div>
</div>
```

* class names can be freely renamed. Just make sure to adjust the CSS classes later accordingly.

[my-module.component.css](https://github.com/zurfyx/angular-contents/blob/master/example/app/default.component.scss)

Below are the styles that the Angular Contents [demo page](https://zurfyx.github.io/angular-contents/) uses. Only the `<-- must have` fields are required. Feel free to adjust the rest to your website style.

The snippet above displays the Angular Contents specific styles, you can find the full page styles [here](https://github.com/zurfyx/angular-contents/blob/master/example/app/default.component.scss).

```
.contents-table {
  // Do not use margin here. It will be overwritten.
  position: absolute; // <-- must have.
  padding: 2rem;
}

.contents-table.sticky {
  position: fixed; // <-- must have.
  top: 0; // <-- must have.
}

.contents-table {
  list-style: none;
  margin: 0;
}

.contents-table a {
  border-radius: 4px;
  display: block;
  padding: 0.3rem 0.6rem;
  color: #444;
  text-decoration: none;
}

.contents-table a.active {
  background-color: #000;
  color: #fff;
}

.columnify > .table-column {
  flex: 0 1 auto;
  width: 220px;
}

// Columnify https://stackoverflow.com/a/47220287
.columnify {
  display: flex;
}

.columnify > * {
  flex: 1;
}

.columnify > *:not(:first-child) {
  margin-left: 2rem;
}
```

## Scroll animation

By default, Angular Contents carries no animation. Feel free to choose a scrolling library of your choice.

The demo page uses [ngx-page-scroll](https://github.com/Nolanus/ngx-page-scroll). Attaching it to Angular Contents is as simple as it follows.

Install the library

```
npm install ngx-page-scroll
```

Import the library into your Module

```
import { ContentsModule } from 'angular-contents';
import { NgxPageScrollModule } from 'ngx-page-scroll';

  imports: [
    ...
    ContentsModule,
    NgxPageScrollModule,
    ...
  ],
```

Add functionality to your Component HTML

```
<ul class="contents-table" contentsTable>
  <li><a href="#section-one" contentsLink pageScroll>Section One</a></li>
  <li><a href="#section-two" contentsLink pageScroll>Section Two</a></li>
  <li><a href="#section-three" contentsLink pageScroll>Section Three</a></li>
  <li><a href="#section-four" contentsLink pageScroll>Section Four</a></li>
  <li><a href="#section-five" contentsLink pageScroll>Section Five</a></li>
</ul>
```

Notice `pageScroll` addition.

For further [ngx-page-scroll](https://www.npmjs.com/package/ngx-page-scroll) configuration, such as scroll speed, you should check their [own repository](https://github.com/Nolanus/ngx-page-scroll).

## [Advanced] Scrolling view

By default, Angular Contents will use the `window` or `document` as the scrolling view. That means that the inner content will update according to the changes in such elements.

More technically, the scrolling view is the one that triggers scrolling events and from which the relative offset is measured. If the scrolling view is set to a `div` instead, only once the `div` gets scrolled the Table of Contents will trigger an update.

By using the special binding `[scrollingView]`, you can set the scrolling container of your choice instead of the default one.

### Partial scrolling view

Below we present the source code of the one that is working in the first scrolling view demo, once you switch to the "Scroll View". Partial scrolling view source code features only the text content under the scrolling view. You can check the full source code by clicking on the file names.

[my-module.module.ts](https://github.com/zurfyx/angular-contents/blob/master/example/app/app.module.ts)

*Same as default.*

[my-module.component.ts](https://github.com/zurfyx/angular-contents/blob/master/example/app/scrolling-view.component.ts)

```
import { Component, ViewEncapsulation, ViewChild, ElementRef, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { PageScrollService, PageScrollInstance } from 'ngx-page-scroll';

@Component({
  selector: 'app-scrolling-view',
  templateUrl: 'scrolling-view.component.html',
  styleUrls: ['scrolling-view.component.scss'],
})
export class ScrollingViewComponent {
  @ViewChild('container') private container: ElementRef;

  constructor(private pageScrollService: PageScrollService, @Inject(DOCUMENT) private document: any) {}

  public animateScroll(sectionTarget: string): void {
    // https://github.com/Nolanus/ngx-page-scroll#service
    const pageScrollInstance: PageScrollInstance = PageScrollInstance.newInstance({
      document: this.document, scrollTarget: sectionTarget, scrollingViews: [this.container.nativeElement]
    });
    this.pageScrollService.start(pageScrollInstance);
  }
}
```

The scrolling animation, just like by default can also be done with `ngx-page-scroll`. In fact, that's [why it was initially requested](https://github.com/zurfyx/angular-contents/issues/4) and the reason why we try to stick to their names.

To set scrolling transition effects with `ngx-page-scroll`, you have to do something like above, where we wrote our own `animateScroll` to handle each of the Table of Contents links click. You can find more details about the `PageScrollInstance` and their service in [their own repository](https://github.com/Nolanus/ngx-page-scroll#service).

Angular Contents as such does only require the declaration of the container that you are going to be using as the scrolling view: `@ViewChild('container') private container: ElementRef;`

[my-module.component.html](https://github.com/zurfyx/angular-contents/blob/master/example/app/scrolling-view.component.html)

```
<div class="columnify" contents [scrollingView]="container"> <!-- We use the container referenced below -->
  <!-- Body -->
  <div class="framed" #container> <!-- Notice the #container -->
    <div [contentsSection]="'section-one'">
      <h1>Section One</h1>
      ...
    </div>

    <div [contentsSection]="'section-two'">
      <h1>Section Two</h1>
      ...
    </div>
  <!-- Table of Contents -->
  <div class="table-column">
    <ul class="contents-table" contentsTable>
      <li><a href="#section-one" contentsLink (click)="animateScroll('#section-one')">Section One</a></li>
      <li><a href="#section-two" contentsLink (click)="animateScroll('#section-two')">Section Two</a></li>
    </ul>
  </div>
</div>
```

[my-module.component.css](https://github.com/zurfyx/angular-contents/blob/master/example/app/scrolling-view.component.scss)

```
...
// .framed makes the text scrollable.
// If you already have a scrollable container, that is not a requirement.
.framed {
  position: relative;
  height: 400px;
  overflow-y: auto;
  border: 1px solid #e2e2e2;
  border-radius: 2px;
  padding: 25px;
}
```

*The rest of the styles are the same as default.*

### Full scrolling view

**A note to Angular Material users:** Angular Material carries [its own content container](https://github.com/zurfyx/angular-contents/issues/2#issuecomment-358700968), `mat-sidenav-content`. Thus, the default example will not work for you since it targets `window` or `document`. In this case, you are going to have to make use of the *full scrolling view* to make it work on your site, and target `[scrollingView]=document.querySelector('mat-sidenav-content')`.

In the previous section, only the text content was part of the scrolling view. In the full scrolling view example below, the Table of Contents is also part of the scrolling view. Since the changes are minimal and accumulative, and for the sake of not rewriting it all, you should check [Partial scrolling view](#partial-scrolling-view) before.

All and all, you can check the full source code here:
[my-module.module.ts](https://github.com/zurfyx/angular-contents/blob/master/example/app/app.module.ts)
[my-module.component.ts](https://github.com/zurfyx/angular-contents/blob/master/example/app/scrolling-view-table.component.ts)
[my-module.component.html](https://github.com/zurfyx/angular-contents/blob/master/example/app/scrolling-view-table.component.html)
[my-module.component.scss](https://github.com/zurfyx/angular-contents/blob/master/example/app/scrolling-view-table.component.scss)

[my-module.component.html](https://github.com/zurfyx/angular-contents/blob/master/example/app/scrolling-view-table.component.html)

```
<div class="columnify" contents [scrollingView]="container" #container>
  <!-- Body -->
  <div class="framed">
    <div [contentsSection]="'section-one'">
      <h1>Section One</h1>
      ...
    </div>

    <div [contentsSection]="'section-two'">
      <h1>Section Two</h1>
      ...
    </div>
  <!-- Table of Contents -->
  <div class="table-column">
    <ul class="contents-table" contentsTable [scrollingView]="container">
      <li><a href="#section-one" contentsLink (click)="animateScroll('#section-one')">Section One</a></li>
      <li><a href="#section-two" contentsLink (click)="animateScroll('#section-two')">Section Two</a></li>
    </ul>
  </div>
</div>
```

## License

MIT © [Gerard Rovira Sánchez](//zurfyx.com)


text:
package net.cpollet.sportracker.dozer;

import net.cpollet.sportracker.service.api.HashingService;
import net.cpollet.sportracker.web.data.UserData;
import org.dozer.Mapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static org.fest.assertions.Assertions.assertThat;

/**
 * @author Christophe Pollet
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/spring/spring-root-context.xml"})
public class ITestCustomConversions {
	@Autowired
	private Mapper dozer;

	@Autowired
	private HashingService hashingService;

	@Test
	public void convertWebUserToModelUser() {
		// GIVEN
		UserData webUserData = new UserData();
		webUserData.setUsername("username");
		webUserData.setPassword1("password1");
		webUserData.setPassword2("password2");

		// WHEN
		net.cpollet.sportracker.data.User user = dozer.map(webUserData, net.cpollet.sportracker.data.User.class);

		// THEN
		assertThat(user.getUsername()).isEqualTo("username");
		assertThat(hashingService.verify(user.getPassword(), webUserData.getPassword1())).isTrue();
	}
}


text:
module.exports = Tags;

function Tags (angel) {
  this.angel = angel;
}

Tags.prototype.get = function (tagId, callback) {
  return this.angel.request('/tags/' + tagId, callback);
};

Tags.prototype.children = function (tagId, callback) {
  return this.angel.request('/tags/' + tagId + '/children', callback);
};

Tags.prototype.parents = function (tagId, callback) {
  return this.angel.request('/tags/' + tagId + '/parents', callback);
};


text:
package com.hazelcast.internal.management.operation;

import com.hazelcast.spi.impl.NodeEngine;
import com.hazelcast.spi.impl.operationservice.AbstractLocalOperation;
import com.hazelcast.wan.impl.WanReplicationService;

/**
 * Checking consistency of the given map for the given wan replication
 * schema and publisher
 */
public class WanCheckConsistencyOperation extends AbstractLocalOperation {
    private String schemeName;
    private String publisherName;
    private String mapName;

    public WanCheckConsistencyOperation(String schemeName, String publisherName, String mapName) {
        this.schemeName = schemeName;
        this.publisherName = publisherName;
        this.mapName = mapName;
    }

    @Override
    public void run() throws Exception {
        NodeEngine nodeEngine = getNodeEngine();
        WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService();
        wanReplicationService.consistencyCheck(schemeName, publisherName, mapName);
    }
}


text:
/**
 * \interface DistanceSensor
 * A parent class for all sensors that conduct distance measurements.
 */
#pragma once

#include <stdint.h> // NOLINT(modernize-deprecated-headers)

namespace smartcarlib
{
namespace constants
{
namespace distanceSensor
{
const int kMaxMedianMeasurements = 100;
}
} // namespace constants
} // namespace smartcarlib

class DistanceSensor
{
public:
    virtual ~DistanceSensor() = default;

    /**
     * @brief Gets the distance measured by the sensor in centimeters. Calling this might trigger a
     * new measurement by the sensor.
     *
     * @return `0` if an error has occured, otherwise the measured distance in centimeters
     *
     * **Example:**
     * \code
     * unsigned int distance = sensor.getDistance();
     * \endcode
     */
    virtual unsigned int getDistance() = 0;

    /**
     * @brief Gets the median distance from the specified number of measurements.
     *
     * @param iterations Number of measurements to conduct (at most `kMaxMedianMeasurements`)
     * @return The median of the conducted measurements or an error value if the number of
     * iterations is `0` or larger than `kMaxMedianMeasurements`
     *
     * **Example:**
     * \code
     * // Get the median of `10` measurements
     * unsigned int distance = sensor.getMedianDistance(10);
     * \endcode
     */
    virtual unsigned int getMedianDistance(uint8_t iterations) = 0;
};


text:
using UnityEditor;
using UnityEngine;

namespace ScriptInspector
{

public class GoToLineWindow : EditorWindow
{
	private string text;
	private FGTextEditor editor;

	public static GoToLineWindow Create(FGTextEditor editor)
	{
		var owner = EditorWindow.focusedWindow;
		var wnd = EditorWindow.GetWindow<GoToLineWindow>(true);
		wnd.editor = editor;
		wnd.text = (editor.caretPosition.line + 1).ToString();
		if (owner != null)
		{
			var center = owner.position.center;
			wnd.position = new Rect((int)(center.x - 0.5f * 256f), (int)(center.y - 0.5f * 100f), 256f, 100f);
		}
		wnd.ShowAuxWindow();
		return wnd;
	}

	private void OnEnable()
	{
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0
		title = "Go To Line";
#else
		titleContent.text = "Go To Line";
#endif
		minSize = new Vector2(265f, 100f);
		maxSize = new Vector2(265f, 100f);
		Repaint();
	}

	private void OnDisable()
	{
		editor.OwnerWindow.Focus();
	}

	private void OnGUI()
	{
		int lineToGoTo;
		var validLineNumber = int.TryParse(text, out lineToGoTo) &&
			lineToGoTo >= 1 && lineToGoTo <= editor.TextBuffer.lines.Count;

		if (validLineNumber && Event.current.type == EventType.KeyDown && Event.current.character == '\n')
		{
			editor.SetCursorPosition(lineToGoTo - 1, 0);
			Close();
			editor.OwnerWindow.Focus();
			return;
		}
		else if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape)
		{
			Close();
			editor.OwnerWindow.Focus();
			return;
		}

		GUILayout.BeginVertical();
		GUILayout.Space(20f);

		GUILayout.BeginHorizontal();
		GUILayout.Space(10f);

		GUI.SetNextControlName("text field");
#if !UNITY_3_5 && !UNITY_4_0 && !UNITY_4_1 && !UNITY_4_2
		EditorGUI.FocusTextInControl("text field");
#endif
		text = EditorGUILayout.TextField(text);
		GUI.FocusControl("text field");

		GUILayout.Space(10f);
		GUILayout.EndHorizontal();
		GUILayout.Space(20f);

		GUI.enabled = int.TryParse(text, out lineToGoTo) &&
			lineToGoTo >= 1 && lineToGoTo <= editor.TextBuffer.lines.Count;

		GUILayout.BeginHorizontal();
		GUILayout.FlexibleSpace();
		if (GUILayout.Button("OK"))
		{
			editor.SetCursorPosition(lineToGoTo - 1, 0);
			Close();
			editor.OwnerWindow.Focus();
		}
		GUILayout.Space(6f);

		GUI.enabled = true;

		if (GUILayout.Button("Cancel"))
		{
			Close();
			editor.OwnerWindow.Focus();
		}
		GUILayout.Space(10f);
		GUILayout.EndHorizontal();

		GUILayout.Space(10f);
		GUILayout.EndVertical();
	}
}

}


text:
$(function(){

	$(this).keyup(function(event) {
		if (event.which === 27) {
			disablePopup();
		}
	});

	$('.blur-overlay').click(function() {
		disablePopup();
		return false;
	});
});

function disablePopup() {
	$('.modal-container').fadeOut('normal');
	$('.blur-overlay').fadeOut('normal');
}


text:
      SUBROUTINE DLASD6( ICOMPQ, NL, NR, SQRE, D, VF, VL, ALPHA, BETA,
     $                   IDXQ, PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM,
     $                   LDGNUM, POLES, DIFL, DIFR, Z, K, C, S, WORK,
     $                   IWORK, INFO )
*
*  -- LAPACK auxiliary routine (version 3.0) --
*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
*     Courant Institute, Argonne National Lab, and Rice University
*     June 30, 1999
*
*     .. Scalar Arguments ..
      INTEGER            GIVPTR, ICOMPQ, INFO, K, LDGCOL, LDGNUM, NL,
     $                   NR, SQRE
      DOUBLE PRECISION   ALPHA, BETA, C, S
*     ..
*     .. Array Arguments ..
      INTEGER            GIVCOL( LDGCOL, * ), IDXQ( * ), IWORK( * ),
     $                   PERM( * )
      DOUBLE PRECISION   D( * ), DIFL( * ), DIFR( * ),
     $                   GIVNUM( LDGNUM, * ), POLES( LDGNUM, * ),
     $                   VF( * ), VL( * ), WORK( * ), Z( * )
*     ..
*
*  Purpose
*  =======
*
*  DLASD6 computes the SVD of an updated upper bidiagonal matrix B
*  obtained by merging two smaller ones by appending a row. This
*  routine is used only for the problem which requires all singular
*  values and optionally singular vector matrices in factored form.
*  B is an N-by-M matrix with N = NL + NR + 1 and M = N + SQRE.
*  A related subroutine, DLASD1, handles the case in which all singular
*  values and singular vectors of the bidiagonal matrix are desired.
*
*  DLASD6 computes the SVD as follows:
*
*                ( D1(in)  0    0     0 )
*    B = U(in) * (   Z1'   a   Z2'    b ) * VT(in)
*                (   0     0   D2(in) 0 )
*
*      = U(out) * ( D(out) 0) * VT(out)
*
*  where Z' = (Z1' a Z2' b) = u' VT', and u is a vector of dimension M
*  with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros
*  elsewhere; and the entry b is empty if SQRE = 0.
*
*  The singular values of B can be computed using D1, D2, the first
*  components of all the right singular vectors of the lower block, and
*  the last components of all the right singular vectors of the upper
*  block. These components are stored and updated in VF and VL,
*  respectively, in DLASD6. Hence U and VT are not explicitly
*  referenced.
*
*  The singular values are stored in D. The algorithm consists of two
*  stages:
*
*        The first stage consists of deflating the size of the problem
*        when there are multiple singular values or if there is a zero
*        in the Z vector. For each such occurence the dimension of the
*        secular equation problem is reduced by one. This stage is
*        performed by the routine DLASD7.
*
*        The second stage consists of calculating the updated
*        singular values. This is done by finding the roots of the
*        secular equation via the routine DLASD4 (as called by DLASD8).
*        This routine also updates VF and VL and computes the distances
*        between the updated singular values and the old singular
*        values.
*
*  DLASD6 is called from DLASDA.
*
*  Arguments
*  =========
*
*  ICOMPQ (input) INTEGER
*         Specifies whether singular vectors are to be computed in
*         factored form:
*         = 0: Compute singular values only.
*         = 1: Compute singular vectors in factored form as well.
*
*  NL     (input) INTEGER
*         The row dimension of the upper block.  NL >= 1.
*
*  NR     (input) INTEGER
*         The row dimension of the lower block.  NR >= 1.
*
*  SQRE   (input) INTEGER
*         = 0: the lower block is an NR-by-NR square matrix.
*         = 1: the lower block is an NR-by-(NR+1) rectangular matrix.
*
*         The bidiagonal matrix has row dimension N = NL + NR + 1,
*         and column dimension M = N + SQRE.
*
*  D      (input/output) DOUBLE PRECISION array, dimension ( NL+NR+1 ).
*         On entry D(1:NL,1:NL) contains the singular values of the
*         upper block, and D(NL+2:N) contains the singular values
*         of the lower block. On exit D(1:N) contains the singular
*         values of the modified matrix.
*
*  VF     (input/output) DOUBLE PRECISION array, dimension ( M )
*         On entry, VF(1:NL+1) contains the first components of all
*         right singular vectors of the upper block; and VF(NL+2:M)
*         contains the first components of all right singular vectors
*         of the lower block. On exit, VF contains the first components
*         of all right singular vectors of the bidiagonal matrix.
*
*  VL     (input/output) DOUBLE PRECISION array, dimension ( M )
*         On entry, VL(1:NL+1) contains the  last components of all
*         right singular vectors of the upper block; and VL(NL+2:M)
*         contains the last components of all right singular vectors of
*         the lower block. On exit, VL contains the last components of
*         all right singular vectors of the bidiagonal matrix.
*
*  ALPHA  (input) DOUBLE PRECISION
*         Contains the diagonal element associated with the added row.
*
*  BETA   (input) DOUBLE PRECISION
*         Contains the off-diagonal element associated with the added
*         row.
*
*  IDXQ   (output) INTEGER array, dimension ( N )
*         This contains the permutation which will reintegrate the
*         subproblem just solved back into sorted order, i.e.
*         D( IDXQ( I = 1, N ) ) will be in ascending order.
*
*  PERM   (output) INTEGER array, dimension ( N )
*         The permutations (from deflation and sorting) to be applied
*         to each block. Not referenced if ICOMPQ = 0.
*
*  GIVPTR (output) INTEGER
*         The number of Givens rotations which took place in this
*         subproblem. Not referenced if ICOMPQ = 0.
*
*  GIVCOL (output) INTEGER array, dimension ( LDGCOL, 2 )
*         Each pair of numbers indicates a pair of columns to take place
*         in a Givens rotation. Not referenced if ICOMPQ = 0.
*
*  LDGCOL (input) INTEGER
*         leading dimension of GIVCOL, must be at least N.
*
*  GIVNUM (output) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
*         Each number indicates the C or S value to be used in the
*         corresponding Givens rotation. Not referenced if ICOMPQ = 0.
*
*  LDGNUM (input) INTEGER
*         The leading dimension of GIVNUM and POLES, must be at least N.
*
*  POLES  (output) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
*         On exit, POLES(1,*) is an array containing the new singular
*         values obtained from solving the secular equation, and
*         POLES(2,*) is an array containing the poles in the secular
*         equation. Not referenced if ICOMPQ = 0.
*
*  DIFL   (output) DOUBLE PRECISION array, dimension ( N )
*         On exit, DIFL(I) is the distance between I-th updated
*         (undeflated) singular value and the I-th (undeflated) old
*         singular value.
*
*  DIFR   (output) DOUBLE PRECISION array,
*                  dimension ( LDGNUM, 2 ) if ICOMPQ = 1 and
*                  dimension ( N ) if ICOMPQ = 0.
*         On exit, DIFR(I, 1) is the distance between I-th updated
*         (undeflated) singular value and the I+1-th (undeflated) old
*         singular value.
*
*         If ICOMPQ = 1, DIFR(1:K,2) is an array containing the
*         normalizing factors for the right singular vector matrix.
*
*         See DLASD8 for details on DIFL and DIFR.
*
*  Z      (output) DOUBLE PRECISION array, dimension ( M )
*         The first elements of this array contain the components
*         of the deflation-adjusted updating row vector.
*
*  K      (output) INTEGER
*         Contains the dimension of the non-deflated matrix,
*         This is the order of the related secular equation. 1 <= K <=N.
*
*  C      (output) DOUBLE PRECISION
*         C contains garbage if SQRE =0 and the C-value of a Givens
*         rotation related to the right null space if SQRE = 1.
*
*  S      (output) DOUBLE PRECISION
*         S contains garbage if SQRE =0 and the S-value of a Givens
*         rotation related to the right null space if SQRE = 1.
*
*  WORK   (workspace) DOUBLE PRECISION array, dimension ( 4 * M )
*
*  IWORK  (workspace) INTEGER array, dimension ( 3 * N )
*
*  INFO   (output) INTEGER
*          = 0:  successful exit.
*          < 0:  if INFO = -i, the i-th argument had an illegal value.
*          > 0:  if INFO = 1, an singular value did not converge
*
*  Further Details
*  ===============
*
*  Based on contributions by
*     Ming Gu and Huan Ren, Computer Science Division, University of
*     California at Berkeley, USA
*
*  =====================================================================
*
*     .. Parameters ..
      DOUBLE PRECISION   ONE, ZERO
      PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
*     ..
*     .. Local Scalars ..
      INTEGER            I, IDX, IDXC, IDXP, ISIGMA, IVFW, IVLW, IW, M,
     $                   N, N1, N2
      DOUBLE PRECISION   ORGNRM
*     ..
*     .. External Subroutines ..
      EXTERNAL           DCOPY, DLAMRG, DLASCL, DLASD7, DLASD8, XERBLA
*     ..
*     .. Intrinsic Functions ..
      INTRINSIC          ABS, MAX
*     ..
*     .. Executable Statements ..
*
*     Test the input parameters.
*
      INFO = 0
      N = NL + NR + 1
      M = N + SQRE
*
      IF( ( ICOMPQ.LT.0 ) .OR. ( ICOMPQ.GT.1 ) ) THEN
         INFO = -1
      ELSE IF( NL.LT.1 ) THEN
         INFO = -2
      ELSE IF( NR.LT.1 ) THEN
         INFO = -3
      ELSE IF( ( SQRE.LT.0 ) .OR. ( SQRE.GT.1 ) ) THEN
         INFO = -4
      ELSE IF( LDGCOL.LT.N ) THEN
         INFO = -14
      ELSE IF( LDGNUM.LT.N ) THEN
         INFO = -16
      END IF
      IF( INFO.NE.0 ) THEN
         CALL XERBLA( 'DLASD6', -INFO )
         RETURN
      END IF
*
*     The following values are for bookkeeping purposes only.  They are
*     integer pointers which indicate the portion of the workspace
*     used by a particular array in DLASD7 and DLASD8.
*
      ISIGMA = 1
      IW = ISIGMA + N
      IVFW = IW + M
      IVLW = IVFW + M
*
      IDX = 1
      IDXC = IDX + N
      IDXP = IDXC + N
*
*     Scale.
*
      ORGNRM = MAX( ABS( ALPHA ), ABS( BETA ) )
      D( NL+1 ) = ZERO
      DO 10 I = 1, N
         IF( ABS( D( I ) ).GT.ORGNRM ) THEN
            ORGNRM = ABS( D( I ) )
         END IF
   10 CONTINUE
      CALL DLASCL( 'G', 0, 0, ORGNRM, ONE, N, 1, D, N, INFO )
      ALPHA = ALPHA / ORGNRM
      BETA = BETA / ORGNRM
*
*     Sort and Deflate singular values.
*
      CALL DLASD7( ICOMPQ, NL, NR, SQRE, K, D, Z, WORK( IW ), VF,
     $             WORK( IVFW ), VL, WORK( IVLW ), ALPHA, BETA,
     $             WORK( ISIGMA ), IWORK( IDX ), IWORK( IDXP ), IDXQ,
     $             PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM, C, S,
     $             INFO )
*
*     Solve Secular Equation, compute DIFL, DIFR, and update VF, VL.
*
      CALL DLASD8( ICOMPQ, K, D, Z, VF, VL, DIFL, DIFR, LDGNUM,
     $             WORK( ISIGMA ), WORK( IW ), INFO )
*
*     Save the poles if ICOMPQ = 1.
*
      IF( ICOMPQ.EQ.1 ) THEN
         CALL DCOPY( K, D, 1, POLES( 1, 1 ), 1 )
         CALL DCOPY( K, WORK( ISIGMA ), 1, POLES( 1, 2 ), 1 )
      END IF
*
*     Unscale.
*
      CALL DLASCL( 'G', 0, 0, ONE, ORGNRM, N, 1, D, N, INFO )
*
*     Prepare the IDXQ sorting permutation.
*
      N1 = K
      N2 = N - K
      CALL DLAMRG( N1, N2, D, 1, -1, IDXQ )
*
      RETURN
*
*     End of DLASD6
*
      END


text:
namespace chromecast {

// This class monitors requests issued by third-party javascript run via
// Activities, and blocks the request based on URL whitelisting.
class ActivityFilteringURLLoaderThrottle : public blink::URLLoaderThrottle {
 public:
  explicit ActivityFilteringURLLoaderThrottle(ActivityUrlFilter* filter);
  ~ActivityFilteringURLLoaderThrottle() override;

  // content::URLLoaderThrottle implementation:
  void WillStartRequest(network::ResourceRequest* request,
                        bool* defer) override;
  void WillRedirectRequest(
      net::RedirectInfo* redirect_info,
      const network::mojom::URLResponseHead& response_head,
      bool* defer,
      std::vector<std::string>* to_be_removed_request_headers,
      net::HttpRequestHeaders* modified_request_headers,
      net::HttpRequestHeaders* modified_cors_exempt_request_headers) override;

 private:
  // content::URLLoaderThrottle implementation:
  void DetachFromCurrentSequence() override;

  void FilterURL(const GURL& url);

  ActivityUrlFilter* url_filter_;

  DISALLOW_COPY_AND_ASSIGN(ActivityFilteringURLLoaderThrottle);
};

}  // namespace chromecast

#endif  // CHROMECAST_COMMON_ACTIVITY_FILTERING_URL_LOADER_THROTTLE_H_


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HtmlAgilityPack;
using Fizzler.Systems.HtmlAgilityPack;

namespace Shing.Parsers
{
    public abstract class ParserBase
    {
        protected const string _wishListItemRegex = "/dp/(.*?)/ref=wl_it_dp_";
        private const string _rawItemSplit = "class=\"itemWrapper\">";
        protected string _src;
        protected HtmlDocument _dom;

        public void SetSource(string htmlResponse)
        {
            _src = htmlResponse;
            _dom = new HtmlDocument();
            _dom.LoadHtml(_src);
        }

        public IEnumerable<HtmlNode> GetRawItems()
        {
            var matches = _dom.DocumentNode.QuerySelectorAll("tbody[name].itemWrapper");
            return matches.Where( n => {
                return n.QuerySelectorAll(".wlPrice, .wlPriceBold, .price")
                        .Any( match => !String.IsNullOrWhiteSpace( match.InnerText ));
            });
        }
    }
}


text: div { color : green }


text:
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
#include <iostream>
#include <vector>
#include <sdf/sdf.hh>

#include "gazebo/physics/PhysicsIface.hh"
#include "gazebo/common/Time.hh"
#include "gazebo/transport/TransportIface.hh"

#include "gazebo/gazebo_config.h"

// Command line options
std::string config_filename = "";

bool quit = false;

//////////////////////////////////////////////////
void PrintUsage()
{
  fprintf(stderr, "Usage: gzphysics [-hv] <worldfile>\n");
  return;
}

//////////////////////////////////////////////////
void PrintVersion()
{
  fprintf(stderr, "%s", GAZEBO_VERSION_HEADER);
}

//////////////////////////////////////////////////
int ParseArgs(int _argc, char **_argv)
{
  // FILE *tmpFile;
  int ch;

  char *flags = const_cast<char*>("h");

  // Get letter options
  while ((ch = getopt(_argc, _argv, flags)) != -1)
  {
    switch (ch)
    {
      case 'h':
      default:
        PrintUsage();
        return -1;
    }
  }

  _argc -= optind;
  _argv += optind;

  // Get the world file name
  if (_argc >= 1)
    config_filename = _argv[0];

  return 0;
}

//////////////////////////////////////////////////
void SignalHandler(int)
{
  quit = true;
}

void Load()
{
  gazebo::transport::init();
  gazebo::physics::load();

  // Load the world file
  sdf::SDFPtr sdf(new sdf::SDF());
  sdf::initFile(config_filename, sdf);
  sdf::readFile(config_filename, sdf);

  sdf::ElementPtr worldElem = sdf->root->GetElement("world");

  while (worldElem)
  {
    gazebo::physics::WorldPtr world =
      gazebo::physics::create_world(worldElem->Get<std::string>("name"));

    // Create the world
    try
    {
      gazebo::physics::load_world(world, worldElem);
    }
    catch(gazebo::common::Exception &e)
    {
      gzthrow("Failed to load the World\n"  << e);
    }

    worldElem = worldElem->GetNextElement("world");
  }

  gazebo::physics::init_worlds();
}

void Run()
{
  gazebo::physics::run_worlds();

  while (!quit)
  {
    gazebo::common::Time::MSleep(50);
  }
}

//////////////////////////////////////////////////
int main(int _argc, char **_argv)
{
  // Application Setup
  if (ParseArgs(_argc, _argv) != 0)
    return -1;

  PrintVersion();

  if (signal(SIGINT, SignalHandler) == SIG_ERR)
  {
    std::cerr << "signal(2) failed while setting up for SIGINT" << std::endl;
    return -1;
  }

  Load();
  Run();

  return 0;
}


text:
exports.merge = function(target) {
  var i= 1, length= arguments.length, source;
  for (; i < length; i++) {
     // Only deal with defined values
     if ((source = arguments[i]) != undefined) {
         Object.getOwnPropertyNames(source).forEach(function(k) {
            var d = Object.getOwnPropertyDescriptor(source, k) || {value:source[k]};
            if (d.get) {
                target.__defineGetter__(k, d.get);
                if (d.set) target.__defineSetter__(k, d.set);
            }
            else if (target !== d.value) {
                target[k] = d.value;
            }
        });
     }
  }
  return target;
}


text:
<?php

namespace Application\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Wallet
 */
class Wallet
{

    const UNIT_CURRENCY         = 1;
    const UNIT_PERCENTAGE       = 2;

    public $unitOptions = array(
                    self::UNIT_CURRENCY      =>  "Currency",
                    self::UNIT_PERCENTAGE    =>  "Percentage",
                );

    const STATUS_ACTIVE         = 1;
    const STATUS_WAGERED        = 2;
    const STATUS_DEPLETED       = 3;

    public $statusOptions = array(
                    self::STATUS_ACTIVE     =>  "Active",
                    self::STATUS_DEPLETED   =>  "Depleted"
                );

    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $name;

    /**
     * @var string
     */
    private $amount;
    /**
     * @var string
     */
    private $currency;

    /**
     * @var \DateTime
     */
    private $created_at;

    /**
     * @var \DateTime
     */
    private $updated_at;

    /**
     * @var \Application\Entity\Player
     */
    private $player;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $transactions;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->transactions = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set currency
     *
     * @param string $currency
     * @return Wallet
     */
    public function setCurrency($currency)
    {
        $this->currency = $currency;

        return $this;
    }

    /**
     * Get currency
     *
     * @return string
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return Wallet
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;

        return $this;
    }

    /**
     * Get created_at
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * Set updated_at
     *
     * @param \DateTime $updatedAt
     * @return Wallet
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;

        return $this;
    }

    /**
     * Get updated_at
     *
     * @return \DateTime
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    /**
     * Set player
     *
     * @param \Application\Entity\Player $player
     * @return Wallet
     */
    public function setPlayer(\Application\Entity\Player $player = null)
    {
        $this->player = $player;

        return $this;
    }

    /**
     * Get player
     *
     * @return \Application\Entity\Player
     */
    public function getPlayer()
    {
        return $this->player;
    }

    /**
     * Add transactions
     *
     * @param \Application\Entity\Transactions $transactions
     * @return Wallet
     */
    public function addTransaction(\Application\Entity\Transaction $transaction)
    {
        $this->transactions[] = $transaction;

        return $this;
    }

    /**
     * Remove transactions
     *
     * @param \Application\Entity\Transactions $transactions
     */
    public function removeTransaction(\Application\Entity\Transaction $transaction)
    {
        $this->transactions->removeElement($transaction);
    }

    /**
     * Get transactions
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getTransactions()
    {
        return $this->transactions;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Wallet
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set amount
     *
     * @param string $amount
     * @return Wallet
     */
    public function setAmount($amount)
    {
        $this->amount = $amount;

        return $this;
    }

    /**
     * Get amount
     *
     * @return string
     */
    public function getAmount()
    {
        return $this->amount;
    }
    /**
     * @var integer
     */
    private $status;

    /**
     * Set status
     *
     * @param integer $status
     * @return Wallet
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return integer
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Returns the wallet balance
     * @return double $balance
     */
    public function getBalance()
    {
        $balance = 0;

        if( !empty($this->transactions) )
        {
            foreach($this->transactions as $transaction)
            {
                $balance += $transaction->getAmount();
            }
        }

        return $balance;
    }
}


text:
<!--
  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.
-->
<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>

   <parent>
      <groupId>org.apache.activemq.tests</groupId>
      <artifactId>artemis-tests-pom</artifactId>
      <version>2.27.0-SNAPSHOT</version>
   </parent>

   <artifactId>integration-tests</artifactId>
   <packaging>jar</packaging>
   <name>ActiveMQ Artemis Integration Tests</name>

   <properties>
      <activemq.basedir>${project.basedir}/../..</activemq.basedir>
      <its-surefire-extra-args />
   </properties>

   <dependencies>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-quorum-ri</artifactId>
         <version>${project.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq.tests</groupId>
         <artifactId>unit-tests</artifactId>
         <version>${project.version}</version>
         <scope>test</scope>
         <type>test-jar</type>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-jms-client</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-jms-server</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-ra</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-cli</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-commons</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-spring-integration</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-journal</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-jdbc-store</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-amqp-protocol</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-stomp-protocol</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-openwire-protocol</artifactId>
         <version>${project.version}</version>
         <exclusions>
            <exclusion>
               <groupId>org.apache.geronimo.specs</groupId>
               <artifactId>geronimo-jms_1.1_spec</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-hornetq-protocol</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-core-client</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-server</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>activemq-artemis-native</artifactId>
         <version>${activemq-artemis-native-version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-service-extensions</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq.tests</groupId>
         <artifactId>artemis-test-support</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-junit</artifactId>
         <version>${project.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-unit-test-support</artifactId>
         <version>${project.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.hamcrest</groupId>
         <artifactId>hamcrest</artifactId>
         <version>${hamcrest.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>activemq-client</artifactId>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <groupId>org.apache.geronimo.specs</groupId>
               <artifactId>geronimo-jms_1.1_spec</artifactId>
            </exclusion>
            <exclusion>
               <groupId>org.apache.geronimo.specs</groupId>
               <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-mqtt-protocol</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>org.fusesource.mqtt-client</groupId>
         <artifactId>mqtt-client</artifactId>
      </dependency>
      <dependency>
         <groupId>org.eclipse.paho</groupId>
         <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
      </dependency>
      <dependency>
         <groupId>org.eclipse.paho</groupId>
         <artifactId>org.eclipse.paho.mqttv5.client</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.resource</groupId>
         <artifactId>jakarta.resource-api</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.transaction</groupId>
         <artifactId>jakarta.transaction-api</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.jms</groupId>
         <artifactId>jakarta.jms-api</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.management.j2ee</groupId>
         <artifactId>jakarta.management.j2ee-api</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.annotation</groupId>
         <artifactId>jakarta.annotation-api</artifactId>
      </dependency>
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-buffer</artifactId>
      </dependency>
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-codec-http</artifactId>
      </dependency>
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-codec-mqtt</artifactId>
         <version>${netty.version}</version>
      </dependency>
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-handler</artifactId>
      </dependency>
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-transport</artifactId>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.qpid</groupId>
         <artifactId>qpid-jms-client</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.qpid</groupId>
         <artifactId>proton-j</artifactId>
      </dependency>
      <!-- logging -->
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
      </dependency>
      <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-slf4j-impl</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>artemis-web</artifactId>
         <version>${project.version}</version>
         <scope>test</scope>
      </dependency>

      <!-- DB Test Deps -->
      <dependency>
         <groupId>org.apache.derby</groupId>
         <artifactId>derby</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.postgresql</groupId>
         <artifactId>postgresql</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.directory.server</groupId>
         <artifactId>apacheds-test-framework</artifactId>
         <version>${directory-version}</version>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <groupId>org.apache.directory.api</groupId>
               <artifactId>api-ldap-schema-data</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.apache.directory.server</groupId>
         <artifactId>apacheds-server-annotations</artifactId>
         <version>${directory-version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-lang3</artifactId>
          <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.codehaus.woodstox</groupId>
         <artifactId>woodstox-core-asl</artifactId>
         <version>4.4.0</version>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <groupId>javax.xml.stream</groupId>
               <artifactId>stax-api</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.apache.hadoop</groupId>
         <artifactId>hadoop-minikdc</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.directory.server</groupId>
         <artifactId>apacheds-interceptor-kerberos</artifactId>
         <version>${directory-version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.directory.jdbm</groupId>
         <artifactId>apacheds-jdbm2</artifactId>
         <version>${directory-jdbm2-version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-context</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-jms</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>commons-io</groupId>
         <artifactId>commons-io</artifactId>
      </dependency>
      <dependency>
         <groupId>org.jgroups</groupId>
         <artifactId>jgroups</artifactId>
      </dependency>

      <!-- openSSL test -->
      <dependency>
         <groupId>io.netty</groupId>
         <artifactId>netty-tcnative-boringssl-static</artifactId>
         <version>${netty-tcnative-version}</version>
      </dependency>

      <dependency>
         <groupId>io.vertx</groupId>
         <artifactId>vertx-proton</artifactId>
         <version>${vertx.version}</version>
         <scope>test</scope>
      </dependency>

      <!-- need this for org.apache.activemq.filter.JAXPXPathEvaluator for Xpath selectors with OpenWire JMS clients-->
      <dependency>
         <groupId>org.apache.activemq</groupId>
         <artifactId>activemq-broker</artifactId>
         <version>${activemq5-version}</version>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <groupId>com.fasterxml.jackson.core</groupId>
               <artifactId>jackson-databind</artifactId>
            </exclusion>
         </exclusions>
      </dependency>

      <!-- The johnzon-core and json-api contents are repackaged in -commons,
           However maven can still need them during tests, which run against
           the original -commons classes when built+run in the same reactor,
           and not the jar containing the shaded bits. -->
      <dependency>
         <groupId>org.apache.johnzon</groupId>
         <artifactId>johnzon-core</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>jakarta.json</groupId>
         <artifactId>jakarta.json-api</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
         <scope>test</scope>
      </dependency>

   </dependencies>

   <build>
      <testResources>
         <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
         </testResource>
      </testResources>
      <plugins>
         <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <configuration>
               <nonFilteredFileExtensions>
                  <nonFilteredFileExtension>jks</nonFilteredFileExtension>
               </nonFilteredFileExtensions>
            </configuration>
            <executions>
               <execution>
                  <id>copy-security-resources</id>
                  <phase>validate</phase>
                  <goals>
                     <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                     <outputDirectory>${basedir}/target/test-classes</outputDirectory>
                     <resources>
                        <resource>
                           <directory>../security-resources</directory>
                        </resource>
                     </resources>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
               <execution>
                  <phase>test</phase>
                  <goals>
                     <goal>test-jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <skipTests>${skipIntegrationTests}</skipTests>
               <argLine>-Djgroups.bind_addr=::1 ${activemq-surefire-argline} ${its-surefire-extra-args} -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="java.lang,javax.security,java.util,org.apache.activemq,org.fusesource.hawtbuf"</argLine>
            </configuration>
         </plugin>
      </plugins>
   </build>
   <profiles>
      <profile>
         <!-- Quick subset of tests, used on PR checks -->
         <id>fast-tests</id>
         <build>
            <pluginManagement>
               <plugins>
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <includes combine.children="override">
                           <include>**/integration/security/*Test.java</include>
                           <include>**/integration/ssl/*Test.java</include>
                           <include>**/integration/amqp/JMSSaslExternalTest.java</include>
                           <include>**/integration/amqp/connect/AMQPConnectSaslTest.java</include>
                        </includes>
                     </configuration>
                  </plugin>
               </plugins>
            </pluginManagement>
         </build>
      </profile>
      <profile>
         <id>jdk16on</id>
            <activation>
         <jdk>[16,)</jdk>
         </activation>
         <properties>
            <its-surefire-extra-args>--add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED</its-surefire-extra-args>
         </properties>
      </profile>
   </profiles>
</project>


text:
pysumo.logger package
=====================
Module contents
---------------

.. automodule:: pysumo.logger
    :members:
    :undoc-members:
    :show-inheritance:

Submodules
----------

pysumo.logger.actionlog module
-------------------------------

.. uml::
   !include ./UML/pysumo/logger/Actionlog.iuml

|

.. automodule:: pysumo.logger.actionlog
    :members:
    :undoc-members:
    :show-inheritance:

pysumo.logger.infolog module
-----------------------------

.. uml::
    !include ./UML/pysumo/logger/InfoLog.iuml

|

.. automodule:: pysumo.logger.infolog
    :members:
    :undoc-members:
    :show-inheritance:


text:
from collections import OrderedDict
import datetime
import settings
# Django
from django import template
from django.template import resolve_variable, NodeList
from django.template.defaultfilters import stringfilter
from django.contrib.auth.models import User, Group
from django.utils.timesince import timesince
from django.contrib.contenttypes.models import ContentType
# External
from taggit.models import Tag, TaggedItem
from tagmeta.models import TagMeta
# abl.es
from applications.models import Application
from blog.models import Article
from methods.models import Method

register = template.Library()

class TagMetaForTagNode(template.Node):
    def __init__(self, object, context_var):
        self.object = object
        self.context_var = context_var

    def render(self, context):
        try:
            object = template.resolve_variable(self.object, context)
        except template.VariableDoesNotExist:
            return ''
        try:
            context[self.context_var] = TagMeta.objects.get(tag=object)
        except:
            context[self.context_var] = None

        return ''

def tagmeta_for_tag(parser, token):
    """
    Example usage::
        {% tagmeta_for_tag tag as tagmeta %}
    """
    bits = token.contents.split()
    if len(bits) != 4:
        raise template.TemplateSyntaxError("'%s' tag takes exactly 4 arguments" % bits[0])
    if bits[2] != 'as':
        raise template.TemplateSyntaxError("2nd argument to '%s' tag must be 'as'" % bits[0])

    return TagMetaForTagNode(bits[1], bits[3])

register.tag('tagmeta_for_tag', tagmeta_for_tag)

class GetTagCount(template.Node):

    def __init__(self, tag, var_name, model=None):
        self.tag = tag
        self.var_name = var_name
        self.model = model

    def render(self, context):
        tag = template.Variable(self.tag).resolve(context)
        #var_name = template.Variable(self.var_name).resolve(context)

        if not isinstance(tag, Tag):
            assert False, tag
            try:
                tag = Tag.objects.get(slug='%s' % tag)
            except:
                context[self.var_name] = 0
                return u""

        qs = TaggedItem.objects.filter(tag=tag)

        # We now have 'tag' object for the correct tag, can search on this base
        if self.model is not None:
            model = template.Variable(self.model).resolve(context)
            # Get model and apply filter
            ct = ContentType.objects.get_for_model(model)
            qs = qs.filter(content_type_id=ct)

        context[self.var_name] = qs.count()

        return u""

def tagged_count(parser, token):
    """
       {% tagged_count for tag as var %}
       {% tagged_count for tag with model as var %}
    """

    parts = token.split_contents()
    if len(parts) == 5:
        return GetTagCount(parts[2], parts[4])
    if len(parts) == 7:
        return GetTagCount(parts[2], parts[6], parts[4])
    else:
        raise template.TemplateSyntaxError("'tagged_count' formatted incorrectly")

register.tag('tagged_count', tagged_count)


text:
class EqalizeSchemasBillingVersion < ActiveRecord::Migration
  def change
    create_table "billing_versions", force: true do |t|
      t.string   "item_type",  null: false
      t.integer  "item_id",    null: false
      t.string   "event",      null: false
      t.string   "whodunnit"
      t.text     "object"
      t.datetime "created_at"
      t.string   "ip"
      t.string   "user_agent"
    end

    add_index "billing_versions", ["item_type", "item_id"], name: "index_billing_versions_on_item_type_and_item_id"
  end
end


text: export * from './Animator.component';