text:
package org.apache.asterix.common.context;

import java.util.Map;

import org.apache.asterix.common.api.IDatasetLifecycleManager;
import org.apache.asterix.common.api.INcApplicationContext;
import org.apache.hyracks.api.application.INCServiceContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.io.IJsonSerializable;
import org.apache.hyracks.api.io.IPersistedResourceRegistry;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicy;
import org.apache.hyracks.storage.am.lsm.common.impls.PrefixMergePolicyFactory;

import com.fasterxml.jackson.databind.JsonNode;

public class CorrelatedPrefixMergePolicyFactory extends PrefixMergePolicyFactory {

    private static final long serialVersionUID = 1L;
    public static final String NAME = "correlated-prefix";
    public static final String KEY_DATASET_ID = "datasetId";

    @Override
    public String getName() {
        return NAME;
    }

    @Override
    public ILSMMergePolicy createMergePolicy(Map<String, String> configuration, INCServiceContext ctx) {
        IDatasetLifecycleManager dslcManager =
                ((INcApplicationContext) ctx.getApplicationContext()).getDatasetLifecycleManager();
        int datasetId = Integer.parseInt(configuration.get(KEY_DATASET_ID));
        ILSMMergePolicy policy = new CorrelatedPrefixMergePolicy(dslcManager, datasetId);
        policy.configure(configuration);
        return policy;
    }

    @Override
    public JsonNode toJson(IPersistedResourceRegistry registry) throws HyracksDataException {
        return registry.getClassIdentifier(getClass(), serialVersionUID);
    }

    @SuppressWarnings("squid:S1172") // unused parameter
    public static IJsonSerializable fromJson(IPersistedResourceRegistry registry, JsonNode json) {
        return new CorrelatedPrefixMergePolicyFactory();
    }
}


text:
using System.Collections.Generic;
using Chiro.Gap.Domain;
using Chiro.Gap.Poco.Model;
using Chiro.Gap.WorkerInterfaces;

namespace Chiro.Gap.Dummies
{
	/// <summary>
	/// Autorisatiemanager die er steeds van uitgaat dat
	/// de gebruiker geen rechten heeft.
	/// (nuttig voor authorisatietests..)
	/// </summary>
	public class AutMgrNooitGav : IAutorisatieManager
	{
		public IList<int> EnkelMijnGelieerdePersonen(IEnumerable<int> gelieerdePersonenIDs)
		{
			return new List<int>();
		}

		public IList<int> EnkelMijnPersonen(IEnumerable<int> personenIDs)
		{
			return new List<int>();
		}

		public string GebruikersNaamGet()
		{
			return "Paria";
		}

		public bool IsSuperGav()
		{
			return false;
		}

		public IEnumerable<Groep> MijnGroepenOphalen()
		{
			return new List<Groep>();
		}

	    public bool IsGav(Groep groep)
	    {
	        return false;
	    }

	    public bool IsGav(CommunicatieVorm communicatieVorm)
	    {
	        return false;
	    }

	    public bool IsGav(GroepsWerkJaar groepsWerkJaar)
	    {
	        return false;
	    }

	    public bool IsGav(GelieerdePersoon gelieerdePersoon)
	    {
	        return false;
	    }

	    public bool IsGav(Deelnemer gelieerdePersoon)
	    {
            return false;
	    }

	    public bool IsGav(Plaats gelieerdePersoon)
	    {
            return false;
	    }

	    public bool IsGav(Uitstap gelieerdePersoon)
	    {
            return false;
	    }

	    public bool IsGav(GebruikersRechtV2 gelieerdePersoon)
	    {
            return false;
	    }

        public bool IsGav(Lid gelieerdePersoon)
        {
            return false;
        }

        public bool IsGav(Afdeling gelieerdePersoon)
        {
            return false;
        }

        public bool IsGav(Categorie gelieerdePersoon)
        {
            return false;
        }

	    public bool IsGav(IList<GelieerdePersoon> gelieerdePersonen)
	    {
	        return false;
	    }

	    public List<GelieerdePersoon> MijnGelieerdePersonen(IList<Persoon> personen)
	    {
	        return new List<GelieerdePersoon>();
	    }

	    public bool IsGav(IList<PersoonsAdres> persoonsAdressen)
	    {
	        return false;
	    }

	    public bool IsGav(IList<Persoon> personen)
	    {
	        return false;
	    }

	    public bool IsGav(IList<Lid> leden)
	    {
	        return false;
	    }

	    public bool IsGav(Abonnement abonnement)
	    {
	        return false;
	    }

	    public bool IsGav(IList<Groep> groepen)
	    {
	        return false;
	    }

        public bool IsGav(Persoon p)
        {
            return false;
        }

        public bool HeeftPermissies(Groep groep, Domain.Permissies permissies)
        {
            return false;
        }

	    public Permissies PermissiesOphalen(Lid lid)
	    {
	        return Permissies.Geen;
	    }

	    public Permissies PermissiesOphalen(Functie functie)
	    {
	        return functie.IsNationaal ? Permissies.Lezen : Permissies.Geen;
	    }

	    public bool MagLezen(Persoon ik, Persoon persoon2)
        {
            return false;
        }

	    public Permissies PermissiesOphalen(Groep groep, SecurityAspect aspecten)
	    {
	        return Permissies.Geen;
	    }

	    public bool MagZichzelfLezen(Persoon persoon)
	    {
	        return false;
	    }

	    public Permissies PermissiesOphalen(GelieerdePersoon gelieerdePersoon)
	    {
	        return Permissies.Geen;
	    }

	    public Permissies EigenPermissies(Persoon persoon)
	    {
	        return Permissies.Geen;
	    }

	    public GebruikersRechtV2 GebruikersRechtOpEigenGroep(GelieerdePersoon gp)
	    {
	        return null;
	    }
	}
}

redpajama_set_name: RedPajamaGithub


text:
using Eto.Drawing;
using Eto.Forms;
using Jojatekok.MoneroGUI.Desktop.Controls;
using System.Collections.Generic;

namespace Jojatekok.MoneroGUI.Desktop.Views.OptionsDialog
{
    public class PathsView : TableLayout, IOptionsTabPageView
    {
        private readonly PathSelector _pathSelectorDirectoryDaemonData = new PathSelector {
            Padding = new Padding(Utilities.Padding3, 0, 0, Utilities.Padding3)
        };
        private readonly PathSelector _pathSelectorFileAccountData = new PathSelector {
            Padding = new Padding(Utilities.Padding3, 0, 0, Utilities.Padding3),
            Filters = new HashSet<FileDialogFilter> {
                new FileDialogFilter(Desktop.Properties.Resources.TextFilterAccountFiles, Utilities.FileFilterAccount)
            }
        };
        private readonly PathSelector _pathSelectorDirectoryAccountBackups = new PathSelector {
            Padding = new Padding(Utilities.Padding3, 0, 0, Utilities.Padding3)
        };

        private readonly PathSelector _pathSelectorSoftwareDaemon = new PathSelector {
            Padding = new Padding(Utilities.Padding3, 0, 0, Utilities.Padding3),
            Filters = Utilities.FileFilterSetExecutables
        };
        private readonly PathSelector _pathSelectorSoftwareAccountManager = new PathSelector {
            Padding = new Padding(Utilities.Padding3, 0, 0, Utilities.Padding3),
            Filters = Utilities.FileFilterSetExecutables
        };

        private PathSelector PathSelectorDirectoryDaemonData {
            get { return _pathSelectorDirectoryDaemonData; }
        }

        private PathSelector PathSelectorFileAccountData {
            get { return _pathSelectorFileAccountData; }
        }

        private PathSelector PathSelectorDirectoryAccountBackups {
            get { return _pathSelectorDirectoryAccountBackups; }
        }

        private PathSelector PathSelectorSoftwareDaemon {
            get { return _pathSelectorSoftwareDaemon; }
        }

        private PathSelector PathSelectorSoftwareAccountManager {
            get { return _pathSelectorSoftwareAccountManager; }
        }

        public PathsView()
        {
            LoadSettings();

            Rows.Add(new TableRow(
                new Panel {
                    Content = new Label { Text = Desktop.Properties.Resources.OptionsPathsDirectoryDaemonData },
                    Padding = new Padding(0, 0, 0, Utilities.Padding3)
                },
                PathSelectorDirectoryDaemonData
            ));

            Rows.Add(new TableRow(
                new Panel {
                    Content = new Label { Text = Desktop.Properties.Resources.OptionsPathsFileAccountData },
                    Padding = new Padding(0, 0, 0, Utilities.Padding3)
                },
                PathSelectorFileAccountData
            ));

            Rows.Add(new TableRow(
                new Panel {
                    Content = new Label { Text = Desktop.Properties.Resources.OptionsPathsDirectoryAccountBackups },
                    Padding = new Padding(0, 0, 0, Utilities.Padding3)
                },
                PathSelectorDirectoryAccountBackups
            ));

            Rows.Add(new TableRow(
                new Panel {
                    Content = new Separator(SeparatorOrientation.Horizontal),
                    Padding = new Padding(0, Utilities.Padding1, 0, Utilities.Padding3 + Utilities.Padding1)
                },
                new Panel {
                    Content = new Separator(SeparatorOrientation.Horizontal),
                    Padding = new Padding(0, Utilities.Padding1, 0, Utilities.Padding3 + Utilities.Padding1)
                }
            ));

            Rows.Add(new TableRow(
                new Panel {
                    Content = new Label { Text = Desktop.Properties.Resources.OptionsPathsSoftwareDaemon },
                    Padding = new Padding(0, 0, 0, Utilities.Padding3)
                },
                PathSelectorSoftwareDaemon
            ));

            Rows.Add(new TableRow(
                new Panel {
                    Content = new Label { Text = Desktop.Properties.Resources.OptionsPathsSoftwareAccountManager },
                    Padding = new Padding(0, 0, 0, Utilities.Padding3)
                },
                PathSelectorSoftwareAccountManager
            ));

            Rows.Add(new TableRow());
        }

        void LoadSettings()
        {
            var pathSettings = SettingsManager.Paths;
            PathSelectorDirectoryDaemonData.SelectedPath = pathSettings.DirectoryDaemonData;
            PathSelectorFileAccountData.SelectedPath = pathSettings.FileAccountData;
            PathSelectorDirectoryAccountBackups.SelectedPath = pathSettings.DirectoryAccountBackups;
            PathSelectorSoftwareDaemon.SelectedPath = pathSettings.SoftwareDaemon;
            PathSelectorSoftwareAccountManager.SelectedPath = pathSettings.SoftwareAccountManager;
        }

        public void ApplySettings()
        {
            var pathSettings = SettingsManager.Paths;
            pathSettings.DirectoryDaemonData = PathSelectorDirectoryDaemonData.SelectedPath;
            pathSettings.FileAccountData = PathSelectorFileAccountData.SelectedPath;
            pathSettings.DirectoryAccountBackups = PathSelectorDirectoryAccountBackups.SelectedPath;
            pathSettings.SoftwareDaemon = PathSelectorSoftwareDaemon.SelectedPath;
            pathSettings.SoftwareAccountManager = PathSelectorSoftwareAccountManager.SelectedPath;
        }
    }
}


text:
package net.java.main.models.spells;

public class Spell {
    private int damage;
    private int energyCost;

    protected Spell(int damage, int energyCost) {
        this.damage = damage;
        this.energyCost = energyCost;
    }

    public int getDamage() {
        return this.damage;
    }

    public int getEnergyCost() {
        return this.energyCost;
    }
}


text:
package com.amazonaws.transform;

import com.amazonaws.SdkClientException;
import com.amazonaws.util.Base64;
import com.amazonaws.util.DateUtils;
import com.amazonaws.util.TimestampFormat;
import com.fasterxml.jackson.core.JsonToken;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.Date;

public class SimpleTypeJsonUnmarshallers {
    /**
     * Unmarshaller for String values.
     */
    public static class StringJsonUnmarshaller implements Unmarshaller<String, JsonUnmarshallerContext> {
        public String unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            return unmarshallerContext.readText();
        }

        private static final StringJsonUnmarshaller instance = new StringJsonUnmarshaller();

        public static StringJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for fields with JSON values. For headers, JSON values are base-64 encoded and are decoded here. For payloads,
     * JSON values are treated like normal strings.
     */
    public static class JsonValueStringUnmarshaller extends StringJsonUnmarshaller {
        public String unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String stringValue = super.unmarshall(unmarshallerContext);
            return !unmarshallerContext.isInsideResponseHeader()
                   ? stringValue
                   : new String(Base64.decode(stringValue), Charset.forName("utf-8"));
        }

        private static final JsonValueStringUnmarshaller INSTANCE = new JsonValueStringUnmarshaller();
        public static JsonValueStringUnmarshaller getInstance() {
            return INSTANCE;
        }
    }

    /**
     * Unmarshaller for Double values.
     */
    public static class DoubleJsonUnmarshaller implements Unmarshaller<Double, JsonUnmarshallerContext> {
        public Double unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String doubleString = unmarshallerContext.readText();
            return (doubleString == null) ? null : Double.parseDouble(doubleString);
        }

        private static final DoubleJsonUnmarshaller instance = new DoubleJsonUnmarshaller();

        public static DoubleJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Integer values.
     */
    public static class IntegerJsonUnmarshaller implements Unmarshaller<Integer, JsonUnmarshallerContext> {
        public Integer unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String intString = unmarshallerContext.readText();
            return (intString == null) ? null : Integer.parseInt(intString);
        }

        private static final IntegerJsonUnmarshaller instance = new IntegerJsonUnmarshaller();

        public static IntegerJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    public static class BigIntegerJsonUnmarshaller implements Unmarshaller<BigInteger, JsonUnmarshallerContext> {
        public BigInteger unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String intString = unmarshallerContext.readText();
            return (intString == null) ? null : new BigInteger(intString);
        }

        private static final BigIntegerJsonUnmarshaller instance = new BigIntegerJsonUnmarshaller();

        public static BigIntegerJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    public static class BigDecimalJsonUnmarshaller implements Unmarshaller<BigDecimal, JsonUnmarshallerContext> {
        public BigDecimal unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String s = unmarshallerContext.readText();
            return (s == null) ? null : new BigDecimal(s);
        }

        private static final BigDecimalJsonUnmarshaller instance = new BigDecimalJsonUnmarshaller();

        public static BigDecimalJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Boolean values.
     */
    public static class BooleanJsonUnmarshaller implements Unmarshaller<Boolean, JsonUnmarshallerContext> {
        public Boolean unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String booleanString = unmarshallerContext.readText();
            return (booleanString == null) ? null : Boolean.parseBoolean(booleanString);
        }

        private static final BooleanJsonUnmarshaller instance = new BooleanJsonUnmarshaller();

        public static BooleanJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Float values.
     */
    public static class FloatJsonUnmarshaller implements Unmarshaller<Float, JsonUnmarshallerContext> {
        public Float unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String floatString = unmarshallerContext.readText();
            return (floatString == null) ? null : Float.valueOf(floatString);
        }

        private static final FloatJsonUnmarshaller instance = new FloatJsonUnmarshaller();

        public static FloatJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Long values.
     */
    public static class LongJsonUnmarshaller implements Unmarshaller<Long, JsonUnmarshallerContext> {
        public Long unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String longString = unmarshallerContext.readText();
            return (longString == null) ? null : Long.parseLong(longString);
        }

        private static final LongJsonUnmarshaller instance = new LongJsonUnmarshaller();

        public static LongJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Byte values.
     */
    public static class ByteJsonUnmarshaller implements Unmarshaller<Byte, JsonUnmarshallerContext> {
        public Byte unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String byteString = unmarshallerContext.readText();
            return (byteString == null) ? null : Byte.valueOf(byteString);
        }

        private static final ByteJsonUnmarshaller instance = new ByteJsonUnmarshaller();

        public static ByteJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Date values - JSON dates come in as epoch seconds for AWS services and ISO8601 string
     * for API Gateway fronted services..
     */
    public static class DateJsonUnmarshaller implements Unmarshaller<Date, JsonUnmarshallerContext> {
        public Date unmarshall(JsonUnmarshallerContext unmarshallerContext)
                throws Exception {
            // If value is string, assume ISO8601. Otherwise parse as epoch seconds.
            if (unmarshallerContext.getCurrentToken() == JsonToken.VALUE_STRING) {
                return DateUtils.parseISO8601Date(unmarshallerContext.readText());
            } else {
                return DateUtils.parseServiceSpecificDate(unmarshallerContext.readText());
            }
        }

        private static final DateJsonUnmarshaller instance = new DateJsonUnmarshaller();

        public static DateJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    public static class DateJsonUnmarshallerFactory implements Unmarshaller<Date, JsonUnmarshallerContext> {

        private final String dateFormatType;

        private DateJsonUnmarshallerFactory(String dateFormatType) {
            this.dateFormatType = dateFormatType;
        }

        @Override
        public Date unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String dateString = unmarshallerContext.readText();
            if (dateString == null) {
                return null;
            }

            try {
                if (TimestampFormat.RFC_822.getFormat().equals(dateFormatType)) {
                    return DateUtils.parseRFC822Date(dateString);
                }

                if (TimestampFormat.UNIX_TIMESTAMP.getFormat().equals(dateFormatType)) {
                    return DateUtils.parseServiceSpecificDate(dateString);
                }

                if (TimestampFormat.UNIX_TIMESTAMP_IN_MILLIS.getFormat().equals(dateFormatType)) {
                    return DateUtils.parseUnixTimestampInMillis(dateString);
                }

                return DateUtils.parseISO8601Date(dateString);
            } catch (Exception exception) {
                // fallback to the original behavior.
                return DateJsonUnmarshaller.getInstance().unmarshall(unmarshallerContext);
            }
        }

        public static DateJsonUnmarshallerFactory getInstance(String dateFormatType) {
            return new DateJsonUnmarshallerFactory(dateFormatType);
        }
    }

    /**
     * Unmarshaller for ByteBuffer values.
     */
    public static class ByteBufferJsonUnmarshaller implements Unmarshaller<ByteBuffer, JsonUnmarshallerContext> {
        public ByteBuffer unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String base64EncodedString = unmarshallerContext.readText();
            if (base64EncodedString == null) {
                return null;
            }
            byte[] decodedBytes = Base64.decode(base64EncodedString);
            return ByteBuffer.wrap(decodedBytes);

        }

        private static final ByteBufferJsonUnmarshaller instance = new ByteBufferJsonUnmarshaller();

        public static ByteBufferJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Character values.
     */
    public static class CharacterJsonUnmarshaller implements Unmarshaller<Character, JsonUnmarshallerContext> {
        public Character unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String charString = unmarshallerContext.readText();

            if (charString == null) return null;

            charString = charString.trim();
            if (charString.isEmpty() || charString.length() > 1)
                throw new SdkClientException("'" + charString
                        + "' cannot be converted to Character");
            return Character.valueOf(charString.charAt(0));
        }

        private static final CharacterJsonUnmarshaller instance = new CharacterJsonUnmarshaller();

        public static CharacterJsonUnmarshaller getInstance() {
            return instance;
        }
    }

    /**
     * Unmarshaller for Short values.
     */
    public static class ShortJsonUnmarshaller implements Unmarshaller<Short, JsonUnmarshallerContext> {
        public Short unmarshall(JsonUnmarshallerContext unmarshallerContext) throws Exception {
            String shortString = unmarshallerContext.readText();
            return (shortString == null) ? null : Short.valueOf(shortString);
        }

        private static final ShortJsonUnmarshaller instance = new ShortJsonUnmarshaller();

        public static ShortJsonUnmarshaller getInstance() {
            return instance;
        }
    }
}


text:
<?php

namespace Application\Database;

use Zend\Db\Adapter\Adapter;
use Zend\Db\Sql\Sql;

class UsersTable{

  private $adapter;
  private $sql;

  public function __construct($username, $password, $database)
  {

    $this->adapter = new Adapter(array(

      "driver"    => "Pdo_Mysql",
      "hostname"  => "127.0.0.1",
      "port"      => "8889",
      "username"  => $username,
      "password"  => $password,
      "database"  => $database,

    ));

    $this->sql = new Sql($this->adapter);

  }

  public function getAllUsers()
  {

     $select = $this->sql->select()->from("USERS");

     $query = $this->sql->buildSqlString($select);

     return $this->adapter->query($query)->execute();

  }

  public function getUserById($id){

    $select = $this->sql->select()->from("USERS")->where(array("id"=>$id));

    $query = $this->sql->buildSqlString($select);

    return $this->adapter->query($query)->execute();

  }

  public function getUserByIdRange($min, $max){

    $select = $this->sql->select()->from("USERS")->where("id BETWEEN $min AND $max");

    $query = $this->sql->buildSqlString($select);

    return $this->adapter->query($query)->execute();

  }

}//UsersTable

 ?>


text:
<ValueSet xmlns="http://hl7.org/fhir">
	<meta>
		<lastUpdated value="2016-08-29T00:00:00+00:00"/>
	</meta>
	<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
		<valueInteger value="1"/>
	</extension>
	<url value="https://fhir.hl7.org.uk/ValueSet/CareConnect-ConditionEpisodicity-1"/>
	<version value="1.0.0"/>
	<name value="Care Connect Condition Episodicity"/>
	<status value="active"/>
	<publisher value="HL7 UK"/>
	<description value="Specifies the episodicity of a condition."/>
	<copyright value="Copyright © 2016 HL7 UK

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

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

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

HL7® FHIR® standard Copyright © 2011+ HL7

The HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at

https://www.hl7.org/fhir/license.html"/>
	<codeSystem>
		<system value="https://fhir.hl7.org.uk/CareConnect-ConditionEpisodicity"/>
		<concept>

			<display value="First"/>
			<definition value="The first episode of a condition."/>
		</concept>
		<concept>

			<display value="New"/>
			<definition value="A new episode of a previously recorded condition."/>
		</concept>
		<concept>

			<display value="Review"/>
			<definition value="A review of an existing condition episode."/>
		</concept>
		<concept>

			<display value="Flare"/>
			<definition value="A flare-up of an existing condition episode."/>
		</concept>
		<concept>

			<display value="End"/>
			<definition value="Marks the end of an existing condition episode."/>
		</concept>
	</codeSystem>
</ValueSet>


text:
package org.openas2.app;

import java.util.Arrays;

public class OpenAS2WindowsService {
    @SuppressWarnings("unused")
    private static OpenAS2Server server;

    public static boolean stop = false;

    public static void main(String[] args) throws Exception {
        String parm = "start";
        String[] params = {};
        if (args.length > 0) {
            parm = args[0];
            params = Arrays.copyOfRange(args, 1, args.length);
        }
        if ("start".equals(parm)) {
            start(params);
        } else if ("stop".equals(args[0])) {
            stop(args);
        }
    }

    public static void stop(String[] params) {
        System.exit(0);
    }

    public static void start(String[] params) throws Exception {
        server = new OpenAS2Server.Builder().registerShutdownHook().run(params);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<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>

    <artifactId>cloudkeeper-dsl</artifactId>

    <name>CloudKeeper DSL</name>
    <packaging>jar</packaging>
    <description>
        Interfaces and Java Bean-style classes that constitute the CloudKeeper object model, consisting of modules,
        declarations, and repositories. Includes Java Architecture for XML Binding (JAXB) annotations.
    </description>

    <parent>
        <groupId>xyz.cloudkeeper.core</groupId>
        <artifactId>cloudkeeper-core</artifactId>
        <version>2.0.0.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>xyz.cloudkeeper.core</groupId>
            <artifactId>cloudkeeper-model</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>xyz.cloudkeeper.core</groupId>
            <artifactId>cloudkeeper-asm-repackaged-5.0</artifactId>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
"""
This file is part of the everest project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.

Created on Nov 22, 2011.
"""
from everest.messaging import IUserMessageNotifier
from everest.tests.simple_app.entities import FooEntity
from everest.tests.simple_app.resources import FooMember
from everest.views.postcollection import PostCollectionView
from everest.views.putmember import PutMemberView
from pyramid.threadlocal import get_current_registry

__docformat__ = 'reStructuredText en'
__all__ = ['UserMessagePutMemberView',
           'UserMessagePostCollectionView',
           ]

class UserMessagePostCollectionView(PostCollectionView):
    message = 'This is my warning message'
    def _extract_request_data(self):
        foo = FooEntity(name=self.request.body)
        return FooMember(foo)

    def _process_request_data(self, data):
        reg = get_current_registry()
        msg_notifier = reg.getUtility(IUserMessageNotifier)
        if msg_notifier.notify(self.message):
            return PostCollectionView._process_request_data(self, data)

class UserMessagePutMemberView(PutMemberView):
    message = 'This is my member warning message'
    def _extract_request_data(self):
        reg = get_current_registry()
        msg_notifier = reg.getUtility(IUserMessageNotifier)
        msg_notifier.notify(self.message)
        return self.context

    def _process_request_data(self, data):
        return self._get_result(data)

class _ExtractDataExceptionViewMixin(object):
    def _extract_request_data(self):
        raise ValueError()

class _ProcessDataExceptionViewMixin(object):
    def _process_request_data(self, data): # pylint: disable=W0613
        raise ValueError()

class ExceptionPutMemberView(_ExtractDataExceptionViewMixin, PutMemberView):
    pass

class ExceptionPostCollectionView(_ProcessDataExceptionViewMixin,
                                  PutMemberView):
    pass


text:
package com.microsoft.bingads.customermanagement;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="User" type="{https://bingads.microsoft.com/Customer/v9/Entities}User" minOccurs="0"/>
 *         <element name="Roles" type="{http://schemas.microsoft.com/2003/10/Serialization/Arrays}ArrayOfint" minOccurs="0"/>
 *         <element name="Accounts" type="{http://schemas.microsoft.com/2003/10/Serialization/Arrays}ArrayOflong" minOccurs="0"/>
 *         <element name="Customers" type="{http://schemas.microsoft.com/2003/10/Serialization/Arrays}ArrayOflong" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "user",
    "roles",
    "accounts",
    "customers"
})
@XmlRootElement(name = "GetUserResponse")
public class GetUserResponse {

    @XmlElement(name = "User", nillable = true)
    protected User user;
    @XmlElement(name = "Roles", nillable = true)
    protected ArrayOfint roles;
    @XmlElement(name = "Accounts", nillable = true)
    protected ArrayOflong accounts;
    @XmlElement(name = "Customers", nillable = true)
    protected ArrayOflong customers;

    /**
     * Gets the value of the user property.
     *
     * @return
     *     possible object is
     *     {@link User }
     *
     */
    public User getUser() {
        return user;
    }

    /**
     * Sets the value of the user property.
     *
     * @param value
     *     allowed object is
     *     {@link User }
     *
     */
    public void setUser(User value) {
        this.user = value;
    }

    /**
     * Gets the value of the roles property.
     *
     * @return
     *     possible object is
     *     {@link ArrayOfint }
     *
     */
    public ArrayOfint getRoles() {
        return roles;
    }

    /**
     * Sets the value of the roles property.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOfint }
     *
     */
    public void setRoles(ArrayOfint value) {
        this.roles = value;
    }

    /**
     * Gets the value of the accounts property.
     *
     * @return
     *     possible object is
     *     {@link ArrayOflong }
     *
     */
    public ArrayOflong getAccounts() {
        return accounts;
    }

    /**
     * Sets the value of the accounts property.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOflong }
     *
     */
    public void setAccounts(ArrayOflong value) {
        this.accounts = value;
    }

    /**
     * Gets the value of the customers property.
     *
     * @return
     *     possible object is
     *     {@link ArrayOflong }
     *
     */
    public ArrayOflong getCustomers() {
        return customers;
    }

    /**
     * Sets the value of the customers property.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOflong }
     *
     */
    public void setCustomers(ArrayOflong value) {
        this.customers = value;
    }

}


text:
package org.apache.somewhere.general;

import org.apache.commons.rdf.api.* ;

public class RDFGeneralFactory implements RDFTermFactory {
    static RDFTermFactory factory = new RDFGeneralFactory() ;

    @Override
    public BlankNode createBlankNode() {
        return new BlankNodeImpl() ;
    }

    @Override
    public BlankNode createBlankNode(String identifier) {
        return new BlankNodeImpl(identifier) ;
    }

    @Override
    public Graph createGraph() {
        return new GraphImpl() ;
    }

    @Override
    public IRI createIRI(String iri) {
        return new IRIImpl(iri) ;
    }

    @Override
    public Literal createLiteral(String lexicalForm) {
        return new LiteralImpl(lexicalForm, C.xsdString, null) ;
    }

    @Override
    public Literal createLiteral(String lexicalForm, IRI dataType) {
        return new LiteralImpl(lexicalForm, dataType, null) ;
    }

    @Override
    public Literal createLiteral(String lexicalForm, String languageTag) {
        return new LiteralImpl(lexicalForm, C.rdfLangString, languageTag) ;
    }

    @Override
    public Triple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
        return new TripleImpl(subject, predicate, object) ;
    }
}


text:
package io.jsonwebtoken.impl;

import io.jsonwebtoken.MalformedJwtException;
import io.jsonwebtoken.io.DeserializationException;
import io.jsonwebtoken.io.Deserializer;
import io.jsonwebtoken.io.IOException;
import io.jsonwebtoken.lang.Assert;

import java.nio.charset.StandardCharsets;

/**
 * A {@link Deserializer} implementation that wraps another Deserializer implementation to add common JWT related
 * error handling.
 * @param <T> type of object to deserialize.
 * @since 0.11.3
 */
class JwtDeserializer<T> implements Deserializer<T> {

    static final String MALFORMED_ERROR = "Malformed JWT JSON: ";
    static final String MALFORMED_COMPLEX_ERROR = "Malformed or excessively complex JWT JSON. This could reflect a potential malicious JWT, please investigate the JWT source further. JSON: ";

    private final Deserializer<T> deserializer;

    JwtDeserializer(Deserializer<T> deserializer) {
        Assert.notNull(deserializer, "deserializer cannot be null.");
        this.deserializer = deserializer;
    }

    @Override
    public T deserialize(byte[] bytes) throws DeserializationException {
        try {
            return deserializer.deserialize(bytes);
        } catch (DeserializationException e) {
            throw new MalformedJwtException(MALFORMED_ERROR + new String(bytes, StandardCharsets.UTF_8), e);
        } catch (StackOverflowError e) {
            throw new IOException(MALFORMED_COMPLEX_ERROR + new String(bytes, StandardCharsets.UTF_8), e);
        }
    }
}


text:
layout: doc
title: Ancora su JOSM
permalink: /it/josm/more-about-josm/
lang: it
category: josm
---

Ancora su JOSM
==============
Nella sezione precedente hai installato JOSM e hai iniziato a disegnare i tuoi
primi nodi, linee e forme. Hai aggiunto impostazioni a questi oggetti in
modo da inserire informazioni a loro riguardo. Alla fine, sei stato in
grado di disegnare la tua mappa con JOSM.

È stato un buon esercizio, adesso siamo pronti per editare su OpenStreetMap.

In questa sezione daremo un'occhiata più approfondita all'interfaccia di JOSM e
scopriremo come usarla per modificare la mappa di OpenStreetMap.

Il ciclo di mappatura
---------------------
Modificare la mappa con JOSM è simile all'utilizzo dell'editor iD visto in precedenza.
Poichè JOSM è un'applicazione, lavora un modo differente.
Il processo di modifica o di aggiunta di dati in OpenStreetMap con JOSM segue sempre
lo stesso ciclo:

1. **Download**: scaricare i dati correnti da OSM
2. **Edit**: modificarli usando GPS, Field Paper e note come guida
3. **Save**: salvare le modifiche e caricarle su OpenStreetMap

Scaricare i dati di OSM
-----------------------
Il primo passo è quello di scaricare i dati per quella porzione di mondo che vogliamo
migliorare.   Ricordati che dovrai fare questo ogni volta che intendi fare delle modifiche,
perché la mappa è aggiornata spesso anche da altri utenti.

-	Fai clic su "File" nel menù in alto a sinistra di JOSM e seleziona "Scarica da
    OSM". Si aprirà la finestra di selezione. Puoi accedere a questa finestra più rapidamente
    premendo il bottone mostrato qui sotto:

![JOSM Download Button][]

-  Quando si apre la finestra di selezione, vedrai una mappa con un rettangolo rosa.
   Se non vedi la mappa, fai clic sul tab "Slippy map".

![JOSM Download Dialog][]

-  Il riquadro rosa rappresenta l'area della mappa che vorremmo
    scaricare e modificare. Usa il mouse per spostarti o ingrandire una zona
    che conosci bene, come il tuo paese o il circondario.
    I controlli sono uguali alla finestra principale di JOSM. Col bottone destro del
    mouse puoi spostare la mappa, con la rotella ingrandire o ridurre la visuale.

>	Talvolta ti capiterà di lavorare su un computer portatile, e troverai
>       difficile fare zoom.  Lavorare con JOSM è più facile utilizzando un mouse,
>	anche se i portatili moderni permettono lo zoom utilizzando il touchpad.

-	Disegna un rettangolo intorno all'area che vuoi scaricare. Tieni
        premuto il tasto sinistro del mouse e trascina il mouse per creare un rettangolo.
      Rilascia il pulsante del mouse per terminare il disegno.
-  Quando sarai soddisfatto della dimensione e della posizione del rettangolo, premi il tasto
    "Scarica" al fondo della finestra.   Josm scaricherà da OpenStreetMap i dati compresi
    nell'area selezionata e li visualizzerà nella finestra della mappa per permettere
     le modifiche.

### Aggiungere un'immagine aerea
Se ti ricordi quando abbiamo aggiunto il primo punto con l'editor iD, avrai notato
che sotto i dati della mappa c'era un'immagine satellitare, utile per identificare
gli oggetti al suolo. Quest'immagine era fornita da Bing di Microsoft, che generosamente
mette a disposizione le proprie immagini per aiutare gli utenti di OSM a contribuire alla mappa.

-	Per aggiungere le immagini aeree di Bing in Josm, seleziona dal menù in alto
"Immagini aeree" e poi scegli "Bing Sat".

>   Se non trovi "Bing Sat" nel menù, attivalo nelle preferenze di JOSM.
>   Vai nel menù "Modifica" -> "Preferenze" e fai clic sull'icona
>   "WMS TMS". Se non lo trovi prova a cliccare la freccia verso il basso.
>
>	![JOSM Preferences up down][]
>	![JOSM Preferences WMS TMS][]
>
>   Fai clic su "Bing Sat" poi su "Attiva".

### Tour di JOSM
Ora che hai scaricato i dati da OpenStreetMap e le immagini satellitari, diamo un'occhiata
all'interfaccia di JOSM.

![JOSM layout][]

Questa è la finestra della mappa dove si svolge la maggior parte dell'azione.
Qui visualizzerai i dati di OpenStreetMap, li editerai e ne aggiungerai di nuovi.

Sulla destra della finestra ci sono una serie di pannelli, ognuno dei quali
ha una diversa funzione.  Tipicamente con l'installazione di JOSM è mostrato
un certo numero di pannelli: "Livelli", "Etichette/Appartenenze" e "Selezione".
Quando nell'area della mappa selezioni un punto, una linea o un'area verrà
mostrato nella finestra "Selezione". Le informazioni sull'oggetto selezionato appariranno
nella finestra "Etichette/Appartenenze", mentre il nome utente dell'autore sarà mostrato
nella finestra "Autore".

Questi pannelli possono essere aperti o chiusi cliccando sui vari bottoni presenti sul lato in basso a sinistra di JOSM.  Sopra questi bottoni, in alto a destra, ci sono degli strumenti che possono cambiare quello che puoi fare col mouse.  Avrai già familiarizzato con alcuni di essi: la selezione e il disegno.  Sotto di essi trovi strumenti per fare lo zoom, cancellare un oggetto, disegnare una forma o creare una linea parallela ad un'altra linea.

Edit
----
Abbiamo così completato il primo passo del processo di editing: lo scarico dei dati.  Abbiamo anche aggiunto in JOSM le immagini satellitari come riferimento. Il passo successivo consiste nel modificare la mappa e aggiungere nuovi oggetti.

A seconda dell'area scaricata, possono esserci molti oggetti oppure molto pochi. Comunque sia, questi sono gli stessi tre tipi di dati visti in precedenza: punti, linee e aree che rappresentano i luoghi reali.

- usa le tecniche imparate in precedenza per aggiungere alcuni punti alla mappa in posti che conosci. Se vedi degli errori, prova a correggerli.
- Non è necessario essere aggressivi in queste fasi: se non sei sicuro delle modifiche, lascia le cose come le trovi.
- Se vuoi muovere un punto, una linea o un'area usa lo **strumento di selezione**.  Fai clic su un oggetto e trascinalo nella sua nuova posizione. Questo sistema può essere usato per correggere la posizione di oggetti posizionati in maniera imprecisa.

![JOSM select tool][]

-  Usa lo **strumento di disegno** per disegnare nuovi punti, linee o forme. Aggiungi informazioni a questi oggetti utilizzando il menù "Preimpostazioni", come hai già fatto in precedenza.
> Non editare mai la mappa al di fuori della zona scaricata.
> Puoi vedere la zona scaricata come l'area rettangolare dallo sfondo uniforme, mentre l'area non scaricata è evidenziata con linee oblique.
>	![JOSM area downloaded][]

Salva le modifiche
--------------
Il terzo ed ultimo passo per completare le modifiche è quello di salvarle
e caricarle su OpenStreetMap. Per caricarle devi essere connesso ad internet.

-  Clicca "File" nel menù in alto e premi "Carica dati". Questo aprirà
    la finestra di upload. Puoi accedere alla finestra più
    semplicemente premendo il bottone di upload, mostrato di seguito:

![JOSM Upload Button][]

-  La finestra che appare mostra una lista di oggetti che stai per
    aggiungere o che stai per modificare o cancellare. Nel box in basso
    ti viene chiesto di inserire un commento sulle modifiche che stai
    per fare. Scrivici la descrizione delle tue modifiche.

![JOSM Upload Dialog][]

-  Clicca "Carica le modifiche".
-  Se questa è la prima volta che salvi delle modifiche, ti verrà
    chiesto il nome utente e la password.
-   Inseriscile nella finestra che appare. Se metti la spunta nella
    casella, le tue credenziali verranno salvate e non ti servirà
    inserirle di nuovo in futuro. Clicca "Autentica".

![JOSM Authenticate][]

-  Devi aspettare finché non termina l'upload dei cambiamenti e hai
    finito!

>	Assicurati di caricare le modifiche prima di chiudere JOSM.
>	Anche se hai altri edit da fare, carica le modifiche e poi continua ad editare.
>	Non vorrai certo perdere il tuo lavoro!

Guarda sulla Mappa le tue modifiche
-----------------------------------

-  Apri il tuo browser e vai su
    [openstreetmap.org](http://openstreetmap.org)
-  Sposta la mappa sull'area che hai modificato.
-  Dovresti vedere le tue modifiche apparire sulla mappa! Se non
    succede, prova a premere CTRL+R per aggiornare la pagina. A volte la
    mappa non si aggiorna e necessita di essere ricaricata.
-  E se non vedi le tue modifiche? Non ti preoccupare - ci vorrà
    qualche minuto affinché le modifiche vengano mostrate sulla mappa.
    Controlla poi le tue aggiunte in JOSM per essere sicuro che le hai
    inserite correttamente. Una buona regola generale è che se il tuo
    punto ha una icona in JOSM, allora dovrebbe essere visualizzato
    anche dal sito di OpenStreetMap.

Conclusioni
-----------

Adesso che hai visto come aggiungere dati a OpenStreetMap, cosa c'è
dopo?  Editare è importante, ma non è il solo aspetto per fare le mappe.
Devi anche imparare a uscire e prendere informazioni sul campo.

Nelle prossime sezioni impareremo due metodi - GPS and Field Papers - usati
per raccogliere dati geografici. Le informazioni raccolte potranno essere utilizzate per migliorare la mappa.

[JOSM Download Button]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image00_download-button.png
[JOSM Download Dialog]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image01_download-dialog.png
[JOSM Preferences up down]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image02_preferences-up-down.png
[JOSM Preferences WMS TMS]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image03_preferences-wms-tms.png
[JOSM layout]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image04_layout.png
[JOSM select tool]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image05_select-tool.png
[JOSM area downloaded]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image06_area-downloaded.png
[JOSM Upload Button]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image07_upload-button.png
[JOSM Upload Dialog]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image08_upload-dialog.png
[JOSM Authenticate]: /images/it/beginner/04_more-about-josm/it_beg_04_more-about-josm_image09_authenticate.png


text:
using Amberframe.UI.Abstractions.Events;

namespace Amberframe.UI.Events
{
    public class ButtonEvent : IButtonEvent
    {
        public object Sender { get; }

        public ButtonEvent(object sender)
        {
            Sender = sender;
        }
    }
}


text:
#ifndef _IF_X25_H
#define _IF_X25_H
#include <linux/types.h>
#define X25_IFACE_DATA 0x00
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define X25_IFACE_CONNECT 0x01
#define X25_IFACE_DISCONNECT 0x02
#define X25_IFACE_PARAMS 0x03
#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */


text:
using kagv.DLL_source;
using System.Collections.Generic;

namespace kagv {

    public partial class MainForm  {

        //function that returns a list that contains the Available for action _AGVs
        private List<GridPos> NotTrappedVehicles(List<GridPos> vehicles, GridPos end) {
            //Vehicles is a list with all the _AGVs that are inserted in the Grid by the user
            short listIndex = 0;
            short trappedIndex = 0;

            //First, we must assume that ALL the _AGVs are trapped and cannot move (trapped means they are prevented from reaching the END block)
            for (int i = 0; i < _trappedStatus.Length; i++)
                _trappedStatus[i] = true;

            do {
                bool removed = false;
                _jumpParam.Reset(vehicles[listIndex], end); //we use the A* setting function and pass the
                                                            //initial start point of every AGV and the final destination (end block)
                if (AStarFinder.FindPath(_jumpParam, nud_weight.Value).Count == 0) //if the number of JumpPoints that is calculated is 0 (zero)
                {                                                          //it means that there was no path found
                    vehicles.Remove(vehicles[listIndex]); //we removed, from the returning list, the AGV for which there was no path found
                    _AGVs.Remove(_AGVs[listIndex]); //we remove the corresponding AGV from the public list that contains all the _AGVs which will participate in the simulation
                    removed = true;
                } else
                    _trappedStatus[trappedIndex] = false; //since it's not trapped, we switch its state to false

                if (!removed) {
                    _AGVs[listIndex].ID = listIndex;
                    listIndex++;
                }
                trappedIndex++;
            }
            while (listIndex < vehicles.Count); //the above process will be repeated until all elements of the incoming List are parsed.
            return vehicles; //list with NOT TRAPPED _AGVs' starting points (trapped _AGVs have been removed)

            //the point of this function is to consider every AGV as trap and then find out which _AGVs
            //eventually, are not trapped and keep ONLY those ones.
        }
    }
}


text:
namespace blink {

class DiskDataMetadata {
 public:
  int64_t start_offset() const { return start_offset_; }
  size_t size() const { return size_; }

 private:
  DiskDataMetadata(int64_t start_offset, size_t size)
      : start_offset_(start_offset), size_(size) {}
  DiskDataMetadata(const DiskDataMetadata& other) = default;
  DiskDataMetadata(DiskDataMetadata&& other) = default;
  DiskDataMetadata& operator=(const DiskDataMetadata& other) = default;

  int64_t start_offset_;
  size_t size_;

  friend class DiskDataAllocator;
};

}  // namespace blink
#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_DISK_DATA_METADATA_H_


text:
layout:     post
title:      depiction of a girl 4
date:       2015-09-08 19:50:16
summary:
categories: drawing
---
![depiction of a girl 4](/images/diary/depiction-of-a-girl-4.png "Like a lotus.")


text:
'use strict';

module.exports = {
	appendFile:         require('./append-file'),
	chmod:              require('./chmod'),
	copy:               require('./copy'),
	descriptorsHandler: require('./descriptors-handler'),
	isIgnored:          require('./is-ignored'),
	lchmod:             require('./lchmod'),
	lstat:              require('./lstat'),
	mkdir:              require('./mkdir'),
	readFile:           require('./read-file'),
	readdir:            require('./readdir'),
	rename:             require('./rename'),
	rmdir:              require('./rmdir'),
	stat:               require('./stat'),
	symlink:            require('./symlink'),
	typeByStats:        require('./type-by-stats'),
	unlink:             require('./unlink'),
	watch:              require('./watch'),
	watchPath:          require('./watch-path'),
	writeFile:          require('./write-file')
};


text:
'use strict';

module.exports = fetchObject;

const { pipeline: _ } = require('stream');
const { promisify } = require('util');
const fetch = require('./fetch');
const cacache = require('cacache');
const ssri = require('ssri');

const pipeline = promisify(_);

const EMPTY_HASH =
  'z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==';
const EMPTY_BUF = Buffer.from([]);

async function fetchObject({ registry, cache }, integrity, load = false) {
  const parsed = ssri.parse(integrity);
  const algo = parsed.pickAlgorithm();
  const [{ digest }] = parsed[algo];

  if (digest === EMPTY_HASH && algo === 'sha512') {
    return load ? { data: EMPTY_BUF } : true;
  }

  if (await cacache.get.hasContent(cache, integrity)) {
    return load ? cacache.get(cache, integrity) : true;
  }

  const response = await fetch(
    `${registry}/v1/objects/object/${algo}/${encodeURIComponent(digest)}`
  );

  if (response.status > 399) {
    throw new Error('error fetching object');
  }

  let destIntegrity = null;
  const dest = cacache.put.stream(cache, integrity);
  dest.on('integrity', i => (destIntegrity = i));
  await pipeline(response.body, dest);

  if (!parsed.match(destIntegrity)) {
    throw new Error('file integrity mismatch!');
  }

  return load ? cacache.get(cache, integrity) : true;
}


text:
@implementation NSNotificationCenter (UniqueObserver)

-(void)addUniqueObserver:(id)observer selector:(SEL)selector name:(NSString *)name object:(id)object
{
    [[NSNotificationCenter defaultCenter] removeObserver:observer name:name object:object];
    [[NSNotificationCenter defaultCenter] addObserver:observer selector:selector name:name object:object];
}

@end


text:
using System;
using ColorManager.Conversion;

namespace ColorManagerTests
{
    public sealed class TestConversionPath : ConversionPath
    {
        public override IConversionCommand[] Commands
        {
            get { throw new NotImplementedException(); }
        }
        public override Type From
        {
            get { return ftp; }
        }
        public override Type To
        {
            get { return ttp; }
        }

        private Type ftp, ttp;

        public TestConversionPath(Type From, Type To)
        {
            ftp = From;
            ttp = To;
        }
    }
}


text:
package consumer

import (
	"bytes"
	"compress/zlib"
	"encoding/base64"
	"encoding/json"
	"errors"
	"fmt"
	"log"
	"net/url"
	"os"
	"time"

	"github.com/ricbra/rabbitmq-cli-consumer/command"
	"github.com/ricbra/rabbitmq-cli-consumer/config"
	"github.com/streadway/amqp"
)

const (
	EXIT_ACK            = 0
	EXIT_REJECT         = 3
	EXIT_REJECT_REQUEUE = 4
	EXIT_NACK           = 5
	EXIT_NACK_REQUEUE   = 6
	EMPTY_STRING        = "<empty>"
)

type Consumer struct {
	Channel         *amqp.Channel
	Connection      *amqp.Connection
	Queue           string
	Factory         *command.CommandFactory
	ErrLogger       *log.Logger
	InfLogger       *log.Logger
	Executer        *command.CommandExecuter
	Compression     bool
	IncludeMetadata bool
	StrictExitCode  bool
	OnFailure       int
}

type Properties struct {
	Headers         amqp.Table `json:"application_headers"`
	ContentType     string     `json:"content_type"`
	ContentEncoding string     `json:"content_encoding"`
	DeliveryMode    uint8      `json:"delivery_mode"`
	Priority        uint8      `json:"priority"`
	CorrelationId   string     `json:"correlation_id"`
	ReplyTo         string     `json:"reply_to"`
	Expiration      string     `json:"expiration"`
	MessageId       string     `json:"message_id"`
	Timestamp       time.Time  `json:"timestamp"`
	Type            string     `json:"type"`
	UserId          string     `json:"user_id"`
	AppId           string     `json:"app_id"`
}

type DeliveryInfo struct {
	MessageCount uint32 `json:"message_count"`
	ConsumerTag  string `json:"consumer_tag"`
	DeliveryTag  uint64 `json:"delivery_tag"`
	Redelivered  bool   `json:"redelivered"`
	Exchange     string `json:"exchange"`
	RoutingKey   string `json:"routing_key"`
}

func ConnectionCloseHandler(closeErr chan *amqp.Error, c *Consumer) {
	err := <-closeErr
	c.ErrLogger.Fatalf("Connection closed: %v", err)
	os.Exit(10)
}

func (c *Consumer) Consume(output bool) {
	c.InfLogger.Println("Registering consumer... ")
	msgs, err := c.Channel.Consume(c.Queue, "", false, false, false, false, nil)
	if err != nil {
		c.ErrLogger.Fatalf("Failed to register a consumer: %s", err)
	}

	c.InfLogger.Println("Succeeded registering consumer.")

	defer c.Connection.Close()
	defer c.Channel.Close()

	closeErr := make(chan *amqp.Error)
	closeErr = c.Connection.NotifyClose(closeErr)

	go ConnectionCloseHandler(closeErr, c)

	forever := make(chan bool)

	go func() {
		for d := range msgs {
			input := d.Body

			if c.IncludeMetadata {
				input, err = json.Marshal(&struct {
					Properties   `json:"properties"`
					DeliveryInfo `json:"delivery_info"`
					Body         string `json:"body"`
				}{

					Properties: Properties{
						Headers:         d.Headers,
						ContentType:     d.ContentType,
						ContentEncoding: d.ContentEncoding,
						DeliveryMode:    d.DeliveryMode,
						Priority:        d.Priority,
						CorrelationId:   d.CorrelationId,
						ReplyTo:         d.ReplyTo,
						Expiration:      d.Expiration,
						MessageId:       d.MessageId,
						Timestamp:       d.Timestamp,
						Type:            d.Type,
						AppId:           d.AppId,
						UserId:          d.UserId,
					},

					DeliveryInfo: DeliveryInfo{
						ConsumerTag:  d.ConsumerTag,
						MessageCount: d.MessageCount,
						DeliveryTag:  d.DeliveryTag,
						Redelivered:  d.Redelivered,
						Exchange:     d.Exchange,
						RoutingKey:   d.RoutingKey,
					},

					Body: string(d.Body),
				})
				if err != nil {
					c.ErrLogger.Fatalf("Failed to marshall: %s", err)
					d.Nack(true, true)
				}
			}

			if c.Compression {
				var b bytes.Buffer
				w, err := zlib.NewWriterLevel(&b, zlib.BestCompression)
				if err != nil {
					c.ErrLogger.Println("Could not create zlib handler")
					d.Nack(true, true)
				}
				c.InfLogger.Println("Compressed message")
				w.Write(input)
				w.Close()

				input = b.Bytes()
			}

			cmd := c.Factory.Create(base64.StdEncoding.EncodeToString(input))

			exitCode := c.Executer.Execute(cmd, output)

			err := c.ack(d, exitCode)

			if err != nil {
				c.ErrLogger.Fatalf("Message acknowledgement error: %v", err)
				os.Exit(11)
			}
		}
	}()

	c.InfLogger.Println("Waiting for messages...")
	<-forever
}

func (c *Consumer) ack(d amqp.Delivery, exitCode int) error {
	if c.StrictExitCode == false {
		if exitCode == EXIT_ACK {
			d.Ack(true)
			return nil
		}
		switch c.OnFailure {
		case EXIT_REJECT:
			d.Reject(false)
		case EXIT_REJECT_REQUEUE:
			d.Reject(true)
		case EXIT_NACK:
			d.Nack(true, false)
		case EXIT_NACK_REQUEUE:
			d.Nack(true, true)
		default:
			d.Nack(true, true)
		}
		return nil
	}

	switch exitCode {
	case EXIT_ACK:
		d.Ack(true)
	case EXIT_REJECT:
		d.Reject(false)
	case EXIT_REJECT_REQUEUE:
		d.Reject(true)
	case EXIT_NACK:
		d.Nack(true, false)
	case EXIT_NACK_REQUEUE:
		d.Nack(true, true)
	default:
		d.Nack(true, true)
		return errors.New(fmt.Sprintf("Unexpected exit code %v", exitCode))
	}

	return nil
}

func New(cfg *config.Config, factory *command.CommandFactory, errLogger, infLogger *log.Logger) (*Consumer, error) {
	uri := fmt.Sprintf(
		"amqp://%s:%s@%s:%s%s",
		url.QueryEscape(cfg.RabbitMq.Username),
		url.QueryEscape(cfg.RabbitMq.Password),
		cfg.RabbitMq.Host,
		cfg.RabbitMq.Port,
		cfg.RabbitMq.Vhost,
	)

	infLogger.Println("Connecting RabbitMQ...")
	conn, err := amqp.Dial(uri)
	if nil != err {
		return nil, errors.New(fmt.Sprintf("Failed connecting RabbitMQ: %s", err.Error()))
	}
	infLogger.Println("Connected.")

	infLogger.Println("Opening channel...")
	ch, err := conn.Channel()
	if nil != err {
		return nil, errors.New(fmt.Sprintf("Failed to open a channel: %s", err.Error()))
	}
	infLogger.Println("Done.")

	infLogger.Println("Setting QoS... ")
	// Attempt to preserve BC here
	if cfg.Prefetch.Count == 0 {
		cfg.Prefetch.Count = 3
	}
	if err := ch.Qos(cfg.Prefetch.Count, 0, cfg.Prefetch.Global); err != nil {
		return nil, errors.New(fmt.Sprintf("Failed to set QoS: %s", err.Error()))
	}
	infLogger.Println("Succeeded setting QoS.")

	infLogger.Printf("Declaring queue \"%s\"...", cfg.RabbitMq.Queue)
	_, err = ch.QueueDeclare(cfg.RabbitMq.Queue, true, false, false, false, sanitizeQueueArgs(cfg))

	if nil != err {
		return nil, errors.New(fmt.Sprintf("Failed to declare queue: %s", err.Error()))
	}

	// Check for missing exchange settings to preserve BC
	if "" == cfg.Exchange.Name && "" == cfg.Exchange.Type && !cfg.Exchange.Durable && !cfg.Exchange.Autodelete {
		cfg.Exchange.Type = "direct"
	}

	// Empty Exchange name means default, no need to declare
	if "" != cfg.Exchange.Name {
		infLogger.Printf("Declaring exchange \"%s\"...", cfg.Exchange.Name)
		err = ch.ExchangeDeclare(cfg.Exchange.Name, cfg.Exchange.Type, cfg.Exchange.Durable, cfg.Exchange.Autodelete, false, false, amqp.Table{})

		if nil != err {
			return nil, errors.New(fmt.Sprintf("Failed to declare exchange: %s", err.Error()))
		}

		// Bind queue
		infLogger.Printf("Binding queue \"%s\" to exchange \"%s\"...", cfg.RabbitMq.Queue, cfg.Exchange.Name)
		err = ch.QueueBind(cfg.RabbitMq.Queue, transformToStringValue(cfg.QueueSettings.Routingkey), transformToStringValue(cfg.Exchange.Name), false, nil)

		if nil != err {
			return nil, errors.New(fmt.Sprintf("Failed to bind queue to exchange: %s", err.Error()))
		}
	}

	return &Consumer{
		Channel:     ch,
		Connection:  conn,
		Queue:       cfg.RabbitMq.Queue,
		Factory:     factory,
		ErrLogger:   errLogger,
		InfLogger:   infLogger,
		Executer:    command.New(errLogger, infLogger),
		Compression: cfg.RabbitMq.Compression,
		OnFailure:   cfg.RabbitMq.Onfailure,
	}, nil
}

func sanitizeQueueArgs(cfg *config.Config) amqp.Table {

	args := make(amqp.Table)

	if cfg.QueueSettings.MessageTTL > 0 {
		args["x-message-ttl"] = int32(cfg.QueueSettings.MessageTTL)
	}

	if cfg.QueueSettings.DeadLetterExchange != "" {
		args["x-dead-letter-exchange"] = transformToStringValue(cfg.QueueSettings.DeadLetterExchange)

		if cfg.QueueSettings.DeadLetterRoutingKey != "" {
			args["x-dead-letter-routing-key"] = transformToStringValue(cfg.QueueSettings.DeadLetterRoutingKey)
		}
	}

	if len(args) > 0 {
		return args
	}

	return nil
}

func transformToStringValue(val string) string {
	if val == EMPTY_STRING {
		return ""
	}

	return val
}


text:
namespace pindrop {
class AudioEngine;
}

namespace fpl {

namespace zooshi {

struct AssetManifest;
class FullScreenFader;
struct World;

class LoadingState : public StateNode {
 public:
  LoadingState()
      : loading_complete_(false),
        asset_manager_(nullptr),
        asset_manifest_(nullptr),
        shader_textured_(nullptr),
        world_(nullptr),
        banner_rotation_(0.0f){}
  virtual ~LoadingState() {}
  void Initialize(fplbase::InputSystem* input_system, World* world,
                  const AssetManifest& asset_manifest,
                  fplbase::AssetManager* asset_manager,
                  pindrop::AudioEngine* audio_engine,
                  fplbase::Shader* shader_textured, FullScreenFader* fader);
  virtual void AdvanceFrame(int delta_time, int* next_state);
  virtual void Render(fplbase::Renderer* renderer);
  virtual void OnEnter(int previous_state);

 protected:
  // Set to true when the render thread detetects that all assets have been
  // loaded. The update thread then transitions to the next state.
  bool loading_complete_;

  // Holds the texture asynchronous loader thread that we are waiting for.
  // Also holds the loading texture that we display on screen.
  fplbase::AssetManager* asset_manager_;

  // Holds the audio asynchronous loader thread that we are waiting for.
  pindrop::AudioEngine* audio_engine_;

  // Holds the name of the loading texture that we display on screen.
  const AssetManifest* asset_manifest_;

  // Simple shader to draw the loading texture on screen.
  fplbase::Shader* shader_textured_;

  FullScreenFader* fader_;

  World *world_;

  // The input system so that we can get input.
  fplbase::InputSystem* input_system_;

  // Rotation around Y of the banner when a VR loading screen is in use.
  float banner_rotation_;
};

}  // zooshi
}  // fpl

#endif  // ZOOSHI_LOADING_STATE_H_


text:
import Ember from 'ember';
import { moduleFor, test } from 'ember-qunit';
let { RSVP } = Ember;
const { Promise } = RSVP;

moduleFor('service:ember-cordova/beacon', 'Unit | Service | ember-cordova/beacon', {
  unit: true,
  beforeEach() {
    this.subject({
      locationManager() {
        let lm = {
          startMonitoringForRegion(beaconRegion) {
            return Promise.resolve(beaconRegion);
          },
          stopMonitoringForRegion(beaconRegion) {
            return Promise.resolve(beaconRegion);
          },
          startRangingBeaconsInRegion(beaconRegion) {
            return Promise.resolve(beaconRegion);
          },
          stopRangingBeaconsInRegion(beaconRegion) {
            return Promise.resolve(beaconRegion);
          }
        };
        return Promise.resolve(lm);
      },
      _locationManager: {
        BeaconRegion(identifier, uuid, major, minor) {
          return {
            identifier: identifier,
            uuid: uuid,
            major: major,
            minor: minor,
            type: 'BeaconRegion'
          };
        }
      }
    });
  }
});

test('it adds beacon to be monitored', function(assert) {
  let service = this.subject();
  let done = assert.async();

  let beacon = {
    identifier: 'My Monitoring Beacon',
    uuid: 'mon-xxx-xxx',
    major: 1,
    minor: 2
  };

  service.startMonitoringBeacon(
    beacon.identifier,
    beacon.uuid,
    beacon.major,
    beacon.minor
  ).then(function(result) {
    assert.equal(result.identifier, beacon.identifier, 'beacon identifier should be set');
    assert.equal(result.major, beacon.major, 'beacon major should be set');
    assert.equal(result.minor, beacon.minor, 'beacon minor should be set');
    assert.equal(result.uuid, beacon.uuid, 'beacon uuid should be set');
    assert.notEqual(result.region, null, 'beacon region should be set');
    assert.equal(result.rssi, 0, 'beacon rssi should be set');
    assert.equal(result.accuracy, 0, 'beacon accuracy should be set');

    assert.equal(this.get('monitoringBeacons.length'), 1, '1 beacon should be assigned');
    done();
  }.bind(service));

  assert.ok(service);
  assert.equal(service.get('monitoringBeacons.length'), 0, 'no beacons should be assigned');
});

test('it adds beacon to be ranged', function(assert) {
  let service = this.subject();
  let done = assert.async();

  let beacon = {
    identifier: 'My Ranging Beacon',
    uuid: 'rng-xxx-xxx',
    major: 1,
    minor: 3
  };

  service.startRangingBeacon(
    beacon.identifier,
    beacon.uuid,
    beacon.major,
    beacon.minor
  ).then(function(result) {
    assert.equal(result.identifier, beacon.identifier, 'beacon identifier should be set');
    assert.equal(result.major, beacon.major, 'beacon major should be set');
    assert.equal(result.minor, beacon.minor, 'beacon minor should be set');
    assert.equal(result.uuid, beacon.uuid, 'beacon uuid should be set');
    assert.notEqual(result.region, null, 'beacon region should be set');
    assert.equal(result.rssi, 0, 'beacon rssi should be set');
    assert.equal(result.accuracy, 0, 'beacon accuracy should be set');

    assert.equal(this.get('rangingBeacons.length'), 1, '1 ranging beacon should be assigned');
    done();
  }.bind(service));

  assert.equal(service.get('rangingBeacons.length'), 0, 'no ranging beacons should be assigned');
});

test('it stops beacon from being monitored', function(assert) {
  let service = this.subject();
  let done = assert.async();

  let beacon = {
    identifier: 'My Monitoring Beacon',
    uuid: 'mon-xxx-xxx',
    major: 1,
    minor: 2
  };

  service.startMonitoringBeacon(
    beacon.identifier,
    beacon.uuid,
    beacon.major,
    beacon.minor
  );

  service.stopMonitoringBeacon(
    beacon.uuid,
    beacon.major,
    beacon.minor
  ).then(function(result) {
    assert.equal(result.identifier, beacon.identifier, 'beacon identifier should be set');
    assert.equal(result.major, beacon.major, 'beacon major should be set');
    assert.equal(result.minor, beacon.minor, 'beacon minor should be set');
    assert.equal(result.uuid, beacon.uuid, 'beacon uuid should be set');
    assert.notEqual(result.region, null, 'beacon region should be set');
    assert.equal(result.rssi, 0, 'beacon rssi should be set');
    assert.equal(result.accuracy, 0, 'beacon accuracy should be set');

    assert.equal(this.get('monitoringBeacons.length'), 0, '0 beacons should be monitoring');
    done();
  }.bind(service));
});

test('it stops beacon to be ranged', function(assert) {
  let service = this.subject();
  let done = assert.async();

  let beacon = {
    identifier: 'My Ranging Beacon',
    uuid: 'rng-xxx-xxx',
    major: 1,
    minor: 3
  };

  service.startRangingBeacon(
    beacon.identifier,
    beacon.uuid,
    beacon.major,
    beacon.minor
  );

  service.stopRangingBeacon(
    beacon.uuid,
    beacon.major,
    beacon.minor
  ).then(function(result) {
    assert.equal(result.identifier, beacon.identifier, 'beacon identifier should be set');
    assert.equal(result.major, beacon.major, 'beacon major should be set');
    assert.equal(result.minor, beacon.minor, 'beacon minor should be set');
    assert.equal(result.uuid, beacon.uuid, 'beacon uuid should be set');
    assert.notEqual(result.region, null, 'beacon region should be set');
    assert.equal(result.rssi, 0, 'beacon rssi should be set');
    assert.equal(result.accuracy, 0, 'beacon accuracy should be set');

    assert.equal(this.get('rangingBeacons.length'), 0, '0 beacons should be ranging');
    done();
  }.bind(service));
});


text:
angular.module('app')
  .controller('CategoryController', ['$scope', '$routeParams', 'fetchService',
    ($scope, $routeParams, fetchService) => {
      let category = $routeParams.category;
      let tags = $routeParams.tags ? $routeParams.tags.split('/') : [];

      $scope.category = category;
      $scope.tag = tags.join('/');

      $scope.$watch(() => {
        return $scope.$parent.general.data;
      }, (newVal, oldVal, scope) => {
        if (!newVal || !angular.isArray(newVal)) return;
        let data = fetchService.byCategoryName(newVal, $scope.category);
        if (tags.length > 0) data =  fetchService.byTagsName(data, tags);
        scope.$parent.data = data;
      });
    }
  ]);


text:
module utilities

    implicit none

    ! module variable definitions
    double precision, parameter :: PI = 3.141592653589793_8
    integer :: i

contains

    ! module subprogram units (i.e., subroutines and functions)

    subroutine print_i()
        print *, "i = ", i
    end subroutine

    subroutine linspace(a, b, x, n)
        ! input arguments
        double precision, intent(in) :: a, b
        integer, intent(in) :: n
        double precision, intent(out) :: x(n)
        ! local variables
        integer :: i
        double precision :: dx
        dx = (b-a)/(n-1)
        do i = 1, n
            x(i) = a + dx*(i-1)
        end do
    end subroutine

    double precision function sum_of_squares(x)
        ! input arguments
        double precision, intent(in), dimension(:) :: x
        ! local variables
        integer n, i
        sum_of_squares = 0
        n = size(x)
        do i = 1, n
            sum_of_squares = sum_of_squares + x(i)**2
        end do
    end function sum_of_squares

end module utilities


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.resourcemanager.monitor.models;

import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.resourcemanager.monitor.MonitorManager;
import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager;
import java.time.OffsetDateTime;

/** Entry point for Monitor Activity logs API. */
public interface ActivityLogs extends HasManager<MonitorManager> {

    /**
     * Lists available event categories supported in the Activity Logs Service.
     *
     * @return list of available event categories supported in the Activity Logs Service.
     */
    PagedIterable<LocalizableString> listEventCategories();

    /**
     * Lists available event categories supported in the Activity Logs Service.
     *
     * @return list of available event categories supported in the Activity Logs Service.
     */
    PagedFlux<LocalizableString> listEventCategoriesAsync();

    /**
     * Begins a definition for a new Activity log query.
     *
     * @return the stage of start time filter definition.
     */
    ActivityLogsQueryDefinitionStages.WithEventDataStartTimeFilter defineQuery();

    /** The entirety of a Activity Logs query definition. */
    interface ActivityLogsQueryDefinition
        extends ActivityLogsQueryDefinitionStages.WithEventDataStartTimeFilter,
            ActivityLogsQueryDefinitionStages.WithEventDataEndFilter,
            ActivityLogsQueryDefinitionStages.WithEventDataFieldFilter,
            ActivityLogsQueryDefinitionStages.WithActivityLogsSelectFilter,
            ActivityLogsQueryDefinitionStages.WithActivityLogsQueryExecute {
    }

    /** Grouping of Activity log query stages. */
    interface ActivityLogsQueryDefinitionStages {

        /** The stage of a Activity Log query allowing to specify start time filter. */
        interface WithEventDataStartTimeFilter {
            /**
             * Sets the start time for Activity Log query filter.
             *
             * @param startTime specifies start time of cut off filter.
             * @return the stage of end time filter definition.
             */
            WithEventDataEndFilter startingFrom(OffsetDateTime startTime);
        }

        /** The stage of a Activity Log query allowing to specify end time filter. */
        interface WithEventDataEndFilter {
            /**
             * Sets the end time for Activity Log query filter.
             *
             * @param endTime specifies end time of cut off filter.
             * @return the stage of optional query parameter definition and query execution.
             */
            WithEventDataFieldFilter endsBefore(OffsetDateTime endTime);
        }

        /** The stage of a Activity Log query allowing to specify data fields in the server response. */
        interface WithEventDataFieldFilter {
            /**
             * Selects data fields that will be populated in the server response.
             *
             * @param responseProperties field names in the server response.
             * @return the stage of Activity log filtering by type and query execution.
             */
            WithActivityLogsSelectFilter withResponseProperties(EventDataPropertyName... responseProperties);

            /**
             * Sets the server response to include all the available properties.
             *
             * @return the stage of Activity log filtering by type and query execution.
             */
            WithActivityLogsSelectFilter withAllPropertiesInResponse();
        }

        /** The stage of the Activity log filtering by type and query execution. */
        interface WithActivityLogsSelectFilter extends WithActivityLogsQueryExecute {

            /**
             * Filters events for a given resource group.
             *
             * @param resourceGroupName Specifies resource group name.
             * @return the stage of Activity log filtering by type and query execution.
             */
            WithActivityLogsQueryExecute filterByResourceGroup(String resourceGroupName);

            /**
             * Filters events for a given resource.
             *
             * @param resourceId Specifies resource Id.
             * @return the stage of Activity log filtering by type and query execution.
             */
            WithActivityLogsQueryExecute filterByResource(String resourceId);

            /**
             * Filters events for a given resource provider.
             *
             * @param resourceProviderName Specifies resource provider.
             * @return the stage of Activity log filtering by type and query execution.
             */
            WithActivityLogsQueryExecute filterByResourceProvider(String resourceProviderName);

            /**
             * Filters events for a given correlation id.
             *
             * @param correlationId Specifies correlation id.
             * @return the stage of Activity log filtering by type and query execution.
             */
            WithActivityLogsQueryExecute filterByCorrelationId(String correlationId);
        }

        /** The stage of the Activity log query execution. */
        interface WithActivityLogsQueryExecute {
            /**
             * Executes the query.
             *
             * @return Activity Log events received after query execution.
             */
            PagedIterable<EventData> execute();

            /**
             * Executes the query.
             *
             * @return a representation of the deferred computation of Activity Log query call.
             */
            PagedFlux<EventData> executeAsync();

            /**
             * Filters events that were generated at the Tenant level.
             *
             * @return the stage of Activity log filtering by Tenant level and query execution.
             */
            WithActivityLogsQueryExecute filterAtTenantLevel();
        }
    }
}


text: console.log(process.env.VERSION)


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = extractValueFromLiteral;
/**
 * Extractor function for a Literal type value node.
 *
 * @param - value - AST Value object with type `Literal`
 * @returns { String|Boolean } - The extracted value converted to correct type.
 */
function extractValueFromLiteral(value) {
  var extractedValue = value.value;

  var normalizedStringValue = typeof extractedValue === 'string' && extractedValue.toLowerCase();
  if (normalizedStringValue === 'true') {
    return true;
  }

  if (normalizedStringValue === 'false') {
    return false;
  }

  return extractedValue;
}


text:
using DataGenerator;
using DataGenerator.Sources;
using MongoDB.Abstracts.Tests.Models;
using MongoDB.Bson;

namespace MongoDB.Abstracts.Tests.Profiles
{
    public class CommentProfile : MappingProfile<Comment>
    {
        public override void Configure()
        {
            Property(p => p.Id).Value(_ => ObjectId.GenerateNewId().ToString());
            Property(p => p.Name).DataSource<NameSource>();
            Property(p => p.Description).DataSource<LoremIpsumSource>();
            Property(p => p.OwnerId).DataSource(Constants.Owners);
        }
    }
}


text:
'use strict';

/**
 * The editor for the API deployer
 *
 * @memberof HashBrown.Client.Entity.View.DeployerEditor
 */
class GitDeployerEditor extends HashBrown.Entity.View.DeployerEditor.DeployerEditorBase {
    static get alias() { return 'git'; }

    /**
     * Constructor
     */
    constructor(params) {
        super(params);

        this.customTemplate = require('template/deployerEditor/inc/gitDeployerEditor.js');
    }

    /**
     * Event: Change repo
     */
    onChangeRepo(newValue) {
        this.model.repo = newValue;

        this.trigger('change', this.model);
    }

    /**
     * Event: Change branch
     */
    onChangeBranch(newValue) {
        this.model.branch = newValue;

        this.trigger('change', this.model);
    }

    /**
     * Event: Change username
     */
    onChangeUsername(newValue) {
        this.model.username = newValue;

        this.trigger('change', this.model);
    }

    /**
     * Event: Change password
     */
    onChangePassword(newValue) {
        this.model.password = newValue;

        this.trigger('change', this.model);
    }

    /**
     * Event: Change path
     */
    onChangePath(newValue) {
        this.model.path = newValue;

        this.trigger('change', this.model);
    }
}

module.exports = GitDeployerEditor;


text:
from middleware import MokshaMiddleware, make_moksha_middleware
from connector import MokshaConnectorMiddleware
from extensionpoint import MokshaExtensionPointMiddleware
from csrf import CSRFProtectionMiddleware

__all__ = ('MokshaMiddleware', 'MokshaConnectorMiddleware',
           'MokshaExtensionPointMiddleware', 'CSRFProtectionMiddleware',
           'make_moksha_middleware')


text:
using System.Windows.Controls;

namespace DataCloner.GUI.View
{
    /// <summary>
    /// Logique d'interaction pour SolutionExplorer.xaml
    /// </summary>
    public partial class SolutionExplorer : UserControl
    {
        public SolutionExplorer()
        {
            InitializeComponent();
        }
    }
}


text:
#ifndef __POWER_PROCESS_HH__
#define __POWER_PROCESS_HH__

#include <string>
#include <vector>

#include "sim/process.hh"

class LiveProcess;
class ObjectFile;
class System;

class PowerLiveProcess : public LiveProcess
{
  protected:
    PowerLiveProcess(LiveProcessParams * params, ObjectFile *objFile);

    void initState();

  public:
    void argsInit(int intSize, int pageSize);
    PowerISA::IntReg getSyscallArg(ThreadContext *tc, int &i);
    /// Explicitly import the otherwise hidden getSyscallArg
    using LiveProcess::getSyscallArg;
    void setSyscallArg(ThreadContext *tc, int i, PowerISA::IntReg val);
    void setSyscallReturn(ThreadContext *tc, SyscallReturn return_value);
};

/* No architectural page table defined for this ISA */
typedef NoArchPageTable ArchPageTable;

#endif // __POWER_PROCESS_HH__


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical">

    <!--<android.support.design.widget.AppBarLayout-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="wrap_content"-->
        <!--android:theme="@style/AppTheme.AppBarOverlay"-->
        <!--android:background="@android:color/transparent"-->
        <!--app:elevation="0dp">-->

        <!--<android.support.v7.widget.Toolbar-->
            <!--android:id="@+id/toolbar"-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="?attr/actionBarSize"-->
            <!--android:background="@android:color/transparent"-->
            <!--app:popupTheme="@style/AppTheme.PopupOverlay" />-->

    <!--</android.support.design.widget.AppBarLayout>-->

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/profile_image"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_margin="8dp"
            android:elevation="4dp"
            android:layout_alignParentRight="true"
            android:background="@android:color/transparent"
            android:src="@drawable/prof_pic"
            app:civ_border_color="@android:color/white"
            app:civ_border_width="1dp" />

        <!--<FrameLayout-->
            <!--android:id="@+id/f_preview_container"-->
            <!--android:layout_width="100dp"-->
            <!--android:layout_height="150dp"-->
            <!--android:layout_alignParentRight="true"-->
            <!--android:layout_margin="16dp"/>-->

        <FrameLayout
            android:id="@+id/preview_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <Button
            android:id="@+id/capture_btn"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_alignParentBottom="true"
            android:layout_centerInParent="true"
            android:layout_margin="10dp"
            android:background="@drawable/round_image" />

    </RelativeLayout>

</LinearLayout>


text:
this script should take massive flat data and turn it into html chunks manageable
for hillsides internal email system.

![](https://travis-ci.org/dhigginbotham/hillside-email-render.png)

### Usage
```md

render = require "./lib/render"

huge = require "./seed/huge-array"

multi = new render input: huge, multiFiles: true

multi.renderMulti (err, data) ->
  console.log err if err?
  data.input = []
  data.html = []
  console.log data if data?

array = require "./seed/array"

single = new render input: array

single.singleFile (err, done) ->
  return if err? then console.log err

  ms = []
  total = 0

  for t in done.start
    ts = (t.ts - done.start[0].ts)
    ms.push(ts)
    total += ts
    console.log "#{t.place} took: #{ts}ms from start"

  console.log "you may review: #{done.outFile}"

```

### Example Output
```md
process length: 0ms
process length: 56ms
process length: 57ms
finished in: 113ms
you may review: D:\node\hillside-email-render\output\1374182429360.html
```

### Available Options
Name | Default | Description
--- | --- | ---
`fileName` | `Date.now()` | output file name
`fileType` | `html` | output file path
`type` | `array` | `@todo`: add support for `json` and `object`
`input` | `[]` | data to render
`out` | `../output` | output path for rendered files
`template` | `../includes/template.jade` | template file to render from
`style` | `true` | inline styles with `juice`

### Tests
- run `npm test`

### License
```md
The MIT License (MIT)

Copyright (c) 2013 David Higginbotham

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```


text:
classdef MultiEventTypeTimeSeriesLabeler < LabelCreators.TimeSeriesLabelCreator
    % class for multi-class labeling blocks by event
    %% -----------------------------------------------------------------------------------
    properties (SetAccess = protected)
        types;
        negOut;
        srcPrioMethod;
        segIdTargetSrcFilter = [];
        srcTypeFilterOut;
        fileFilterOut = {};
    end

    %% -----------------------------------------------------------------------------------
    properties (Access = public)
    end

    %% -----------------------------------------------------------------------------------
    methods (Abstract)
    end

    %% -----------------------------------------------------------------------------------
    methods

        function obj = MultiEventTypeTimeSeriesLabeler( varargin )
            ip = inputParser;
            ip.addOptional( 'removeUnclearBlocks', 'sequence-wise' );
            ip.addOptional( 'types', {{'Type1'},{'Type2'}} );
            ip.addOptional( 'negOut', 'rest' ); % rest, none
            ip.addOptional( 'srcPrioMethod', 'order' ); % energy, order
%             ip.addOptional( 'segIdTargetSrcFilter', [] ); % e.g. [1,1;3,2]: throw away time-aggregate blocks with type 1 on other than src 1 and type 2 on other than src 3
            ip.addOptional( 'srcTypeFilterOut', [] ); % e.g. [2,1;3,2]: throw away type 1 blocks from src 2 and type 2 blocks from src 3
%             ip.addOptional( 'fileFilterOut', {} ); % blocks containing these files get filtered out
            ip.parse( varargin{:} );
            obj = obj@LabelCreators.TimeSeriesLabelCreator( 'removeUnclearBlocks', ...
                                                         ip.Results.removeUnclearBlocks );
            obj.types = ip.Results.types;
            obj.negOut = ip.Results.negOut;
            obj.srcPrioMethod = ip.Results.srcPrioMethod;
%             obj.segIdTargetSrcFilter = ip.Results.segIdTargetSrcFilter;
            obj.srcTypeFilterOut = ip.Results.srcTypeFilterOut;
%             obj.fileFilterOut = sort( ip.Results.fileFilterOut );
            obj.procName = [obj.procName '(' strcat( obj.types{1}{:} ) ')'];
        end
        %% -------------------------------------------------------------------------------

        function [y, ysi] = label( obj, blockAnnotations )
            [activeTypes, srcIdxs] = obj.getActiveTypes( blockAnnotations );
            y = zeros( size( activeTypes, 1 ), 1 );
            ysi = cell( size( activeTypes, 1 ), 1 );
            if any( activeTypes(:) )
                switch obj.srcPrioMethod
                    case 'energy'
                        error( 'AMLTTP:notImplemented', 'energy PrioMethod for time-series not implemented yet' );
                        for ss = 1 : size( blockAnnotations.globalSrcEnergy.globalSrcEnergy, 2 )
                            eSrcs(:,ss) = mean( cell2mat( ...
                                blockAnnotations.globalSrcEnergy.globalSrcEnergy(:,ss) ), 2 );
                        end
                        eTypes = eSrcs .* activeTypes;
                        [~,labelTypeIdxs] = max( eTypes, [], 2 );
                        y = labelTypeIdxs .* double( any( activeTypes, 2 ) );
                    case 'order'
                        labelTypeIdxs = activeTypes .* repmat( 1:size( activeTypes, 2), size( activeTypes, 1), 1 );
                        y = min( labelTypeIdxs, [], 2 );
                    otherwise
                        error( 'AMLTTP:unknownOptionValue', ['%s: unknown option value.'...
                                     'Use ''energy'' or ''order''.'], obj.srcPrioMethod );
                end
                ysi_ = y;
                ysi_(ysi_==0) = 1;
                ysi = srcIdxs(sub2ind( size( srcIdxs ), 1:size( srcIdxs, 1 ), ysi_' ));
            end
            if strcmp( obj.negOut, 'rest' )
                y(y==0) = -1;
            else
                y(y==0) = NaN;
                return;
            end
%             if ~isempty( obj.segIdTargetSrcFilter )
%                 for ii = 1 : size( obj.segIdTargetSrcFilter, 1 )
%                     srcf = obj.segIdTargetSrcFilter(ii,1);
%                     typef = obj.segIdTargetSrcFilter(ii,2);
%                     srcfAzm = obj.lastConfig{obj.sceneId,obj.foldId}.preceding.preceding.preceding.preceding.preceding.sceneCfg.sources(srcf).azimuth;
%                     if isa( srcfAzm, 'SceneConfig.ValGen' )
%                         srcfAzm = srcfAzm.val;
%                     end
%                     if activeTypes(typef) && any( abs( blockAnnotations.srcAzms(srcIdxs{typef}) - srcfAzm ) >= 0.1 )
%                         y = NaN;
%                         return;
%                     end
%                 end
%             end
            for ii = 1 : size( obj.srcTypeFilterOut, 1 )
                srcfo = obj.srcTypeFilterOut(ii,1);
                typefo = obj.srcTypeFilterOut(ii,2);
                fo_lidxs = activeTypes(:,typefo) ...
                           & cellfun( @(si)(any( si == srcfo )), srcIdxs(:,typefo) );
                y(fo_lidxs) = NaN;
            end
%             for ii = 1 : numel( obj.fileFilterOut )
%                 if any( strcmpi( obj.fileFilterOut{ii}, blockAnnotations.srcFile.srcFile(:,1) ) )
%                     y = NaN;
%                     return;
%                 end
%             end
        end
        %% -------------------------------------------------------------------------------

    end

    %% -----------------------------------------------------------------------------------
    methods (Access = protected)

        function outputDeps = getLabelInternOutputDependencies( obj )
            outputDeps.types = obj.types;
            outputDeps.negOut = obj.negOut;
            outputDeps.srcPrioMethod = obj.srcPrioMethod;
            outputDeps.srcTypeFilterOut = sortrows( obj.srcTypeFilterOut );
            outputDeps.segIdTargetSrcFilter = sortrows( obj.segIdTargetSrcFilter );
            outputDeps.fileFilterOut = obj.fileFilterOut;
            outputDeps.v = 1;
        end
        %% -------------------------------------------------------------------------------

        function eit = eventIsType( obj, typeIdx, type )
            eit = any( strcmp( type, obj.types{typeIdx} ) );
        end
        %% -------------------------------------------------------------------------------

        function [activeTypes, srcIdxs] = getActiveTypes( obj, blockAnnotations )
            ts = blockAnnotations.globalSrcEnergy.t;
            activeTypes = zeros( numel( ts ), numel( obj.types ) );
            srcIdxs = cell( numel( ts ), numel( obj.types ) );
            eventOnsets = blockAnnotations.srcType.t.onset;
            eventOffsets = blockAnnotations.srcType.t.offset;
            for tt = 1 : numel( obj.types )
                eventsAreType = cellfun( @(ba)(obj.eventIsType( tt, ba )), ...
                                                  blockAnnotations.srcType.srcType(:,1) );
                srcIdxs_tt = [blockAnnotations.srcType.srcType{eventsAreType,2}];
                eventOnOffs_tt = [eventOnsets(eventsAreType)',eventOffsets(eventsAreType)'];
                eventOnOffs_tt = eventOnOffs_tt - ts(1) + 1;
                if ~isempty( eventOnOffs_tt )
                    for ii = 1:2
                        eventOnOffs_tt(:,ii) = max( ...
                                                [zeros( size(eventOnOffs_tt, 1), 1 ), ...
                                                 eventOnOffs_tt(:,ii)], [], 2 );
                        eventOnOffs_tt(:,ii) = min( ...
                                   [repmat( numel( ts ), size(eventOnOffs_tt, 1), 1 ), ...
                                    eventOnOffs_tt(:,ii)], [], 2 );
                    end
                else
                    eventOnOffs_tt = [];
                end
                for jj = 1 : size( eventOnOffs_tt, 1 )
                    event_jj_idxs = eventOnOffs_tt(jj,1) : eventOnOffs_tt(jj,2);
                    activeTypes(event_jj_idxs,tt) = 1;
                    srcIdxs(event_jj_idxs,tt) = cellfun( @(a,b)([a,b]), ...
                                srcIdxs(event_jj_idxs,tt), ...
                                repmat( {srcIdxs_tt(jj)}, numel( event_jj_idxs ), 1 ), ...
                                                                 'UniformOutput', false );
                end
            end
        end
        %% -------------------------------------------------------------------------------

    end
    %% -----------------------------------------------------------------------------------

    methods (Static)

        %% -------------------------------------------------------------------------------

    end

end


text:
'use strict';

var mongoose = require('mongoose');
var hash = require('password-hash');
var Schema = mongoose.Schema;

var userSchema = new Schema({
  username: {type: String },
  password: {type: String, set: function (newValue) {
    return hash.isHashed(newValue) ? newValue : hash.generate(newValue);
  }},
});

userSchema.statics.authenticate = function (username, password, cb) {
  this.findOne({username: username}, function (error, user) {
    if (error) {
      return cb(error);
    }
    if (user && hash.verify(password, user.password)) {
      cb(null, user);
    } else if (user || !error) {
      error = new Error("Your username or password is invalid. Please try again.");
      console.log('hello');
      error.status = 403;
      return cb(error, null);
    } else {
      return cb(error, null);
    }
  });
};

var User = mongoose.model('User', userSchema);

exports.User = User;