text:
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')

require 'rubygems'
require 'prawn'
require 'prawn/js'

Prawn::Document.generate "js_doc_close.pdf" do |pdf|

  pdf.add_will_close_js("app.alert('closing',3)")

  pdf.draw_text "Javascript Prototype", :at => [150,720], :size => 32

end


text:
package org.dbflute.erflute.editor.controller.editpart.outline;

public interface FilteringEditPart {

    void setFilterText(String filterText);
}

redpajama_set_name: RedPajamaGithub


text:
class Solution {
  public:
    int singleNumber(vector<int> &nums) {
        int result = 0;
        // if this is not allowed, just use nums[0]
        for (auto &n : nums)
            result ^= n;
        return result;
    }
};


text:
<!DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>colour.colorimetry.correction — Colour 0.3.3 documentation</title>

    <link rel="stylesheet" href="../../../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/bootswatch-3.1.0/colour/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/styles.css" type="text/css" />

    <link rel="top" title="Colour 0.3.3 documentation" href="../../../index.html" />
    <link rel="up" title="colour.colorimetry" href="../colorimetry.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">

        </button>

          Colour 0.3

colour-science.org

                   Documentation

                           API Reference

                           IPython Notebooks

                           Features

                           Contributing

<form class="navbar-form navbar-right" action="../../../search.html" method="get">

  <input type="text" name="q" class="form-control" placeholder="Search" />

  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>

Source code for colour.colorimetry.correction

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Spectral Bandpass Dependence Correction
=======================================

Defines objects to perform spectral bandpass dependence correction.

The following correction methods are available:

-   :func:`bandpass_correction_Stearns1988`: Stearns and Stearns (1988)
    spectral bandpass dependence correction method.

See Also
--------
`Spectral Bandpass Dependence Correction IPython Notebook
<http://nbviewer.ipython.org/github/colour-science/colour-ipython/blob/master/notebooks/colorimetry/correction.ipynb>`_  # noqa
"""

from __future__ import division, unicode_literals

from colour.utilities import CaseInsensitiveMapping

__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013 - 2014 - Colour Developers'
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
__maintainer__ = 'Colour Developers'
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'

__all__ = ['bandpass_correction_Stearns1988',
           'BANDPASS_CORRECTION_METHODS',
           'bandpass_correction']

ALPHA_STEARNS = 0.083

[docs]def bandpass_correction_Stearns1988(spd):
    """
    Implements spectral bandpass dependence correction on given spectral power
    distribution using Stearns and Stearns (1988) method.

    References
    ----------
    .. [1]  Westland, S., Ripamonti, C., & Cheung, V. (2012). Correction for
            Spectral Bandpass. In Computational Colour Science Using MATLAB
            (2nd ed., p. 38). ISBN:978-0-470-66569-5
    .. [2]  Stearns, E. I., & Stearns, R. E. (1988). An example of a method
            for correcting radiance data for Bandpass error. Color Research &
            Application, 13(4), 257–259. doi:10.1002/col.5080130410

    Parameters
    ----------
    spd : SpectralPowerDistribution
        Spectral power distribution.

    Returns
    -------
    SpectralPowerDistribution
        Spectral bandpass dependence corrected spectral power distribution.

    Examples
    --------
    >>> from colour import SpectralPowerDistribution
    >>> data = {510: 49.67, 520: 69.59, 530: 81.73, 540: 88.19}
    >>> spd = SpectralPowerDistribution('Spd', data)
    >>> corrected_spd = bandpass_correction_Stearns1988(spd)
    >>> corrected_spd.values  # doctest: +ELLIPSIS
    array([ 48.01664   ,  70.3729688...,  82.0919506...,  88.72618   ])
    """

    values = spd.values
    values[0] = (1 + ALPHA_STEARNS) * values[0] - ALPHA_STEARNS * values[1]
    values[-1] = (1 + ALPHA_STEARNS) * values[-1] - ALPHA_STEARNS * values[-2]
    for i in range(1, len(values) - 1):
        values[i] = (-ALPHA_STEARNS * values[i - 1] +
                     (1 + 2 * ALPHA_STEARNS) *
                     values[i] - ALPHA_STEARNS * values[i + 1])

    for i, (wavelength, value) in enumerate(spd):
        spd[wavelength] = values[i]
    return spd

BANDPASS_CORRECTION_METHODS = CaseInsensitiveMapping(
    {'Stearns 1988': bandpass_correction_Stearns1988})
"""
Supported spectral bandpass dependence correction methods.

BANDPASS_CORRECTION_METHODS : CaseInsensitiveMapping
    {'Stearns 1988',}
"""

[docs]def bandpass_correction(spd, method='Stearns 1988'):
    """
    Implements spectral bandpass dependence correction on given spectral power
    distribution using given method.

    Parameters
    ----------
    spd : SpectralPowerDistribution
        Spectral power distribution.
    method : unicode, optional
        ('Stearns 1988',)
        Correction method.

    Returns
    -------
    SpectralPowerDistribution
        Spectral bandpass dependence corrected spectral power distribution.
    """

    return BANDPASS_CORRECTION_METHODS.get(method)(spd)

      Back to top

        © Copyright 2013 - 2014, Colour Developers.

      Created using Sphinx 1.2.2.


text:
using namespace System;

namespace WrappedProcessing {

	public ref class WrapperProcessor
	{
	public:
		static bool IsPrime(int n);
	};
}


text:
using SimpleSchemaParser;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace xsd2codemirror
{
  public static class Program
  {
    public static void Usage()
    {
      Console.WriteLine("Usage:");
      Console.WriteLine("xsd2codemirror.exe [-v] path-to-xsd");
    }

    public static void Main(string[] args)
    {
      List<string> argsList = new List<string>(args);
      bool verbose = false;

      if (argsList.Contains("-v") || argsList.Contains("-verbose"))
      {
        verbose = true;
        argsList.RemoveAll(s => s == "-v" || s == "-verbose");
      }
      Dictionary<string, string> namespacePrefixes = new Dictionary<string, string>();
      int index;
      while ((index = argsList.IndexOf("-prefix")) != -1)
      {
        argsList.RemoveAt(index);
        if (argsList.Count <= index)
        {
          Usage();
          return;
        }
        var prefix = argsList[index];
        argsList.RemoveAt(index);
        if (argsList.Count <= index)
        {
          Usage();
          return;
        }
        var @namespace = argsList[index];
        argsList.RemoveAt(index);
        namespacePrefixes[@namespace] = prefix;
      }
      if (argsList.Count != 1)
      {
        Usage();
        return;
      }

      try
      {
        var parser = new SchemaParser(argsList[0]);
        if (verbose)
          parser.Logger = new ConsoleLogger();
        parser.Compile();
        var elements = parser.GetXmlElements();

        var serializer = new CodeMirrorSchemaInfoSerializer(elements);
        serializer.Pretty = true;
        foreach (var nsPr in namespacePrefixes) {
          serializer.SetPrefix(nsPr.Key, nsPr.Value);
        }
        var json = serializer.ToJsonString();
        Console.WriteLine(json);
      }
      catch (Exception e)
      {
        Console.Error.WriteLine(e.GetType().Name);
        Console.Error.WriteLine(e.Message);
        Console.Error.WriteLine(e.StackTrace);
        System.Environment.Exit(1);
      }
    }
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sphaeronaema oleae f. oleae

### Remarks
null


text:
package com.vmware.vim25;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

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

 * <complexType name="ArrayOfPropertyFilterSpec">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="PropertyFilterSpec" type="{urn:vim25}PropertyFilterSpec" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfPropertyFilterSpec", propOrder = {
    "propertyFilterSpec"
})
public class ArrayOfPropertyFilterSpec {

    @XmlElement(name = "PropertyFilterSpec")
    protected List<PropertyFilterSpec> propertyFilterSpec;

    /**
     * Gets the value of the propertyFilterSpec property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the propertyFilterSpec property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getPropertyFilterSpec().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link PropertyFilterSpec }
     *
     *
     */
    public List<PropertyFilterSpec> getPropertyFilterSpec() {
        if (propertyFilterSpec == null) {
            propertyFilterSpec = new ArrayList<PropertyFilterSpec>();
        }
        return this.propertyFilterSpec;
    }

}


text:
package org.slc.sli.modeling.uml;

import java.util.List;

/**
 * A member of an enumeration type.
 */
public class EnumLiteral extends NamedModelElement implements HasName {

    public EnumLiteral(final Identifier id, final String name, final List<TaggedValue> taggedValues) {
        super(id, name, taggedValues);
    }

    public EnumLiteral(final String name, final List<TaggedValue> taggedValues) {
        this(Identifier.random(), name, taggedValues);
    }

    @Override
    public void accept(final Visitor visitor) {
        visitor.visit(this);
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("id: " + getId()).append(", ");
        sb.append("name: \"" + getName() + "\"");
        if (!getTaggedValues().isEmpty()) {
            sb.append(", ");
            sb.append("taggedValues: " + getTaggedValues());
        }
        sb.append("}");
        return sb.toString();
    }
}


text:
using System.Reflection;

[assembly: AssemblyTitle("FluentInterfaceGenerator")]
[assembly: AssemblyProduct("FluentInterfaceGenerator")]


text:
    <form layout="column">

            <md-button ng-show="!$ctrl.state.dataset.published && !$ctrl.state.dataset.is_published_private" class="md-primary md-raised"
                       ng-click="$ctrl.publishPublicDataset()">
                Publish As Public Dataset
            </md-button>
            <md-button ng-show="!$ctrl.state.dataset.published && !$ctrl.state.dataset.is_published_private" class="md-primary md-raised"
                       ng-click="$ctrl.publishPrivateDataset()">
                Publish As Private Dataset
            </md-button>
            <md-button class="md-primary md-raised" ng-click="$ctrl.updateDataset()">Save Changes</md-button>
            <md-button class="md-warn md-raised" ng-click="$ctrl.cancel()">Cancel</md-button>

                Dataset contains {{$ctrl.state.dataset.status.processes_count | number}} processes, and {{$ctrl.state.dataset.status.samples_count | number}}
                samples.

            <md-button class="md-warn md-raised" ng-disabled="true">
                Dataset published
            </md-button>
            <md-button class="md-warn md-raised" ng-click="$ctrl.unpublishDataset()">Unpublish Dataset</md-button>
            View published dataset

Dataset

            <md-input-container class="md-block">
                Name
                <input ng-model="$ctrl.state.dataset.title"
                       ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                       ng-change="$ctrl.changed()">
            </md-input-container>
            <md-input-container class="md-block">
                Description
                <textarea ng-model="$ctrl.state.dataset.description"
                          ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                          ng-change="$ctrl.changed()"></textarea>
            </md-input-container>
            <md-input-container class="md-block">
                Institution
                <input ng-model="$ctrl.state.dataset.institution"
                       ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                       ng-change="$ctrl.changed()">
            </md-input-container>
            <md-input-container class="md-block">
                Funding
                <input ng-model="$ctrl.state.dataset.funding"
                       ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                       ng-change="$ctrl.changed()">
            </md-input-container>

            <md-input-container class="md-block margin-top-40">
                License
                <md-select ng-model="$ctrl.state.dataset.license"
                           ng-model-options="{trackBy: '$value.name'}"
                           ng-change="$ctrl.changed()">
                    <md-option ng-repeat="license in ::$ctrl.licenses"
                               ng-value="license">
                        {{license.name}}
                    </md-option>
                </md-select>
            </md-input-container>

                View License

            <md-chips class="margin-top-20"
                      ng-model="$ctrl.state.dataset.keywords"
                      placeholder="Add keyword"
                      md-add-on-blur="true"
                      delete-button-label="Remove keyword"
                      md-on-add="$ctrl.changed()"
                      md-on-remove="$ctrl.changed()"
                      secondary-placeholder="Add another keyword"
                      md-enable-chip-edit="true"></md-chips>

                    Optional DOI:
                    <md-button ng-click="$ctrl.addDoi()" class="md-primary">Add DOI</md-button>

                    DOI:   {{$ctrl.state.dataset.doi}}

                Papers
                <md-button ng-click="$ctrl.addPaper()" class="md-primary">add paper</md-button>

                <md-input-container class="md-block">
                    Title
                    <input ng-model="paper.title"
                           ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                           ng-change="$ctrl.changed()">
                </md-input-container>
                <md-input-container class="md-block">
                    Abstract
                    <textarea ng-model="paper.abstract"
                              ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                              ng-change="$ctrl.changed()"></textarea>
                </md-input-container>
                <md-input-container class="md-block">
                    Link To Paper
                    <input ng-model="paper.link"
                           ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                           ng-change="$ctrl.changed()">
                </md-input-container>
                <md-input-container class="md-block">
                    DOI
                    <input ng-model="paper.doi"
                           ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                           ng-change="$ctrl.changed()">
                </md-input-container>
                <md-button class="md-warn" ng-click="$ctrl.removePaper($index)">delete paper</md-button>

                Authors
                <md-button ng-click="$ctrl.addAuthor()" class="md-primary">add author</md-button>

                <md-input-container class="md-block" flex-gt-sm>
                    Last Name
                    <input ng-model="author.lastname"
                           ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                           ng-change="$ctrl.changed()">
                </md-input-container>
                <md-input-container class="md-block" flex-gt-sm>
                    First Name
                    <input ng-model="author.firstname"
                           ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                           ng-change="$ctrl.changed()">
                </md-input-container>
                <md-input-container class="md-block" flex-gt-sm>
                    Affiliation
                    <input ng-model="author.affiliation"
                           ng-model-options="{updateOn: 'default blur', debounce:{default: 1000, blur: 0}}"
                           ng-change="$ctrl.changed()">
                </md-input-container>

    </form>


text:
"""Hong Kong specific Form helpers."""
from __future__ import unicode_literals

import re

from django.forms import CharField, ValidationError
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _

from localflavor.compat import EmptyValueCompatMixin
from localflavor.deprecation import DeprecatedPhoneNumberFormFieldMixin

hk_phone_digits_re = re.compile(r'^(?:852-?)?(\d{4})[-\.]?(\d{4})$')
hk_special_numbers = ('999', '992', '112')
hk_phone_prefixes = ('2', '3', '5', '6', '8', '9')
hk_formats = ['XXXX-XXXX', '852-XXXX-XXXX', '(+852) XXXX-XXXX',
              'XXXX XXXX', 'XXXXXXXX']

class HKPhoneNumberField(EmptyValueCompatMixin, CharField, DeprecatedPhoneNumberFormFieldMixin):
    """
    A form field that validates Hong Kong phone numbers.

    The input format can be either one of the followings:
    'XXXX-XXXX', '852-XXXX-XXXX', '(+852) XXXX-XXXX',
    'XXXX XXXX', or 'XXXXXXXX'.
    The output format is 'XXXX-XXXX'.

    Note: The phone number shall not start with 999, 992, or 112.
          And, it should start with either 2, 3, 5, 6, 8, or 9.

    http://en.wikipedia.org/wiki/Telephone_numbers_in_Hong_Kong

    .. deprecated:: 1.4
        Use the django-phonenumber-field_ library instead.

    .. _django-phonenumber-field: https://github.com/stefanfoulis/django-phonenumber-field
    """

    default_error_messages = {
        'disguise': _('Phone number should not start with '
                      'one of the followings: %s.' %
                      ', '.join(hk_special_numbers)),
        'invalid': _('Phone number must be in one of the following formats: '
                     '%s.' % ', '.join(hk_formats)),
        'prefix': _('Phone number should start with '
                    'one of the followings: %s.' %
                    ', '.join(hk_phone_prefixes)),
    }

    def __init__(self, *args, **kwargs):
        super(HKPhoneNumberField, self).__init__(*args, **kwargs)

    def clean(self, value):
        super(HKPhoneNumberField, self).clean(value)

        if value in self.empty_values:
            return self.empty_value

        value = re.sub('(\(|\)|\s+|\+)', '', force_text(value))
        m = hk_phone_digits_re.search(value)
        if not m:
            raise ValidationError(self.error_messages['invalid'])

        value = '%s-%s' % (m.group(1), m.group(2))
        for special in hk_special_numbers:
            if value.startswith(special):
                raise ValidationError(self.error_messages['disguise'])

        prefix_found = map(value.startswith, hk_phone_prefixes)
        if not any(prefix_found):
            raise ValidationError(self.error_messages['prefix'])

        return value


text:
package org.apache.beam.sdk.transforms;

import static org.junit.Assert.assertFalse;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nullable;
import org.apache.beam.sdk.coders.VarLongCoder;
import org.apache.beam.sdk.testing.NeedsRunner;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.TestStream;
import org.apache.beam.sdk.testing.UsesTestStreamWithProcessingTime;
import org.apache.beam.sdk.transforms.windowing.AfterPane;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.transforms.windowing.FixedWindows;
import org.apache.beam.sdk.transforms.windowing.GlobalWindows;
import org.apache.beam.sdk.transforms.windowing.Repeatedly;
import org.apache.beam.sdk.transforms.windowing.SlidingWindows;
import org.apache.beam.sdk.transforms.windowing.Window;
import org.apache.beam.sdk.transforms.windowing.WindowFn;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.TimestampedValue;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.MoreObjects;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists;
import org.joda.time.Duration;
import org.joda.time.Instant;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Tests for {@link Wait}. */
@RunWith(JUnit4.class)
public class WaitTest implements Serializable {
  @Rule public transient TestPipeline p = TestPipeline.create();

  private static class Event<T> {
    private final Instant processingTime;
    private final TimestampedValue<T> element;
    private final Instant watermarkUpdate;

    private Event(Instant processingTime, TimestampedValue<T> element) {
      this.processingTime = processingTime;
      this.element = element;
      this.watermarkUpdate = null;
    }

    private Event(Instant processingTime, Instant watermarkUpdate) {
      this.processingTime = processingTime;
      this.element = null;
      this.watermarkUpdate = watermarkUpdate;
    }

    @Override
    public String toString() {
      return MoreObjects.toStringHelper(this)
          .add("processingTime", processingTime)
          .add("element", element)
          .add("watermarkUpdate", watermarkUpdate)
          .toString();
    }
  }

  /**
   * Generates a {@link TestStream} of the given duration containing the values [0, numElements) and
   * the same number of random but monotonic watermark updates, with each element within
   * allowedLateness of the respective watermark update.
   *
   * <p>TODO: Consider moving this into TestStream if it's useful enough.
   */
  private PCollection<Long> generateStreamWithBoundedDisorder(
      String name,
      Instant base,
      Duration totalDuration,
      int numElements,
      Duration allowedLateness) {
    TestStream.Builder<Long> stream = TestStream.create(VarLongCoder.of());

    // Generate numElements random watermark updates. After each one also generate an element within
    // allowedLateness of it.
    List<Instant> watermarks = Lists.newArrayList();
    for (int i = 0; i < numElements; ++i) {
      watermarks.add(base.plus(new Duration((long) (totalDuration.getMillis() * Math.random()))));
    }
    Collections.sort(watermarks);

    List<Event<Long>> events = Lists.newArrayList();
    for (int i = 0; i < numElements; ++i) {
      Instant processingTimestamp =
          base.plus((long) (1.0 * i * totalDuration.getMillis() / (numElements + 1)));
      Instant watermark = watermarks.get(i);
      Instant elementTimestamp =
          watermark.minus((long) (Math.random() * allowedLateness.getMillis()));
      events.add(new Event<>(processingTimestamp, watermark));
      events.add(new Event<>(processingTimestamp, TimestampedValue.of((long) i, elementTimestamp)));
    }

    Instant lastProcessingTime = base;
    for (Event<Long> event : events) {
      Duration processingTimeDelta = new Duration(lastProcessingTime, event.processingTime);
      if (processingTimeDelta.getMillis() > 0) {
        stream = stream.advanceProcessingTime(processingTimeDelta);
      }
      lastProcessingTime = event.processingTime;

      if (event.element != null) {
        stream = stream.addElements(event.element);
      } else {
        stream = stream.advanceWatermarkTo(event.watermarkUpdate);
      }
    }
    return p.apply(name, stream.advanceWatermarkToInfinity());
  }

  private static final AtomicReference<Instant> TEST_WAIT_MAX_MAIN_TIMESTAMP =
      new AtomicReference<>();

  @Test
  @Category({NeedsRunner.class, UsesTestStreamWithProcessingTime.class})
  public void testWaitWithSameFixedWindows() {
    testWaitWithParameters(
        Duration.standardMinutes(1) /* duration */,
        Duration.standardSeconds(15) /* lateness */,
        20 /* numMainElements */,
        FixedWindows.of(Duration.standardSeconds(15)),
        20 /* numSignalElements */,
        FixedWindows.of(Duration.standardSeconds(15)));
  }

  @Test
  @Category({NeedsRunner.class, UsesTestStreamWithProcessingTime.class})
  public void testWaitWithDifferentFixedWindows() {
    testWaitWithParameters(
        Duration.standardMinutes(1) /* duration */,
        Duration.standardSeconds(15) /* lateness */,
        20 /* numMainElements */,
        FixedWindows.of(Duration.standardSeconds(15)),
        20 /* numSignalElements */,
        FixedWindows.of(Duration.standardSeconds(7)));
  }

  @Test
  @Category({NeedsRunner.class, UsesTestStreamWithProcessingTime.class})
  public void testWaitWithSignalInSlidingWindows() {
    testWaitWithParameters(
        Duration.standardMinutes(1) /* duration */,
        Duration.standardSeconds(15) /* lateness */,
        20 /* numMainElements */,
        FixedWindows.of(Duration.standardSeconds(15)),
        20 /* numSignalElements */,
        SlidingWindows.of(Duration.standardSeconds(7)).every(Duration.standardSeconds(1)));
  }

  @Test
  @Category({NeedsRunner.class, UsesTestStreamWithProcessingTime.class})
  public void testWaitInGlobalWindow() {
    testWaitWithParameters(
        Duration.standardMinutes(1) /* duration */,
        Duration.standardSeconds(15) /* lateness */,
        20 /* numMainElements */,
        new GlobalWindows(),
        20 /* numSignalElements */,
        new GlobalWindows());
  }

  @Test
  @Category({NeedsRunner.class, UsesTestStreamWithProcessingTime.class})
  public void testWaitBoundedInDefaultWindow() {
    testWaitWithParameters(
        Duration.standardMinutes(1) /* duration */,
        Duration.standardSeconds(15) /* lateness */,
        20 /* numMainElements */,
        null,
        20 /* numSignalElements */,
        null);
  }

  @Test
  @Category({NeedsRunner.class, UsesTestStreamWithProcessingTime.class})
  public void testWaitWithSomeSignalWindowsEmpty() {
    testWaitWithParameters(
        Duration.standardMinutes(1) /* duration */,
        Duration.ZERO /* lateness */,
        20 /* numMainElements */,
        FixedWindows.of(Duration.standardSeconds(1)),
        10 /* numSignalElements */,
        FixedWindows.of(Duration.standardSeconds(1)));
  }

  /**
   * Tests the {@link Wait} transform with a given configuration of the main input and the signal
   * input. Specifically, generates random streams with bounded lateness for main and signal inputs
   * and tests the property that, after observing a main input element with timestamp Tmain, no
   * signal elements are observed with timestamp Tsig < Tmain.
   *
   * @param duration event-time duration of both inputs
   * @param lateness bound on the lateness of elements in both inputs
   * @param numMainElements number of elements in the main input
   * @param mainWindowFn windowing function of the main input. If null, then main input will use
   *     default windowing, and will be marked bounded.
   * @param numSignalElements number of elements in the signal input
   * @param signalWindowFn windowing function of the signal input. If null, then signal input will
   *     use default windowing, and will be marked bounded.
   */
  private void testWaitWithParameters(
      Duration duration,
      Duration lateness,
      int numMainElements,
      @Nullable WindowFn<? super Long, ?> mainWindowFn,
      int numSignalElements,
      @Nullable WindowFn<? super Long, ?> signalWindowFn) {
    TEST_WAIT_MAX_MAIN_TIMESTAMP.set(null);

    Instant base = Instant.now();

    PCollection<Long> input =
        generateStreamWithBoundedDisorder("main", base, duration, numMainElements, lateness);
    if (mainWindowFn == null) {
      input.setIsBoundedInternal(PCollection.IsBounded.BOUNDED);
    } else {
      input =
          input.apply(
              "Window main",
              Window.<Long>into(mainWindowFn)
                  .discardingFiredPanes()
                  // Use an aggressive trigger for main input and signal to get more
                  // frequent / aggressive verification.
                  .triggering(Repeatedly.forever(AfterPane.elementCountAtLeast(1)))
                  .withAllowedLateness(lateness));
    }
    input = input.apply("Fire main", new Fire<>());

    PCollection<Long> signal =
        generateStreamWithBoundedDisorder("signal", base, duration, numSignalElements, lateness);
    if (signalWindowFn == null) {
      signal.setIsBoundedInternal(PCollection.IsBounded.BOUNDED);
    } else {
      signal =
          signal.apply(
              "Window signal",
              Window.<Long>into(signalWindowFn)
                  .discardingFiredPanes()
                  .triggering(Repeatedly.forever(AfterPane.elementCountAtLeast(1)))
                  .withAllowedLateness(lateness));
    }
    signal =
        signal
            .apply("Fire signal", new Fire<>())
            .apply(
                "Check sequencing",
                ParDo.of(
                    new DoFn<Long, Long>() {
                      @ProcessElement
                      public void process(ProcessContext c) {
                        Instant maxMainTimestamp = TEST_WAIT_MAX_MAIN_TIMESTAMP.get();
                        if (maxMainTimestamp != null) {
                          assertFalse(
                              "Signal at timestamp "
                                  + c.timestamp()
                                  + " generated after main timestamp progressed to "
                                  + maxMainTimestamp,
                              c.timestamp().isBefore(maxMainTimestamp));
                        }
                        c.output(c.element());
                      }
                    }));

    PCollection<Long> output = input.apply(Wait.on(signal));

    output.apply(
        "Update main timestamp",
        ParDo.of(
            new DoFn<Long, Long>() {
              @ProcessElement
              public void process(ProcessContext c, BoundedWindow w) {
                while (true) {
                  Instant maxMainTimestamp = TEST_WAIT_MAX_MAIN_TIMESTAMP.get();
                  Instant newMaxTimestamp =
                      (maxMainTimestamp == null || c.timestamp().isAfter(maxMainTimestamp))
                          ? c.timestamp()
                          : maxMainTimestamp;
                  if (TEST_WAIT_MAX_MAIN_TIMESTAMP.compareAndSet(
                      maxMainTimestamp, newMaxTimestamp)) {
                    break;
                  }
                }
                c.output(c.element());
              }
            }));

    List<Long> expectedOutput = Lists.newArrayList();
    for (int i = 0; i < numMainElements; ++i) {
      expectedOutput.add((long) i);
    }
    PAssert.that(output).containsInAnyOrder(expectedOutput);

    p.run();
  }

  private static class Fire<T> extends PTransform<PCollection<T>, PCollection<T>> {
    @Override
    public PCollection<T> expand(PCollection<T> input) {
      return input
          .apply(WithKeys.of(""))
          .apply(GroupByKey.create())
          .apply(Values.create())
          .apply(Flatten.iterables());
    }
  }
}


text:
id: 567af2437cbaa8c51670a16c
title: Verifica las propiedades de un objeto
challengeType: 1
forumTopicId: 18324
dashedName: testing-objects-for-properties
---

# --description--

A veces es útil comprobar si existe o no la propiedad de un objeto dado. Podemos utilizar el método `.hasOwnProperty(propname)` para determinar si un objeto tiene una propiedad con ese nombre. `.hasOwnProperty()` devuelve `true` o `false` si se encuentra la propiedad o no.

**Por ejemplo**

```js
const myObj = {
  top: "hat",
  bottom: "pants"
};

myObj.hasOwnProperty("top");
myObj.hasOwnProperty("middle");
```

El primer `hasOwnProperty` devuelve `true`, mientras que el segundo devuelve `false`.

# --instructions--

Modifica la función `checkObj` para verificar si el objeto `obj` pasado a la función contiene la propiedad `checkProp`. Si la propiedad es encontrada, devuelve el valor de la propiedad. Si no, devuelve `"Not Found"`.

# --hints--

`checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "gift")` debe devolver la cadena`pony`.

```js
assert(
  checkObj({ gift: 'pony', pet: 'kitten', bed: 'sleigh' }, 'gift') === 'pony'
);
```

`checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "pet")` debe devolver la cadena `kitten`.

```js
assert(
  checkObj({ gift: 'pony', pet: 'kitten', bed: 'sleigh' }, 'pet') === 'kitten'
);
```

`checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "house")` debe devolver la cadena `Not Found`.

```js
assert(
  checkObj({ gift: 'pony', pet: 'kitten', bed: 'sleigh' }, 'house') ===
    'Not Found'
);
```

`checkObj({city: "Seattle"}, "city")` debe devolver la cadena `Seattle`.

```js
assert(checkObj({ city: 'Seattle' }, 'city') === 'Seattle');
```

`checkObj({city: "Seattle"}, "district")` debe devolver la cadena `Not Found`.

```js
assert(checkObj({ city: 'Seattle' }, 'district') === 'Not Found');
```

`checkObj({pet: "kitten", bed: "sleigh"}, "gift")` debe devolver la cadena `Not Found`.

```js
assert(checkObj({ pet: 'kitten', bed: 'sleigh' }, 'gift') === 'Not Found');
```

# --seed--

## --seed-contents--

```js
function checkObj(obj, checkProp) {
  // Only change code below this line
  return "Change Me!";
  // Only change code above this line
}
```

# --solutions--

```js
function checkObj(obj, checkProp) {
  if(obj.hasOwnProperty(checkProp)) {
    return obj[checkProp];
  } else {
    return "Not Found";
  }
}
```


text:
@interface RecipeDetailViewController : UIViewController

@property (nonatomic, strong) NSDictionary *recipeData;

@end


text:
"""Script which gathers the JSON results merged from multiple
swarming shards of a step on the waterfall.

This is used to feed in the per-test times of previous runs of tests
to the browser_test_runner's sharding algorithm, to improve shard
distribution.
"""

import argparse
import json
import logging
import sys

import six  # pylint: disable=import-error

# //content/test/gpu is Python 3-only at this point, but
# //testing/scripts/test_buildbucket_api_gpu_use_cases.py does import this file
# via Python 2 on bots during the "get compile targets for scripts" step. So,
# keep this compatibility in for now.
# pylint: disable=wrong-import-position
if six.PY3:
  import urllib.request as ulib
else:
  import urllib2 as ulib  # pylint: disable=import-error
# pylint: enable=wrong-import-position

def GetBuildData(method, request):
  # Explorable via RPC explorer:
  # https://cr-buildbucket.appspot.com/rpcexplorer/services/
  #   buildbucket.v2.Builds/{GetBuild|SearchBuilds}
  assert method in ['GetBuild', 'SearchBuilds']

  # The Python docs are wrong. It's fine for this payload to be just
  # a JSON string.
  headers = {'content-type': 'application/json', 'accept': 'application/json'}
  logging.debug('Making request:')
  logging.debug('%s', request)
  if not isinstance(request, bytes):
    request = request.encode('utf-8')
  url = ulib.Request(
      'https://cr-buildbucket.appspot.com/prpc/buildbucket.v2.Builds/' + method,
      request, headers)
  conn = ulib.urlopen(url)
  result = conn.read().decode('utf-8')
  conn.close()
  # Result is a multi-line string the first line of which is
  # deliberate garbage and the rest of which is a JSON payload.
  return json.loads(''.join(result.splitlines()[1:]))

def GetJsonForBuildSteps(bot, build):
  request = json.dumps({
      'builder': {
          'project': 'chromium',
          'bucket': 'ci',
          'builder': bot
      },
      'buildNumber': build,
      'fields': 'steps.*.name,steps.*.logs'
  })
  return GetBuildData('GetBuild', request)

def GetJsonForLatestGreenBuildSteps(bot):
  fields = [
      'builds.*.number',
      'builds.*.steps.*.name',
      'builds.*.steps.*.logs',
  ]
  request = json.dumps({
      'predicate': {
          'builder': {
              'project': 'chromium',
              'bucket': 'ci',
              'builder': bot
          },
          'status': 'SUCCESS'
      },
      'fields': ','.join(fields),
      'pageSize': 1
  })
  builds_json = GetBuildData('SearchBuilds', request)
  if 'builds' not in builds_json:
    raise ValueError('Returned json data does not have "builds"')
  builds = builds_json['builds']
  assert len(builds) == 1
  return builds[0]

def JsonLoadFromUrl(url):
  conn = ulib.urlopen(url + '?format=raw')
  result = conn.read()
  conn.close()
  return json.loads(result)

def FindStepLogURL(steps, step_name, log_name):
  # The format of this JSON-encoded protobuf is defined here:
  # https://chromium.googlesource.com/infra/luci/luci-go/+/main/
  #   buildbucket/proto/step.proto
  # It's easiest to just use the RPC explorer to fetch one and see
  # what's desired to extract.
  for step in steps:
    if 'name' not in step or 'logs' not in step:
      continue
    if step['name'].startswith(step_name):
      for log in step['logs']:
        if log.get('name') == log_name:
          return log.get('viewUrl')
  return None

def ExtractTestTimes(node, node_name, dest, delim):
  if 'times' in node:
    dest[node_name] = sum(node['times']) / len(node['times'])
  else:
    for k in node.keys():
      if isinstance(node[k], dict):
        test_name = node_name + delim + k if node_name else k
        ExtractTestTimes(node[k], test_name, dest, delim)

def GatherResults(bot, build, step):
  if build is None:
    build_json = GetJsonForLatestGreenBuildSteps(bot)
    build = build_json.get('number')
  else:
    build_json = GetJsonForBuildSteps(bot, build)

  logging.debug('Fetched information from bot %s, build %s', bot, build)

  if 'steps' not in build_json:
    raise ValueError('Returned Json data do not have "steps"')

  json_output = FindStepLogURL(build_json['steps'], step, 'json.output')
  if not json_output:
    raise ValueError(
        'Unable to find json.output from step starting with %s' % step)
  logging.debug('json.output for step starting with %s: %s', step, json_output)

  merged_json = JsonLoadFromUrl(json_output)
  extracted_times = {'times': {}}
  ExtractTestTimes(merged_json['tests'], '', extracted_times['times'],
                   merged_json['path_delimiter'])

  return extracted_times, merged_json

def main():
  rest_args = sys.argv[1:]
  parser = argparse.ArgumentParser(
      description="""
Gather JSON results from a run of a Swarming test.

Example invocation to fetch the WebGL 1.0 test runtimes from Linux FYI
Release (NVIDIA):

gather_swarming_json_results.py \
  --step webgl_conformance_gl_passthrough_tests \
  --output=../data/gpu/webgl_conformance_tests_output.json

Example invocation to fetch the WebGL 2.0 runtimes:
gather_swarming_json_results.py \
  --step webgl2_conformance_gl_passthrough_tests \
  --output=../data/gpu/webgl2_conformance_tests_output.json

""",
      formatter_class=argparse.ArgumentDefaultsHelpFormatter)
  parser.add_argument(
      '-v',
      '--verbose',
      action='store_true',
      default=False,
      help='Enable verbose output')
  parser.add_argument(
      '--bot',
      default='Linux FYI Release (NVIDIA)',
      help='Which bot to examine')
  parser.add_argument(
      '--build',
      type=int,
      help='Which build to fetch. If not specified, use '
      'the latest successful build.')
  parser.add_argument('--step',
                      default='webgl2_conformance_gl_passthrough_tests',
                      help='Which step to fetch (treated as a prefix)')
  parser.add_argument(
      '--output',
      metavar='FILE',
      default='output.json',
      help='Name of output file; contains only test run times')
  parser.add_argument(
      '--full-output',
      metavar='FILE',
      help='Name of complete output file if desired')

  options = parser.parse_args(rest_args)
  if options.verbose:
    logging.basicConfig(level=logging.DEBUG)

  if sys.version_info < (2, 7, 10):
    logging.warning('Script does not work with Python older than 2.7.10')
    return 0

  extracted_times, merged_json = GatherResults(options.bot, options.build,
                                               options.step)

  logging.debug('Saving output to %s', options.output)
  with open(options.output, 'w') as f:
    json.dump(
        extracted_times, f, sort_keys=True, indent=2, separators=(',', ': '))

  if options.full_output is not None:
    logging.debug('Saving full output to %s', options.full_output)
    with open(options.full_output, 'w') as f:
      json.dump(
          merged_json, f, sort_keys=True, indent=2, separators=(',', ': '))

  return 0

if __name__ == '__main__':
  sys.exit(main())


text:
<?php

namespace Tokenly\CounterpartyClient;

use Illuminate\Support\ServiceProvider;
use Tokenly\CounterpartyClient\CounterpartyClient;

/*
 * CounterpartyClientServiceProvider
 */
class CounterpartyClientServiceProvider extends ServiceProvider
{

    public function boot()
    {
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind(CounterpartyClient::class, function ($app) {
            $connection_string = env('XCPD_CONNECTION_STRING', 'http://localhost:4000');
            $client = new CounterpartyClient($connection_string, env('XCPD_RPC_USER'), env('XCPD_RPC_PASSWORD'));
            return $client;
        });
    }

}


text:
package trucksimulation.routing;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import com.graphhopper.GHRequest;
import com.graphhopper.GHResponse;
import com.graphhopper.GraphHopper;
import com.graphhopper.PathWrapper;
import com.graphhopper.routing.util.EncodingManager;
import com.graphhopper.util.Instruction;

import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;

public class Route {

	private Position start;
	private Position goal;
	private RouteSegment[] segments;
	private double timeMs;
	private double distanceMeters;
	private transient PathWrapper pathWrapper;
	private transient String osmPath;
	private transient String ghCacheLocation;
	private transient GraphHopper hopper;

	private static final Logger LOGGER = LoggerFactory.getLogger(Route.class);

	public static Route getRoute(GraphHopper hopper, Position start, Position destination) {
		Route r = new Route(start, destination, hopper);
		r.init();
		return r;
	}

	public Route() {
		String userHome = System.getProperty("user.home");
		ghCacheLocation = new File(userHome, ".graphhopper").getAbsolutePath();
	}

	private Route(Position start, Position dest, GraphHopper hopper) {
		this();
		this.start = start;
		this.goal = dest;
		this.hopper = hopper;
	}

	private void init() {
		calcRoute();
		loadRouteFromWrapper();
	}

	private void loadGraphHopper() {
		// create one GraphHopper instance
		Map<String, String> env = System.getenv();
		if(Boolean.valueOf(env.get("LOW_MEMORY"))) {
			LOGGER.info("Using Graphhopper for mobile due to LOW_MEMORY env.");
			hopper = new GraphHopper().forMobile();
			hopper.setCHPrepareThreads(1);
		} else {
			hopper = new GraphHopper().forServer();
		}
		hopper.setOSMFile(osmPath);
		hopper.setGraphHopperLocation(ghCacheLocation);
		hopper.setEncodingManager(new EncodingManager("car"));
		hopper.importOrLoad();
	}

	private void calcRoute() {
		if(hopper == null) {
			loadGraphHopper();
		}
		// simple configuration of the request object, see the GraphHopperServlet classs for more possibilities.
		GHRequest req = new GHRequest(start.getLat(), start.getLon(), goal.getLat(), goal.getLon()).
		    setWeighting("fastest").
		    setVehicle("car").
		    setLocale(Locale.US);
		GHResponse rsp = hopper.route(req);

		// first check for errors
		if(rsp.hasErrors()) {
		   throw new IllegalArgumentException("Could not calculate route. Check coordinates.", rsp.getErrors().get(0));
		}
		pathWrapper = rsp.getBest();
	}

	private void loadRouteFromWrapper() {
		this.timeMs = pathWrapper.getTime();
		this.distanceMeters = pathWrapper.getDistance();

		List<RouteSegment> tmpSegList = new ArrayList<>(pathWrapper.getInstructions().size());
		for(int s = 0; s < pathWrapper.getInstructions().size(); s++) {
			Instruction inst = pathWrapper.getInstructions().get(s);
			if(inst.getPoints().size() > 1) {
				double dist = inst.getDistance();
				double time = inst.getTime();
				double lats[] = new double[inst.getPoints().size()];
				double lons[] = new double[inst.getPoints().size()];
				for(int i = 0; i < inst.getPoints().size(); i++) {
					lats[i] = inst.getPoints().getLat(i);
					lons[i] = inst.getPoints().getLon(i);
				}
				RouteSegment segment = new RouteSegment(lats, lons, time, dist);
				tmpSegList.add(segment);
			} else {
				//TODO: append point to previous segment if position is different
				// from previous point
				LOGGER.warn("Dropped point from instruction list.");
			}
		}
		segments = tmpSegList.toArray(new RouteSegment[0]);
		// wrapper can be garbage collected, it is no longer needed
		pathWrapper = null;
	}

	public RouteSegment getSegment(int index) {
		return segments[index];
	}

	public int getSegmentCount() {
		return segments.length;
	}

	public Position getStart() {
		return start;
	}

	public void setStart(Position start) {
		this.start = start;
	}

	public Position getGoal() {
		return goal;
	}

	public void setGoal(Position goal) {
		this.goal = goal;
	}

	/**
	 *
	 * @return approximate time in milliseconds that is needed to drive the route.
	 */
	public double getTimeMs() {
		return timeMs;
	}

	public void setTimeMs(double time) {
		this.timeMs = time;
	}

	public double getDistanceMeters() {
		return distanceMeters;
	}

	public void setDistanceMeters(double distance) {
		this.distanceMeters = distance;
	}

	public RouteSegment[] getSegments() {
		return segments;
	}

	/**
	 * Sets the route's segments and updates start and goal accordingly.
	 * @param segments
	 */
	public void setSegments(RouteSegment... segments) {
		if(segments == null) {
			throw new IllegalArgumentException("segments must not be null");
		}
		this.segments = segments;
		this.start = segments[0].getPoint(0);
		RouteSegment lastSeg = segments[segments.length-1];
		this.goal = lastSeg.getPoint(lastSeg.getSize()-1);
	}

	public String getGhCacheLocation() {
		return ghCacheLocation;
	}

	public void setGhCacheLocation(String ghCacheLocation) {
		this.ghCacheLocation = ghCacheLocation;
	}

	@Override
	public String toString() {
		return String.format("%s -> %s", start, goal);
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>0.9.9 API documenation: GLM_GTX_projection</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

0.9.9 API documenation

Functions

GLM_GTX_projection
Experimental extensions

Functions

template<typename genType >

GLM_FUNC_DECL genType 	proj (genType const &x, genType const &Normal)

Detailed Description

Include <glm/gtx/projection.hpp> to use the features of this extension.

Projection of a vector to other one

Function Documentation

◆ proj()

          GLM_FUNC_DECL genType glm::proj
          (
          genType const &
          x,

          genType const &
          Normal

          )

Projects x on Normal.

See also

GLM_GTX_projection

<address class="footer">
Generated by

 1.8.14
</address>


text:
import * as DOM from "../../core/util/dom";

interface DropdownProps {
  button_type: "default" | "primary" | "success" | "warning" | "danger" | "link";
  label: string;
}

export default (props: DropdownProps): HTMLElement => {
  const classes = ["bk-bs-btn", `bk-bs-btn-${props.button_type}`, "bk-bs-dropdown-toggle", "bk-bs-dropdown-btn"]
  return (
    <fragment>
      <button type="button" class={classes} data-bk-bs-toggle="dropdown">
        {props.label}
      </button>

    </fragment>
  )
}


text:
- Add types & country options to geocoder [#65](https://github.com/mapbox/mapbox-sdk-js/pull/65)

## 0.11.0

- Allow pagination options if passed in listFeatures [#61](https://github.com/mapbox/mapbox-sdk-js/pull/61)

## 0.10.0

- Support query params for Directions requests [#58](https://github.com/mapbox/mapbox-sdk-js/pull/58)

## 0.9.0

- Adds a `precision` option to geocodeForward and geocodeReverse methods:
  this allows you to customize how much decimal precision is provided
  wth proximity parameters and the location of geocodeReverse requests,
  potentially increasing cache-friendliness.

## 0.8.2

- Fixes geocodeReverse method

## 0.8.1

- Include Mapbox Distance in default client

## 0.8.0

- Added support for the [Distance API](https://www.mapbox.com/blog/distance-api/)

## 0.7.0

- Improved error handling
- Added support for Tileset statistics API (in preview)

## 0.6.2

- Added support for [Upload API](https://www.mapbox.com/developers/api/uploads/)
- Added support for Datasets API (in preview)

## 0.6.1

* Fixed bug in forward geococoding

## 0.6.0

* Allows endpoint to be customized
* Support for sub-requiring individual services

## 0.5.0

* Added `surface` method that connects to [Mapbox Surface API](https://www.mapbox.com/developers/api/surface/)

## 0.4.0

* Added `matching` method that connects to the [Mapbox Map Matching API](https://www.mapbox.com/blog/map-matching)

## 0.3.0

* Added `getDirections` method that connects to the [Mapbox Directions API](https://www.mapbox.com/developers/api/directions/)

## 0.2.0

* Added `geocodeForward` and `geocodeReverse` that connect to the [Mapbox Geocoding API](https://www.mapbox.com/developers/api/geocoding/)


text:
(function (view) {
  'use strict';
  view.index = {};

  //首页 脚本
  $.extend(view.index, {
    init: function () {
      this.flexSlider();
    },
    flexSlider: function(){
      // The slider being synced must be initialized first
      $('#flexSlider').flexslider({
        slideshowSpeed: 3500,
        animationSpeed: 300,
        animation: 'slide',
        controlNav: 'thumbnails',
        controlsContainer: '#controlsContainer'
      });
    }
  });

})(hopeView);


text:
import _ from "lodash";
import {initialiseData} from "../common/index";
import template from "./survey-template-edit.html";
import {displayError} from "../common/error-utils";
import {CORE_API} from "../common/services/core-api-utils";
import toasts from "../svelte-stores/toast-store";

/*
    Note: this list of functions/operators is derived from the capabilities of BigEval and the extension methods
    in `surveyUtils::mkSurveyExpressionEvaluator`
*/
const qInclusionPredicateHelp = `
The inclusion predicate allows for questions to be conditionally included in a survey depending on the values of other fields.
See the documentation for a complete list of functions and their arguments.  Below is a selection of the main functions/operators:

* \`< <= > >= == != && || ! \`: logical operators
* \`isChecked(extId, <defaultValue>)\`: \`true\` if the question with the given ext id is checked, \`false\` if not checked,
  or \`defaultValue\` if the answer is currently undefined.
* \`numberValue(extId, <defaultValue>)\`: numeric value of the response for the given ext id (or \`defaultValue\`)
* \`ditto(extId)\`: evaluates same conditions from a different question.  Useful for repetition of complex predicates.
* \`val(extId, <defaultValue>)\`: returns the current value
* \`assessmentRating(name|extId, <defaultValue>)\`: returns code value of the matching rating (returns null if no default given and no assessment found)
* \`belongsToOrgUnit(name|extId)\`: returns true if the subject app is part of the given org unit tree
* \`dataTypeUsages(name|extId)\`: returns set of usage kinds for the given data types (use the \`=~\` operator to test for membership)
* \`isRetiring()\`: (application only) true if app has planned retirement date but no actual retirement date
* \`hasDataType(name|extId)\`: returns whether the specified datatype (or a descendent) is in use by the app
* \`hasInvolvement(roleName)\`: returns whether the subject entity has any involvement record with the given role name
* \`hasLifecyclePhase(lifecyclePhase)\`: returns true of the given lifecycle phase matches the entities lifecycles phase. (PRODUCTION, DEVELOPMENT, CONCEPTUAL, RETIRED)
* \`isAppKind(applicationKind)\`: returns true of the given app kind phase matches the application kind. ( IN_HOUSE, INTERNALLY_HOSTED, EXTERNALLY_HOSTED, EUC, THIRD_PARTY, CUSTOMISED, EXTERNAL)

See the JEXL documentation.
`;

const initialState = {
    editingQuestion: false,
    questionFieldTypes: [{
        name: "Text",
        value: "TEXT"
    },{
        name: "Text Area",
        value: "TEXTAREA"
    },{
        name: "Number",
        value: "NUMBER"
    },{
        name: "Boolean",
        value: "BOOLEAN"
    },{
        name: "Date",
        value: "DATE"
    },{
        name: "Dropdown",
        value: "DROPDOWN"
    },{
        name: "Dropdown (Multi-Select)",
        value: "DROPDOWN_MULTI_SELECT"
    },{
        name: "Measurable tree (Multi-Select)",
        value: "MEASURABLE_MULTI_SELECT"
    },{
        name: "Application",
        value: "APPLICATION"
    },{
        name: "Person",
        value: "PERSON"
    }],
    selectedQuestionInfo: {},
    surveyQuestions: [],
    surveyTemplate: {},
    targetEntityKinds: [{
        name: "Application",
        value: "APPLICATION"
    },{
        name: "Change Initiative",
        value: "CHANGE_INITIATIVE"
    }],
    qInclusionPredicateHelp
};

function controller($q,
                    $stateParams,
                    serviceBroker) {

    const vm = initialiseData(this, initialState);
    vm.id = $stateParams.id;

    serviceBroker
        .loadAppData(CORE_API.MeasurableCategoryStore.findAll)
        .then(r => vm.measurableCategories = r.data);

    serviceBroker
        .loadViewData(CORE_API.SurveyTemplateStore.getById, [vm.id])
        .then(r => vm.surveyTemplate = r.data);

    const loadQuestions = () => {
        const questionPromise = serviceBroker
            .loadViewData(CORE_API.SurveyQuestionStore.findQuestionsForTemplate, [vm.id], {force: true})
            .then(r => vm.surveyQuestions = r.data);

        const dropdownPromise = serviceBroker
            .loadViewData(CORE_API.SurveyQuestionStore.findDropdownEntriesForTemplate, [vm.id], {force: true})
            .then(r => vm.dropdownEntriesByQuestionId = _.groupBy(r.data, d => d.questionId));

        return $q
            .all([questionPromise, dropdownPromise]);
    }

    vm.updateTemplate = () => {
        serviceBroker
            .execute(
                CORE_API.SurveyTemplateStore.update,
                [{
                    id: vm.surveyTemplate.id,
                    name: vm.surveyTemplate.name,
                    description: vm.surveyTemplate.description,
                    targetEntityKind: vm.surveyTemplate.targetEntityKind,
                    externalId: vm.surveyTemplate.externalId
                }])
            .then(() => toasts.success("Survey template updated successfully"));
    };

    vm.showAddQuestionForm = () => {
        vm.editingQuestion = true;
        const currentMaxPos = _
            .chain(vm.surveyQuestionInfos)
            .map(qi => qi.question.position)
            .max()
            .value();

        vm.selectedQuestionInfo = {
            question: {
                surveyTemplateId: vm.id,
                isMandatory: false,
                allowComment: false,
                position: (currentMaxPos || 0) + 10,
                externalId: null,
                parentExternalId: null,
                label: null,
                inclusionPredicate: null
            },
            dropdownEntries: []
        };
    };

    vm.showEditQuestionForm = (question) => {
        vm.editingQuestion = true;
        const dropdownEntries = vm.dropdownEntriesByQuestionId[question.id] || [];
        vm.selectedQuestionInfo = {
            question: _.cloneDeep(question),
            dropdownEntries: _.cloneDeep(dropdownEntries)
        };
    };

    vm.cancelQuestionForm = () => {
        vm.editingQuestion = false;
        vm.selectedQuestionInfo = null;
    };

    vm.createQuestion = (qi) => {

        if(qi.question.fieldType === "MEASURABLE_MULTI_SELECT"){
            qi.question.qualifierEntity.kind = "MEASURABLE_CATEGORY";
        }

        serviceBroker
            .execute(CORE_API.SurveyQuestionStore.create, [qi])
            .then(() => {
                toasts.success("Survey question created successfully");
                loadQuestions();
                vm.cancelQuestionForm();
            });
    };

    vm.updateQuestion = (qi) => {

        if(qi.question.fieldType === "MEASURABLE_MULTI_SELECT"){
            qi.question.qualifierEntity.kind = "MEASURABLE_CATEGORY";
        }

        serviceBroker
            .execute(CORE_API.SurveyQuestionStore.update, [qi])
            .then(() => {
                toasts.success("Survey question updated successfully");
                loadQuestions();
                vm.cancelQuestionForm();
            });
    };

    vm.deleteQuestion = (qi) => {
        if (confirm("Are you sure you want to delete this question?")) {
            serviceBroker
                .execute(CORE_API.SurveyQuestionStore.deleteQuestion, [qi.question.id])
                .then(() => {
                    toasts.success("Survey question deleted successfully");
                    loadQuestions();
                    vm.cancelQuestionForm();
                })
                .catch(e => displayError("Survey question was not deleted", e))
        }
    };

    vm.updateEntries = (entries) => {
        vm.selectedQuestionInfo.dropdownEntries = _.map(
            entries,
            (e, i) => Object.assign({
                questionId: vm.selectedQuestionInfo.question.id,
                position: i + 1
            }, e));
    };

    loadQuestions();
}

controller.$inject = [
    "$q",
    "$stateParams",
    "ServiceBroker",
];

const page = {
    controller,
    controllerAs: "ctrl",
    template
};

export default page;


text:
module Fog
  module AWS
    class Elasticache
      class Real
        require 'fog/aws/parsers/elasticache/event_list'

        # Returns a list of service events
		#
		# For more information see:
        # http://docs.amazonwebservices.com/AmazonElastiCache/latest/APIReference/API_DescribeEvents.html
        #
        # === Parameters (optional)
        # * options <~Hash> (optional):
        # *  :start_time <~DateTime> - starting time for event records
        # *  :end_time <~DateTime> - ending time for event records
        # *  :duration <~Integer> - time span for event records
        # *  :marker <~String> - marker provided in the previous request
        # *  :max_records <~Integer> - the maximum number of records to include
        # *  :source_identifier <~String> - identifier of the event source
        # *  :source_type <~String> - event type, one of:
        #      (cache-cluster | cache-parameter-group | cache-security-group)
        # === Returns
        # * response <~Excon::Response>:
        #   * body <~Hash>
        def describe_events(options = {})
          request(
            'Action'            => 'DescribeEvents',
            'StartTime'         => options[:start_time],
            'EndTime'           => options[:end_time],
            'Duration'          => options[:duration],
            'Marker'            => options[:marker],
            'MaxRecords'        => options[:max_records],
            'SourceIdentifier'  => options[:source_identifier],
            'SourceType'        => options[:source_type],
            :parser => Fog::Parsers::AWS::Elasticache::EventListParser.new
          )
        end
      end

      class Mock
        def describe_events
          Fog::Mock.not_implemented
        end
      end
    end
  end
end


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.dataflow.model;

/**
 * Request to send encoded debug information. Next ID: 8
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Dataflow API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class SendDebugCaptureRequest extends com.google.api.client.json.GenericJson {

  /**
   * The internal component id for which debug information is sent.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String componentId;

  /**
   * The encoded debug information.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String data;

  /**
   * Format for the data field above (id=5).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String dataFormat;

  /**
   * The [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)
   * that contains the job specified by job_id.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String location;

  /**
   * The worker id, i.e., VM hostname.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String workerId;

  /**
   * The internal component id for which debug information is sent.
   * @return value or {@code null} for none
   */
  public java.lang.String getComponentId() {
    return componentId;
  }

  /**
   * The internal component id for which debug information is sent.
   * @param componentId componentId or {@code null} for none
   */
  public SendDebugCaptureRequest setComponentId(java.lang.String componentId) {
    this.componentId = componentId;
    return this;
  }

  /**
   * The encoded debug information.
   * @return value or {@code null} for none
   */
  public java.lang.String getData() {
    return data;
  }

  /**
   * The encoded debug information.
   * @param data data or {@code null} for none
   */
  public SendDebugCaptureRequest setData(java.lang.String data) {
    this.data = data;
    return this;
  }

  /**
   * Format for the data field above (id=5).
   * @return value or {@code null} for none
   */
  public java.lang.String getDataFormat() {
    return dataFormat;
  }

  /**
   * Format for the data field above (id=5).
   * @param dataFormat dataFormat or {@code null} for none
   */
  public SendDebugCaptureRequest setDataFormat(java.lang.String dataFormat) {
    this.dataFormat = dataFormat;
    return this;
  }

  /**
   * The [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)
   * that contains the job specified by job_id.
   * @return value or {@code null} for none
   */
  public java.lang.String getLocation() {
    return location;
  }

  /**
   * The [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)
   * that contains the job specified by job_id.
   * @param location location or {@code null} for none
   */
  public SendDebugCaptureRequest setLocation(java.lang.String location) {
    this.location = location;
    return this;
  }

  /**
   * The worker id, i.e., VM hostname.
   * @return value or {@code null} for none
   */
  public java.lang.String getWorkerId() {
    return workerId;
  }

  /**
   * The worker id, i.e., VM hostname.
   * @param workerId workerId or {@code null} for none
   */
  public SendDebugCaptureRequest setWorkerId(java.lang.String workerId) {
    this.workerId = workerId;
    return this;
  }

  @Override
  public SendDebugCaptureRequest set(String fieldName, Object value) {
    return (SendDebugCaptureRequest) super.set(fieldName, value);
  }

  @Override
  public SendDebugCaptureRequest clone() {
    return (SendDebugCaptureRequest) super.clone();
  }

}


text:
<?php

namespace IPS\core\modules\front\staffdirectory;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Staff directory
 */
class _directory extends \IPS\Dispatcher\Controller
{
	/**
	 * Main execute entry point - used to override breadcrumb
	 *
	 * @return void
	 */
	public function execute()
	{
		\IPS\Output::i()->breadcrumb['module'] = array( \IPS\Http\Url::internal( 'app=core&module=staffdirectory&controller=directory', 'front', 'staffdirectory' ), \IPS\Member::loggedIn()->language()->addToStack('staff') );

		parent::execute();
	}

	/**
	 * Show staff directory
	 *
	 * @return	void
	 */
	protected function manage()
	{
		$groups = \IPS\core\StaffDirectory\Group::roots();

		try
		{
			\IPS\core\StaffDirectory\User::load( \IPS\Member::loggedIn()->member_id, 'leader_type_id', array( 'leader_type=?', 'm' ) );
			$userIsStaff	= TRUE;
		}
		catch( \OutOfRangeException $e )
		{
			$userIsStaff	= FALSE;
		}

		\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'styles/staff.css' ) );

		if ( \IPS\Theme::i()->settings['responsive'] )
		{
			\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'styles/staff_responsive.css' ) );
		}

		\IPS\Output::i()->title		= \IPS\Member::loggedIn()->language()->addToStack('staff_directory');
		\IPS\Output::i()->output	= \IPS\Theme::i()->getTemplate( 'staffdirectory' )->template( $groups, $userIsStaff );
	}

	/**
	 * Edit your own information
	 *
	 * @return	void
	 */
	protected function form()
	{
		try
		{
			$user = \IPS\core\StaffDirectory\User::load( \IPS\Member::loggedIn()->member_id, 'leader_type_id', array( 'leader_type=?', 'm' ) );
		}
		catch( \OutOfRangeException $e )
		{
			\IPS\Output::i()->error( 'node_error', '2C156/1', 404, '' );
		}

		$form	= new \IPS\Helpers\Form;
		$form->add( new \IPS\Helpers\Form\Text( 'leader_custom_name', ( \IPS\Member::loggedIn()->language()->checkKeyExists("core_staff_directory_name_{$user->id}") ) ? \IPS\Member::loggedIn()->language()->addToStack("core_staff_directory_name_{$user->id}") : \IPS\Member::loggedIn()->name, FALSE ) );
		$form->add( new \IPS\Helpers\Form\Text( 'leader_custom_title', ( \IPS\Member::loggedIn()->language()->checkKeyExists("core_staff_directory_title_{$user->id}") ) ? \IPS\Member::loggedIn()->language()->addToStack("core_staff_directory_title_{$user->id}") : \IPS\Member::loggedIn()->member_title, FALSE ) );
		$form->add( new \IPS\Helpers\Form\Editor( 'leader_custom_bio', \IPS\Member::loggedIn()->language()->addToStack("core_staff_directory_bio_{$user->id}"), FALSE, array(
				'app'			=> 'core',
				'key'			=> 'Staffdirectory',
				'autoSaveKey'	=> 'leader-' . $user->id,
				'attachIds'		=> array( $user->id )
		) ) );

		if( $values = $form->values() )
		{
			/* Save */
			\IPS\Lang::saveCustom( 'core', "core_staff_directory_name_{$user->id}", $values['leader_custom_name'] );
			\IPS\Lang::saveCustom( 'core', "core_staff_directory_title_{$user->id}", $values['leader_custom_title'] );
			\IPS\Lang::saveCustom( 'core', "core_staff_directory_bio_{$user->id}", $values['leader_custom_bio'] );

			//$user->save();

			/* Redirect */
			\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=staffdirectory&controller=directory", 'front', 'staffdirectory' ), 'saved' );
		}

		\IPS\Output::i()->title		= \IPS\Member::loggedIn()->language()->addToStack('leader_edit_mine');
		\IPS\Output::i()->output	= \IPS\Theme::i()->getTemplate( 'global' )->genericBlock( $form, '', 'ipsPad' );
	}
}


text:
<?php

namespace Certificationy\Bundle\WebBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

class CertificationyWebExtension extends Extension
{
    /**
     * @param array            $configs
     * @param ContainerBuilder $container
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }
}