text:
<!DOCTYPE html>

    <title>Video Test: video_volume_check</title>
    <link rel="author" title="Intel" href="http://www.intel.com" />
    <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
    <meta name="flags" content="" />
    <meta name="assert" content="Check that video.volume returns the value of the muted content attribute" />

    <video id="m">The user agent doesn't support media element.</video>


text:
package org.apache.axis2.description;

import org.apache.axis2.AxisFault;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.wsdl.WSDLConstants;

public class AxisOperationFactory implements WSDLConstants {

    public static AxisOperation getAxisOperation(int mepURI) throws AxisFault {
        AxisOperation abOpdesc;

        switch (mepURI) {
            case WSDLConstants.MEP_CONSTANT_IN_ONLY : {
                abOpdesc = new InOnlyAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY);
                break;
            }
            case WSDLConstants.MEP_CONSTANT_OUT_ONLY : {
                abOpdesc = new OutOnlyAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_OUT_ONLY);
                break;
            }
            case WSDLConstants.MEP_CONSTANT_IN_OUT : {
                abOpdesc = new InOutAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT);
                break;
            }
            case WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT : {
                abOpdesc = new InOutAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OPTIONAL_OUT);
                break;
            }
            case WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY : {
                abOpdesc = new InOutAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY);
                break;
            }
            case WSDLConstants.MEP_CONSTANT_OUT_IN : {
                abOpdesc = new OutInAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_OUT_IN);
                break;
            }
            case WSDLConstants.MEP_CONSTANT_OUT_OPTIONAL_IN : {
                abOpdesc = new OutInAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_OUT_OPTIONAL_IN);
                break;
            }
            case WSDLConstants.MEP_CONSTANT_ROBUST_OUT_ONLY : {
                abOpdesc = new RobustOutOnlyAxisOperation();
                abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY);
                break;
            }
            default : {
                throw new AxisFault(Messages.getMessage("unSupportedMEP", "ID is " + mepURI));
            }
        }
        return abOpdesc;
    }

    //FIXME add in the latest MEP URIs AND needs to double check on about the mep we had in 2004
    @SuppressWarnings("deprecation")
    public static AxisOperation getOperationDescription(String mepURI) throws AxisFault {
        AxisOperation abOpdesc;
        if (WSDL2Constants.MEP_URI_IN_ONLY.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_IN_ONLY.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_IN_ONLY.equals(mepURI)) {
            abOpdesc = new InOnlyAxisOperation();
        } else if (WSDL2Constants.MEP_URI_OUT_ONLY.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_OUT_ONLY.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_OUT_ONLY.equals(mepURI)) {
            abOpdesc = new OutOnlyAxisOperation();
        } else if (WSDL2Constants.MEP_URI_IN_OUT.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_IN_OUT.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_IN_OUT.equals(mepURI)) {
            abOpdesc = new InOutAxisOperation();
        } else if (WSDL2Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mepURI)) {
            abOpdesc = new InOutAxisOperation();
        } else if (WSDL2Constants.MEP_URI_OUT_IN.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_OUT_IN.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_OUT_IN.equals(mepURI)) {
            abOpdesc = new OutInAxisOperation();
        } else if (WSDL2Constants.MEP_URI_OUT_OPTIONAL_IN.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_OUT_OPTIONAL_IN.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_OUT_OPTIONAL_IN.equals(mepURI)) {
            abOpdesc = new OutInAxisOperation();
        } else if (WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_ROBUST_OUT_ONLY.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_ROBUST_OUT_ONLY.equals(mepURI)) {
            abOpdesc = new OutInAxisOperation();
            abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY);
        } else if (WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(mepURI) ||
                WSDL20_2006Constants.MEP_URI_ROBUST_IN_ONLY.equals(mepURI) ||
                WSDL20_2004_Constants.MEP_URI_ROBUST_IN_ONLY.equals(mepURI)) {
            abOpdesc = new InOnlyAxisOperation();
            abOpdesc.setMessageExchangePattern(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY);
        } else {
            throw new AxisFault(Messages.getMessage("unSupportedMEP", "ID is " + mepURI));
        }
        return abOpdesc;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<component name="libraryTable">
  <library name="Maven: org.apache.servicemix.bundles:org.apache.servicemix.bundles.spring-aspects:4.0.5.RELEASE_1">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/servicemix/bundles/org.apache.servicemix.bundles.spring-aspects/4.0.5.RELEASE_1/org.apache.servicemix.bundles.spring-aspects-4.0.5.RELEASE_1.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/servicemix/bundles/org.apache.servicemix.bundles.spring-aspects/4.0.5.RELEASE_1/org.apache.servicemix.bundles.spring-aspects-4.0.5.RELEASE_1-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/servicemix/bundles/org.apache.servicemix.bundles.spring-aspects/4.0.5.RELEASE_1/org.apache.servicemix.bundles.spring-aspects-4.0.5.RELEASE_1-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
namespace google {
namespace cloud {
namespace notebooks {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

///
/// API v1 service for Managed Notebooks.
///
/// @par Equality
///
/// Instances of this class created via copy-construction or copy-assignment
/// always compare equal. Instances created with equal
/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
/// equal share the same underlying resources.
///
/// @par Performance
///
/// Creating a new instance of this class is a relatively expensive operation,
/// new objects establish new connections to the service. In contrast,
/// copy-construction, move-construction, and the corresponding assignment
/// operations are relatively efficient as the copies share all underlying
/// resources.
///
/// @par Thread Safety
///
/// Concurrent access to different instances of this class, even if they compare
/// equal, is guaranteed to work. Two or more threads operating on the same
/// instance of this class is not guaranteed to work. Since copy-construction
/// and move-construction is a relatively efficient operation, consider using
/// such a copy when using this class from multiple threads.
///
class ManagedNotebookServiceClient {
 public:
  explicit ManagedNotebookServiceClient(
      std::shared_ptr<ManagedNotebookServiceConnection> connection,
      Options opts = {});
  ~ManagedNotebookServiceClient();

  ///@{
  // @name Copy and move support
  ManagedNotebookServiceClient(ManagedNotebookServiceClient const&) = default;
  ManagedNotebookServiceClient& operator=(ManagedNotebookServiceClient const&) =
      default;
  ManagedNotebookServiceClient(ManagedNotebookServiceClient&&) = default;
  ManagedNotebookServiceClient& operator=(ManagedNotebookServiceClient&&) =
      default;
  ///@}

  ///@{
  // @name Equality
  friend bool operator==(ManagedNotebookServiceClient const& a,
                         ManagedNotebookServiceClient const& b) {
    return a.connection_ == b.connection_;
  }
  friend bool operator!=(ManagedNotebookServiceClient const& a,
                         ManagedNotebookServiceClient const& b) {
    return !(a == b);
  }
  ///@}

  ///
  /// Lists Runtimes in a given project and location.
  ///
  /// @param parent  Required. Format:
  ///  `parent=projects/{project_id}/locations/{location}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.ListRuntimesRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L168}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  StreamRange<google::cloud::notebooks::v1::Runtime> ListRuntimes(
      std::string const& parent, Options opts = {});

  ///
  /// Lists Runtimes in a given project and location.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::ListRuntimesRequest,google/cloud/notebooks/v1/managed_service.proto#L168}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.ListRuntimesRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L168}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  StreamRange<google::cloud::notebooks::v1::Runtime> ListRuntimes(
      google::cloud::notebooks::v1::ListRuntimesRequest request,
      Options opts = {});

  ///
  /// Gets details of a single Runtime. The location must be a regional endpoint
  /// rather than zonal.
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.GetRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L202}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  StatusOr<google::cloud::notebooks::v1::Runtime> GetRuntime(
      std::string const& name, Options opts = {});

  ///
  /// Gets details of a single Runtime. The location must be a regional endpoint
  /// rather than zonal.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::GetRuntimeRequest,google/cloud/notebooks/v1/managed_service.proto#L202}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.GetRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L202}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  StatusOr<google::cloud::notebooks::v1::Runtime> GetRuntime(
      google::cloud::notebooks::v1::GetRuntimeRequest const& request,
      Options opts = {});

  ///
  /// Creates a new Runtime in a given project and location.
  ///
  /// @param parent  Required. Format:
  ///  `parent=projects/{project_id}/locations/{location}`
  /// @param runtime_id  Required. User-defined unique ID of this Runtime.
  /// @param runtime  Required. The Runtime to be created.
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.CreateRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L214}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> CreateRuntime(
      std::string const& parent, std::string const& runtime_id,
      google::cloud::notebooks::v1::Runtime const& runtime, Options opts = {});

  ///
  /// Creates a new Runtime in a given project and location.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::CreateRuntimeRequest,google/cloud/notebooks/v1/managed_service.proto#L214}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.CreateRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L214}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> CreateRuntime(
      google::cloud::notebooks::v1::CreateRuntimeRequest const& request,
      Options opts = {});

  ///
  /// Deletes a single Runtime.
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::OperationMetadata,google/cloud/notebooks/v1/service.proto#L408}
  ///
  /// [google.cloud.notebooks.v1.DeleteRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L235}
  /// [google.cloud.notebooks.v1.OperationMetadata]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/service.proto#L408}
  ///
  future<StatusOr<google::cloud::notebooks::v1::OperationMetadata>>
  DeleteRuntime(std::string const& name, Options opts = {});

  ///
  /// Deletes a single Runtime.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::DeleteRuntimeRequest,google/cloud/notebooks/v1/managed_service.proto#L235}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::OperationMetadata,google/cloud/notebooks/v1/service.proto#L408}
  ///
  /// [google.cloud.notebooks.v1.DeleteRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L235}
  /// [google.cloud.notebooks.v1.OperationMetadata]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/service.proto#L408}
  ///
  future<StatusOr<google::cloud::notebooks::v1::OperationMetadata>>
  DeleteRuntime(
      google::cloud::notebooks::v1::DeleteRuntimeRequest const& request,
      Options opts = {});

  ///
  /// Starts a Managed Notebook Runtime.
  /// Perform "Start" on GPU instances; "Resume" on CPU instances
  /// See:
  /// https://cloud.google.com/compute/docs/instances/stop-start-instance
  /// https://cloud.google.com/compute/docs/instances/suspend-resume-instance
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.StartRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L250}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> StartRuntime(
      std::string const& name, Options opts = {});

  ///
  /// Starts a Managed Notebook Runtime.
  /// Perform "Start" on GPU instances; "Resume" on CPU instances
  /// See:
  /// https://cloud.google.com/compute/docs/instances/stop-start-instance
  /// https://cloud.google.com/compute/docs/instances/suspend-resume-instance
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::StartRuntimeRequest,google/cloud/notebooks/v1/managed_service.proto#L250}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.StartRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L250}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> StartRuntime(
      google::cloud::notebooks::v1::StartRuntimeRequest const& request,
      Options opts = {});

  ///
  /// Stops a Managed Notebook Runtime.
  /// Perform "Stop" on GPU instances; "Suspend" on CPU instances
  /// See:
  /// https://cloud.google.com/compute/docs/instances/stop-start-instance
  /// https://cloud.google.com/compute/docs/instances/suspend-resume-instance
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.StopRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L260}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> StopRuntime(
      std::string const& name, Options opts = {});

  ///
  /// Stops a Managed Notebook Runtime.
  /// Perform "Stop" on GPU instances; "Suspend" on CPU instances
  /// See:
  /// https://cloud.google.com/compute/docs/instances/stop-start-instance
  /// https://cloud.google.com/compute/docs/instances/suspend-resume-instance
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::StopRuntimeRequest,google/cloud/notebooks/v1/managed_service.proto#L260}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.StopRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L260}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> StopRuntime(
      google::cloud::notebooks::v1::StopRuntimeRequest const& request,
      Options opts = {});

  ///
  /// Switch a Managed Notebook Runtime.
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.SwitchRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L270}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> SwitchRuntime(
      std::string const& name, Options opts = {});

  ///
  /// Switch a Managed Notebook Runtime.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::SwitchRuntimeRequest,google/cloud/notebooks/v1/managed_service.proto#L270}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.SwitchRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L270}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> SwitchRuntime(
      google::cloud::notebooks::v1::SwitchRuntimeRequest const& request,
      Options opts = {});

  ///
  /// Resets a Managed Notebook Runtime.
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.ResetRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L286}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> ResetRuntime(
      std::string const& name, Options opts = {});

  ///
  /// Resets a Managed Notebook Runtime.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::ResetRuntimeRequest,google/cloud/notebooks/v1/managed_service.proto#L286}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.ResetRuntimeRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L286}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> ResetRuntime(
      google::cloud::notebooks::v1::ResetRuntimeRequest const& request,
      Options opts = {});

  ///
  /// Report and process a runtime event.
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.ReportRuntimeEventRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L296}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> ReportRuntimeEvent(
      std::string const& name, Options opts = {});

  ///
  /// Report and process a runtime event.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::ReportRuntimeEventRequest,google/cloud/notebooks/v1/managed_service.proto#L296}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::Runtime,google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  /// [google.cloud.notebooks.v1.ReportRuntimeEventRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L296}
  /// [google.cloud.notebooks.v1.Runtime]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/runtime.proto#L33}
  ///
  future<StatusOr<google::cloud::notebooks::v1::Runtime>> ReportRuntimeEvent(
      google::cloud::notebooks::v1::ReportRuntimeEventRequest const& request,
      Options opts = {});

  ///
  /// Gets an access token for the consumer service account that the customer
  /// attached to the runtime. Only accessible from the tenant instance.
  ///
  /// @param name  Required. Format:
  ///  `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`
  /// @param vm_id  Required. The VM hardware token for authenticating the VM.
  ///  https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::RefreshRuntimeTokenInternalResponse,google/cloud/notebooks/v1/managed_service.proto#L331}
  ///
  /// [google.cloud.notebooks.v1.RefreshRuntimeTokenInternalRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L315}
  /// [google.cloud.notebooks.v1.RefreshRuntimeTokenInternalResponse]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L331}
  ///
  StatusOr<google::cloud::notebooks::v1::RefreshRuntimeTokenInternalResponse>
  RefreshRuntimeTokenInternal(std::string const& name, std::string const& vm_id,
                              Options opts = {});

  ///
  /// Gets an access token for the consumer service account that the customer
  /// attached to the runtime. Only accessible from the tenant instance.
  ///
  /// @param request
  /// @googleapis_link{google::cloud::notebooks::v1::RefreshRuntimeTokenInternalRequest,google/cloud/notebooks/v1/managed_service.proto#L315}
  /// @param opts Optional. Override the class-level options, such as retry and
  ///     backoff policies.
  /// @return
  /// @googleapis_link{google::cloud::notebooks::v1::RefreshRuntimeTokenInternalResponse,google/cloud/notebooks/v1/managed_service.proto#L331}
  ///
  /// [google.cloud.notebooks.v1.RefreshRuntimeTokenInternalRequest]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L315}
  /// [google.cloud.notebooks.v1.RefreshRuntimeTokenInternalResponse]:
  /// @googleapis_reference_link{google/cloud/notebooks/v1/managed_service.proto#L331}
  ///
  StatusOr<google::cloud::notebooks::v1::RefreshRuntimeTokenInternalResponse>
  RefreshRuntimeTokenInternal(
      google::cloud::notebooks::v1::RefreshRuntimeTokenInternalRequest const&
          request,
      Options opts = {});

 private:
  std::shared_ptr<ManagedNotebookServiceConnection> connection_;
  Options options_;
};

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace notebooks
}  // namespace cloud
}  // namespace google

#endif  // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_CLIENT_H


text:
// Copyright 2018 Adam Shannon
//
// 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.

package gen

import (
	"errors"
	"net/url"
	"path/filepath"
	"time"

	"github.com/adamdecaf/cert-manage/pkg/file"
	"github.com/go-sqlite/sqlite3"
)

var (
	firefoxProfileLocations = []string{
		filepath.Join(file.HomeDir(), ".mozilla/firefox/*.default/places.sqlite"),                      // Ubuntu
		filepath.Join(file.HomeDir(), "/Library/Application Support/Firefox/Profiles/*/places.sqlite"), // OSX
		// C:\Users\%USERNAME%\AppData\Roaming\Mozilla\Firefox\Profiles\%PROFILE%.default\places.sqlite // TODO
	}
)

func firefox() ([]*url.URL, error) {
	db, err := findFirefoxPlacesDB()
	if err != nil {
		return nil, err
	}
	return getFirefoxUrls(db)
}

func getFirefoxUrls(db *sqlite3.DbFile) ([]*url.URL, error) {
	getter := func(rec sqlite3.Record) *record {
		u, _ := rec.Values[1].(string)
		when, _ := rec.Values[8].(int64) // last_visit_time
		return &record{
			URL:        u,
			VisistedAt: time.Unix(when/1e6, 0).UTC(), // throw away nsec
		}
	}
	return getSqliteHistoryUrls(db, "Firefox", "moz_places", getter, oldestBrowserHistoryItemDate)
}

func findFirefoxPlacesDB() (*sqlite3.DbFile, error) {
	// Paths are globs, so check each match
	for i := range firefoxProfileLocations {
		matches, err := filepath.Glob(firefoxProfileLocations[i])
		if err != nil {
			return nil, err
		}
		for j := range matches {
			if file.Exists(matches[j]) {
				return sqlite3.Open(matches[j])
			}
		}
	}
	return nil, errors.New("unable to find firefox places.sqlite")
}


text:
package com.github.baoti.pioneer.ui.main;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import com.github.baoti.android.presenter.FragmentView;
import com.github.baoti.pioneer.AppMain;
import com.github.baoti.pioneer.R;
import com.github.baoti.pioneer.entity.News;
import com.github.baoti.pioneer.ui.login.LoginDialogFragment;
import com.github.baoti.pioneer.ui.me.MeFragment;
import com.github.baoti.pioneer.ui.news.NewsActivity;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnCheckedChanged;
import butterknife.OnClick;
import dagger.Lazy;
import timber.log.Timber;

/**
 * Created by liuyedong on 14-12-22.
 */
public class MainFragment extends FragmentView<IMainView, MainPresenter> implements IMainView {

    @Inject
    Lazy<MainPresenter> presenterLazy;

    @BindView(R.id.tv_account)
    TextView account;

    @BindView(R.id.btn_sign_in)
    TextView signIn;

    @BindView(R.id.btn_sign_out)
    TextView signOut;

    @BindView(R.id.btn_stop_report)
    Button btnStopReport;

    public static Fragment newInstance() {
        return new MainFragment();
    }

    @Override
    protected MainPresenter createPresenter(IMainView view) {
        return presenterLazy.get();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_main, container, false);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        ButterKnife.bind(this, view);
        AppMain.globalGraph().plus(new MainModule()).inject(this);
        super.onViewCreated(view, savedInstanceState);
    }

    @Override
    public void showAccount(String accountId) {
        account.setText(accountId);
    }

    @Override
    public void hideAccount() {
        account.setText(null);
    }

    @Override
    public void showSignIn() {
        signIn.setVisibility(View.VISIBLE);
    }

    @Override
    public void hideSignIn() {
        signIn.setVisibility(View.GONE);
    }

    @Override
    public void showSignOut() {
        signOut.setVisibility(View.VISIBLE);
    }

    @Override
    public void hideSignOut() {
        signOut.setVisibility(View.GONE);
    }

    @Override
    public void navigateToLogin() {
        getFragmentManager().beginTransaction()
                .replace(getId(), LoginDialogFragment.newInstance())
                .addToBackStack("login")
                .commit();
    }

    @OnClick(R.id.btn_sign_in) void onSignInClicked() {
        getPresenter().onSignInClicked();
    }

    @OnClick(R.id.btn_sign_out) void onSignOutClicked() {
        getPresenter().onSignOutClicked();
    }

    @OnCheckedChanged(R.id.cb_retain)
    void onRetainChanged(boolean checked) {
        Timber.i("Retain turn %s", checked ? "on" : "off");
        setRetainInstance(checked);
    }

    @OnClick(R.id.btn_stop_report) void onStopReportClicked() {
        getPresenter().onStopReportClicked();
    }

    public void hideStopReport() {
        btnStopReport.setVisibility(View.GONE);
    }

    @OnClick(R.id.btn_news) void navigateToNews() {
        startActivity(NewsActivity.actionView(getActivity()));
    }

    @OnClick(R.id.btn_one_news) void navigateToOneNews() {
        startActivity(NewsActivity.actionView(getActivity(), new News(1000, "One", "One content")));
    }

    @OnClick(R.id.btn_me) void navigateToMe() {
        MeFragment fragment = MeFragment.newInstance();
        fragment.setAllowEnterTransitionOverlap(true);
        getFragmentManager().beginTransaction()
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                .replace(getId(), fragment)
                .addToBackStack(null)
                .commit();
//        startActivity(MeActivity.actionLaunch(getActivity()));
    }
}


text:
package com.sensepost.yeti.controllers;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.NumberFormat;

import com.sensepost.yeti.FrmMain;
import com.sensepost.yeti.gui.StartFootprintInit;
import com.sensepost.yeti.models.CertModel;
import com.sensepost.yeti.models.CollectorModel;
import com.sensepost.yeti.models.ForwardLookupModel;
import com.sensepost.yeti.models.JobModel;
import com.sensepost.yeti.models.ReverseLookupModel;
import com.sensepost.yeti.models.TldModel;
import com.sensepost.yeti.models.YileModel;

/**
 *
 * @author willemmouton
 */
public class WorkflowController {

    private int jobCounter = 0;
    private final StartFootprintInit frmStart = new StartFootprintInit();

    public enum jobTypes {

        TLDEXPAND, FORWORDLOOKUP, REVERSELOOKUP, CERTEXTRACTION, SPIDER, BINGSITE, BINGIP, SCRIPT,
    };

    private final FrmMain parent;
    private final JobModel model;

    public WorkflowController(FrmMain parent) {
        model = new JobModel();
        this.parent = parent;
    }

    public JobModel getModel() {
        return model;
    }

    protected int getNextJobId() {
        return ++jobCounter;
    }

    public synchronized void startTLDExpand() {
        TldController cTld = new TldController(this, new TldModel());
        RunningJob job = new RunningJob(this, cTld, this.getNextJobId());
        cTld.setJob(job);
        if (job.startJob()) {
            model.addRow(job);
        }
    }

    public void startForwardLookup() {
        ForwardLookupController cFld = new ForwardLookupController(this, new ForwardLookupModel());
        RunningJob job = new RunningJob(this, cFld, this.getNextJobId());
        cFld.setJob(job);
        if (job.startJob()) {
            model.addRow(job);
        }
    }

    public void startCertExtraction() {
        CertController cCert = new CertController(this, new CertModel());
        RunningJob job = new RunningJob(this, cCert, this.getNextJobId());
        cCert.setJob(job);
        if (job.startJob()) {
            model.addRow(job);
        }
    }

    public void startReverseLookup() {
        ReverseLookupController cReverse = new ReverseLookupController(this, new ReverseLookupModel());
        RunningJob job = new RunningJob(this, cReverse, this.getNextJobId());
        cReverse.setJob(job);
        if (job.startJob()) {
            model.addRow(job);
        }
    }

    public void startWebsiteSpider() {
        YileController cSpider = new YileController(this, new YileModel());
        RunningJob job = new RunningJob(this, cSpider, this.getNextJobId());
        cSpider.setJob(job);
        if (job.startJob()) {
            model.addRow(job);
        }
    }

    public void startCollector(String scriptName) {
        CollectorController cCollector = new CollectorController(this, new CollectorModel(), scriptName);
        RunningJob job = new RunningJob(this, cCollector, this.getNextJobId());
        cCollector.setJob(job);
        if (job.startJob()) {
            model.addRow(job);
        }
    }

    public void startFootprint() throws FileNotFoundException, IOException {
        this.frmStart.setVisible(true);
    }

    public synchronized void finishProgress(BaseController baseController) {
        model.setValueAt("Done (100%)", model.getIndexOf(baseController.getJob()), 2);
    }

    public synchronized void updateProgress(BaseController baseController) {
        String value;
        if (baseController.getTotalRequests() > baseController.getRequestsCompleted()) {
            Double t = (double) baseController.getTotalRequests();
            Double d = (double) baseController.getRequestsCompleted();

            double perc = (d / t);
            NumberFormat percentFormatter;

            percentFormatter = NumberFormat.getPercentInstance();

            if (!baseController.getCancelledValue()) {
                value = String.format("Running (%s)", percentFormatter.format(perc));
            } else {
                value = String.format("Cancelling (%s)", percentFormatter.format(perc));
            }

        } else {
            value = "Done (100%)";
        }

        model.setValueAt(value, model.getIndexOf(baseController.getJob()), 2);
    }

    public void cancelJob(int idx) {
        RunningJob j = (RunningJob) model.getObjectAt(idx);
        j.cancelJob();
    }

    public void saveJob(int idx) {
        RunningJob j = (RunningJob) model.getObjectAt(idx);
        j.saveJob();
    }

    public void saveAllJobs() {
        for (Object j : model.getData()) {
            ((RunningJob) j).saveJob();
        }
    }

    public void removeJob(int idx) {
        RunningJob j = (RunningJob) model.getObjectAt(idx);
        j.cancelJob();
        ((JobModel) model).removeItem(j);
    }

    public void removeAllJobs() {
        model.clear();
    }

    public void cancellProgress(Object caller) {
        model.setValueAt("Cancelled", model.getIndexOf(caller), 2);
    }

    protected FrmMain getParent() {
        return parent;
    }
}


text:
import Vue from 'vue';

import Target from '../types/Target';
import InputContainer from './InputContainer.vue';

/**
 * Create address input component for given `target`.
 *
 * @export
 * @param {Target} target Address property target
 * @param {string} defaultLabel Default input label
 */
export default function createAddressComponent(
	target: Target,
	defaultLabel: string
) {
	return Vue.extend({
		functional: true,
		props: {
			label: {
				type: String,
				default: defaultLabel
			}
		},
		render(createElement, context) {
			return createElement(
				InputContainer,
				{
					...context.data,
					props: {
						label: context.props.label,
						target
					}
				}
			);
		}
	});
}


text:
namespace FrogBlogger.Dal.Interfaces
{
    /// <summary>
    /// Defines the contract for a Author repository
    /// </summary>
    public interface IAuthorRepository : IDataRepository<Author>
    {
    }
}


text:
package io.sommers.fantasy.api.spells.spellcaster;

public interface ISpellCaster {
    void addMana(int amount);

    void removeMana(int amount);

    int getMana();

    int getMaxMana();

    void regenerateMana();
}


text:
/*****************************************************************************/
/**
*
* @file xcanps_selftest.c
* @addtogroup canps_v3_0
* @{
*
* This file contains a diagnostic self-test function for the XCanPs driver.
*
* Read xcanps.h file for more information.
*
* @note
* The  Baud Rate Prescaler Register (BRPR) and Bit Timing Register(BTR)
* are setup such that CAN baud rate equals 40Kbps, given the CAN clock
* equal to 24MHz. These need to be changed based on the desired baudrate
* and CAN clock frequency.
*
*

* MODIFICATION HISTORY:
*
* Ver   Who    Date	Changes
* ----- -----  -------- -----------------------------------------------
* 1.00a xd/sv  01/12/10 First release
* 2.1 adk 		23/08/14 Fixed CR:798792 Peripheral test for CANPS IP in
*						 SDK claims a 40kbps baud rate but it's not.
* 3.00  kvn    02/13/15 Modified code for MISRA_C:2012 compliance.
*

*
*****************************************************************************/

/***************************** Include Files ********************************/

#include "xstatus.h"
#include "xcanps.h"

/************************** Constant Definitions ****************************/

#define XCANPS_MAX_FRAME_SIZE_IN_WORDS ((XCANPS_MAX_FRAME_SIZE) / (sizeof(u32)))

#define FRAME_DATA_LENGTH	8U /* Frame Data field length */

/**************************** Type Definitions ******************************/

/***************** Macros (Inline Functions) Definitions ********************/

/************************** Variable Definitions ****************************/

/*
 * Buffers to hold frames to send and receive. These are declared as global so
 * that they are not on the stack.
 */
static u32 TxFrame[XCANPS_MAX_FRAME_SIZE_IN_WORDS];
static u32 RxFrame[XCANPS_MAX_FRAME_SIZE_IN_WORDS];

/************************** Function Prototypes *****************************/

/*****************************************************************************/
/**
*
* This function runs a self-test on the CAN driver/device. The test resets
* the device, sets up the Loop Back mode, sends a standard frame, receives the
* frame, verifies the contents, and resets the device again.
*
* Note that this is a destructive test in that resets of the device are
* performed. Refer the device specification for the device status after
* the reset operation.
*
*
* @param	InstancePtr is a pointer to the XCanPs instance.
*
* @return
*		- XST_SUCCESS if the self-test passed. i.e., the frame
*		  received via the internal loop back has the same contents as
*		  the frame sent.
* 		- XST_FAILURE   Otherwise.
*
* @note
*
* If the CAN device does not work properly, this function may enter an
* infinite loop and will never return to the caller.
*

* If XST_FAILURE is returned, the device is not reset so that the caller could
* have a chance to check reason(s) causing the failure.
*
******************************************************************************/
s32 XCanPs_SelfTest(XCanPs *InstancePtr)
{
	u8 *FramePtr;
	s32 Status;
	u32 Index;
	u8 GetModeResult;
	u32 RxEmptyResult;

	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);

	XCanPs_Reset(InstancePtr);

	/*
	 * The device should enter Configuration Mode immediately after
	 * reset above is finished. Now check the mode and return error code if
	 * it is not Configuration Mode.
	 */
	if (XCanPs_GetMode(InstancePtr) != XCANPS_MODE_CONFIG) {
		Status = XST_FAILURE;
		return Status;
	}

	/*
	 * Setup Baud Rate Prescaler Register (BRPR) and Bit Timing Register
	 * (BTR) such that CAN baud rate equals 40Kbps, given the CAN clock
	 * equal to 24MHz. For more information see the CAN 2.0A, CAN 2.0B,
	 * ISO 11898-1 specifications.
	 */
	(void)XCanPs_SetBaudRatePrescaler(InstancePtr, (u8)29U);
	(void)XCanPs_SetBitTiming(InstancePtr, (u8)3U, (u8)2U, (u8)15U);

	/*
	 * Enter the loop back mode.
	 */
	XCanPs_EnterMode(InstancePtr, XCANPS_MODE_LOOPBACK);
	GetModeResult = XCanPs_GetMode(InstancePtr);
	while (GetModeResult != ((u8)XCANPS_MODE_LOOPBACK)) {
		GetModeResult = XCanPs_GetMode(InstancePtr);
	}

	/*
	 * Create a frame to send with known values so we can verify them
	 * on receive.
	 */
	TxFrame[0] = (u32)XCanPs_CreateIdValue((u32)2000U, (u32)0U, (u32)0U, (u32)0U, (u32)0U);
	TxFrame[1] = (u32)XCanPs_CreateDlcValue((u32)8U);

	FramePtr = (u8 *)((void *)(&TxFrame[2]));
	for (Index = 0U; Index < 8U; Index++) {
		if(*FramePtr != 0U) {
			*FramePtr = (u8)Index;
			*FramePtr++;
		}
	}

	/*
	 * Send the frame.
	 */
	Status = XCanPs_Send(InstancePtr, TxFrame);
	if (Status != (s32)XST_SUCCESS) {
		Status = XST_FAILURE;
		return Status;
	}

	/*
	 * Wait until the frame arrives RX FIFO via internal loop back.
	 */
	RxEmptyResult = XCanPs_ReadReg(((InstancePtr)->CanConfig.BaseAddr),
			XCANPS_ISR_OFFSET) & XCANPS_IXR_RXNEMP_MASK;

	while (RxEmptyResult == (u32)0U) {
		RxEmptyResult = XCanPs_ReadReg(((InstancePtr)->CanConfig.BaseAddr),
				XCANPS_ISR_OFFSET) & XCANPS_IXR_RXNEMP_MASK;
	}

	/*
	 * Receive the frame.
	 */
	Status = XCanPs_Recv(InstancePtr, RxFrame);
	if (Status != (s32)XST_SUCCESS) {
		Status = XST_FAILURE;
		return Status;
	}

	/*
	 * Verify Identifier and Data Length Code.
	 */
	if (RxFrame[0] !=
		(u32)XCanPs_CreateIdValue((u32)2000U, (u32)0U, (u32)0U, (u32)0U, (u32)0U)) {
		Status = XST_FAILURE;
		return Status;
	}

	if ((RxFrame[1] & ~XCANPS_DLCR_TIMESTAMP_MASK) != TxFrame[1]) {
		Status = XST_FAILURE;
		return Status;
	}

	for (Index = 2U; Index < (XCANPS_MAX_FRAME_SIZE_IN_WORDS); Index++) {
		if (RxFrame[Index] != TxFrame[Index]) {
			Status = XST_FAILURE;
			return Status;
		}
	}

	/*
	 * Reset device again before returning to the caller.
	 */
	XCanPs_Reset(InstancePtr);

	Status = XST_SUCCESS;
	return Status;
}

/** @} */


text:
package org.apache.hadoop.fs.s3;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.s3.INode.FileType;
import org.jets3t.service.S3Service;
import org.jets3t.service.S3ServiceException;
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
import org.jets3t.service.model.S3Bucket;
import org.jets3t.service.model.S3Object;
import org.jets3t.service.security.AWSCredentials;

@InterfaceAudience.Private
@InterfaceStability.Unstable
class Jets3tFileSystemStore implements FileSystemStore {

  private static final String FILE_SYSTEM_NAME = "fs";
  private static final String FILE_SYSTEM_VALUE = "Hadoop";

  private static final String FILE_SYSTEM_TYPE_NAME = "fs-type";
  private static final String FILE_SYSTEM_TYPE_VALUE = "block";

  private static final String FILE_SYSTEM_VERSION_NAME = "fs-version";
  private static final String FILE_SYSTEM_VERSION_VALUE = "1";

  private static final Map<String, String> METADATA =
    new HashMap<String, String>();

  static {
    METADATA.put(FILE_SYSTEM_NAME, FILE_SYSTEM_VALUE);
    METADATA.put(FILE_SYSTEM_TYPE_NAME, FILE_SYSTEM_TYPE_VALUE);
    METADATA.put(FILE_SYSTEM_VERSION_NAME, FILE_SYSTEM_VERSION_VALUE);
  }

  private static final String PATH_DELIMITER = Path.SEPARATOR;
  private static final String BLOCK_PREFIX = "block_";

  private Configuration conf;

  private S3Service s3Service;

  private S3Bucket bucket;

  private int bufferSize;

  private static final Log LOG =
    LogFactory.getLog(Jets3tFileSystemStore.class.getName());

  @Override
  public void initialize(URI uri, Configuration conf) throws IOException {

    this.conf = conf;

    S3Credentials s3Credentials = new S3Credentials();
    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
    bucket = new S3Bucket(uri.getHost());

    this.bufferSize = conf.getInt(
                       S3FileSystemConfigKeys.S3_STREAM_BUFFER_SIZE_KEY,
                       S3FileSystemConfigKeys.S3_STREAM_BUFFER_SIZE_DEFAULT
		      );
  }

  @Override
  public String getVersion() throws IOException {
    return FILE_SYSTEM_VERSION_VALUE;
  }

  private void delete(String key) throws IOException {
    try {
      s3Service.deleteObject(bucket, key);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }

  @Override
  public void deleteINode(Path path) throws IOException {
    delete(pathToKey(path));
  }

  @Override
  public void deleteBlock(Block block) throws IOException {
    delete(blockToKey(block));
  }

  @Override
  public boolean inodeExists(Path path) throws IOException {
    InputStream in = get(pathToKey(path), true);
    if (in == null) {
      return false;
    }
    in.close();
    return true;
  }

  @Override
  public boolean blockExists(long blockId) throws IOException {
    InputStream in = get(blockToKey(blockId), false);
    if (in == null) {
      return false;
    }
    in.close();
    return true;
  }

  private InputStream get(String key, boolean checkMetadata)
      throws IOException {

    try {
      S3Object object = s3Service.getObject(bucket, key);
      if (checkMetadata) {
        checkMetadata(object);
      }
      return object.getDataInputStream();
    } catch (S3ServiceException e) {
      if ("NoSuchKey".equals(e.getS3ErrorCode())) {
        return null;
      }
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }

  private InputStream get(String key, long byteRangeStart) throws IOException {
    try {
      S3Object object = s3Service.getObject(bucket, key, null, null, null,
                                            null, byteRangeStart, null);
      return object.getDataInputStream();
    } catch (S3ServiceException e) {
      if ("NoSuchKey".equals(e.getS3ErrorCode())) {
        return null;
      }
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }

  private void checkMetadata(S3Object object) throws S3FileSystemException,
      S3ServiceException {

    String name = (String) object.getMetadata(FILE_SYSTEM_NAME);
    if (!FILE_SYSTEM_VALUE.equals(name)) {
      throw new S3FileSystemException("Not a Hadoop S3 file.");
    }
    String type = (String) object.getMetadata(FILE_SYSTEM_TYPE_NAME);
    if (!FILE_SYSTEM_TYPE_VALUE.equals(type)) {
      throw new S3FileSystemException("Not a block file.");
    }
    String dataVersion = (String) object.getMetadata(FILE_SYSTEM_VERSION_NAME);
    if (!FILE_SYSTEM_VERSION_VALUE.equals(dataVersion)) {
      throw new VersionMismatchException(FILE_SYSTEM_VERSION_VALUE,
          dataVersion);
    }
  }

  @Override
  public INode retrieveINode(Path path) throws IOException {
    return INode.deserialize(get(pathToKey(path), true));
  }

  @Override
  public File retrieveBlock(Block block, long byteRangeStart)
    throws IOException {
    File fileBlock = null;
    InputStream in = null;
    OutputStream out = null;
    try {
      fileBlock = newBackupFile();
      in = get(blockToKey(block), byteRangeStart);
      out = new BufferedOutputStream(new FileOutputStream(fileBlock));
      byte[] buf = new byte[bufferSize];
      int numRead;
      while ((numRead = in.read(buf)) >= 0) {
        out.write(buf, 0, numRead);
      }
      return fileBlock;
    } catch (IOException e) {
      // close output stream to file then delete file
      closeQuietly(out);
      out = null; // to prevent a second close
      if (fileBlock != null) {
        boolean b = fileBlock.delete();
        if (!b) {
          LOG.warn("Ignoring failed delete");
        }
      }
      throw e;
    } finally {
      closeQuietly(out);
      closeQuietly(in);
    }
  }

  private File newBackupFile() throws IOException {
    File dir = new File(conf.get("fs.s3.buffer.dir"));
    if (!dir.exists() && !dir.mkdirs()) {
      throw new IOException("Cannot create S3 buffer directory: " + dir);
    }
    File result = File.createTempFile("input-", ".tmp", dir);
    result.deleteOnExit();
    return result;
  }

  @Override
  public Set<Path> listSubPaths(Path path) throws IOException {
    try {
      String prefix = pathToKey(path);
      if (!prefix.endsWith(PATH_DELIMITER)) {
        prefix += PATH_DELIMITER;
      }
      S3Object[] objects = s3Service.listObjects(bucket, prefix, PATH_DELIMITER);
      Set<Path> prefixes = new TreeSet<Path>();
      for (int i = 0; i < objects.length; i++) {
        prefixes.add(keyToPath(objects[i].getKey()));
      }
      prefixes.remove(path);
      return prefixes;
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }

  @Override
  public Set<Path> listDeepSubPaths(Path path) throws IOException {
    try {
      String prefix = pathToKey(path);
      if (!prefix.endsWith(PATH_DELIMITER)) {
        prefix += PATH_DELIMITER;
      }
      S3Object[] objects = s3Service.listObjects(bucket, prefix, null);
      Set<Path> prefixes = new TreeSet<Path>();
      for (int i = 0; i < objects.length; i++) {
        prefixes.add(keyToPath(objects[i].getKey()));
      }
      prefixes.remove(path);
      return prefixes;
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }

  private void put(String key, InputStream in, long length, boolean storeMetadata)
      throws IOException {

    try {
      S3Object object = new S3Object(key);
      object.setDataInputStream(in);
      object.setContentType("binary/octet-stream");
      object.setContentLength(length);
      if (storeMetadata) {
        object.addAllMetadata(METADATA);
      }
      s3Service.putObject(bucket, object);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }

  @Override
  public void storeINode(Path path, INode inode) throws IOException {
    put(pathToKey(path), inode.serialize(), inode.getSerializedLength(), true);
  }

  @Override
  public void storeBlock(Block block, File file) throws IOException {
    BufferedInputStream in = null;
    try {
      in = new BufferedInputStream(new FileInputStream(file));
      put(blockToKey(block), in, block.getLength(), false);
    } finally {
      closeQuietly(in);
    }
  }

  private void closeQuietly(Closeable closeable) {
    if (closeable != null) {
      try {
        closeable.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }

  private String pathToKey(Path path) {
    if (!path.isAbsolute()) {
      throw new IllegalArgumentException("Path must be absolute: " + path);
    }
    return path.toUri().getPath();
  }

  private Path keyToPath(String key) {
    return new Path(key);
  }

  private String blockToKey(long blockId) {
    return BLOCK_PREFIX + blockId;
  }

  private String blockToKey(Block block) {
    return blockToKey(block.getId());
  }

  @Override
  public void purge() throws IOException {
    try {
      S3Object[] objects = s3Service.listObjects(bucket);
      for (int i = 0; i < objects.length; i++) {
        s3Service.deleteObject(bucket, objects[i].getKey());
      }
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }

  @Override
  public void dump() throws IOException {
    StringBuilder sb = new StringBuilder("S3 Filesystem, ");
    sb.append(bucket.getName()).append("\n");
    try {
      S3Object[] objects = s3Service.listObjects(bucket, PATH_DELIMITER, null);
      for (int i = 0; i < objects.length; i++) {
        Path path = keyToPath(objects[i].getKey());
        sb.append(path).append("\n");
        INode m = retrieveINode(path);
        sb.append("\t").append(m.getFileType()).append("\n");
        if (m.getFileType() == FileType.DIRECTORY) {
          continue;
        }
        for (int j = 0; j < m.getBlocks().length; j++) {
          sb.append("\t").append(m.getBlocks()[j]).append("\n");
        }
      }
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
    System.out.println(sb);
  }

}


text:
                        {% for network in site.social %}

                        {% endfor %}

              Mentions légales

Ce site est porté par un consortium dont la responsabilité légale est assumée aujourd'hui par l'Association loi 1901 Open Food France,
domiciliée chez Volumes Coworking, 78 rue Compans, 75019 Paris. N°RNA : W751236936 - Contact: hello@datafoodconsortium.org - Directeur de la publication: Myriam Bouré - Coordonnées de l'hébergeur du site: OVH, 2 rue Kellermann - 59100 Roubaix - France - Tel: 1007


text:
//=============================================================================
// CRTA_ScreenPicture.js
//=============================================================================

(function() {

    var parameters = PluginManager.parameters('CRTA_ScreenPicture');
    var screenPicId = Number(parameters['Screen Picture ID'] || 90);
    var fadePicId = Number(parameters['Fade Picture ID'] || 91);

    var KEY_NAME = 'CRTA_ScreenPicture_';

    // プラグインコマンド
    var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
        if (command === 'CRTA_ScreenPicture') {

            var picId = fadePicId;
            if (String(args[1]) === 'screen') {
                picId = screenPicId;
            }

            switch (String(args[0])) {
            case 'set':
                if (args.length <= 4) {
                    // ピクチャ指定の場合
                    $gameScreen.showPicture(picId, String(args[2]), 0, 0, 0,
                    100, 100, Number(args[3]), 0);
                } else if (args.length >= 6) {
                    // カラー指定の場合
                    $gameScreen.showPicture(picId, KEY_NAME + String(args[1]), 0, 0, 0,
                    100, 100, Number(args[5]), 0);
                    $gameScreen.picture(picId)._CRTAScreenPictureType = String(args[1]);
                    $gameScreen.picture(picId)._CRTAScreenPictureColor = [Number(args[2]), Number(args[3]), Number(args[4])];
                }
                break;
            case 'fade':
                $gameScreen.movePicture(picId, 0, 0, 0, 100,
                    100, Number(args[2]), 0, eval(args[3]));
                break;
            case 'erase':
                $gameScreen.erasePicture(picId);
                break;
            }
        }
    };

    // override
    var _Game_Picture_initBasic = Game_Picture.prototype.initBasic;
    Game_Picture.prototype.initBasic = function() {
        _Game_Picture_initBasic.call(this);

        // 変数拡張
        this._CRTAScreenPictureType = '';
        this._CRTAScreenPictureColor = null;
    };

    // override
    var _Sprite_Picture_loadBitmap = Sprite_Picture.prototype.loadBitmap;
    Sprite_Picture.prototype.loadBitmap = function() {

        // 拡張変数がセットされていればピクチャを生成する
        var type = this.picture()._CRTAScreenPictureType;
        if (type != undefined && type != null && type != '') {
            this.bitmap = ImageManager.createScreenPicture(this._pictureName, this.picture()._CRTAScreenPictureColor);
        } else {
            this.bitmap = ImageManager.loadPicture(this._pictureName);
        }
    };

    // ImageManager拡張
    ImageManager.createScreenPicture = function(path, hue) {
        var key = path + ':' + hue;
        if (!this._cache[key]) {
            // スクリーンを作成する
            var bitmap = new Bitmap(Graphics.width, Graphics.height);
            bitmap.fillAll('black');
            bitmap.adjustTone(hue[0], hue[1], hue[2]);
            bitmap.addLoadListener(function() {
                bitmap.rotateHue(hue);
            });
            this._cache[key] = bitmap;
        }
        return this._cache[key];
    };

})();


text:
package ie.dit;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		String sa = "DEFEFDD";
		String sb = "EFDFDBED";
		System.out.println("Edit distance between: " + sa + " and: " + sb + " is " + EditDistance.MinimumEditDistance(sa, sb));

		sa = "AbCDE";
		sb = "bBCD";
		System.out.println("Edit distance between: " + sa + " and: " + sb + " is " + EditDistance.MinimumEditDistance(sa, sb));

		Dictionary dictionary = new Dictionary("words.txt");

		String word = null;
		Scanner in = new Scanner(System.in);

		do
		{
			System.out.println("Enter a word or quit: ");
			word = in.nextLine();
			String closest = dictionary.findClosest(word);
			if (closest.equals(word))
			{
				System.out.println("Correct match");
			}
			else
			{
				System.out.println("Did you mean:" + closest);
			}
		}
		while (!word.equals("quit"));

	}
}


text:
import yaml
import copy

class UnknownSourceFormat(Exception):
    def __init__(self, source):
        self._source = source

    @property
    def source(self):
        return self._source

class InvalidProfile(Exception):
    pass

class ParseError(Exception):
    pass

class InvalidOverride(Exception):
    pass

class GitSource:
    def __init__(self, clone_url, checkout):
        self._clone_url = clone_url
        self._checkout = checkout

    @property
    def clone_url(self):
        return self._clone_url

    @property
    def checkout(self):
        return self._checkout

class HttpFtpSource:
    def __init__(self, url):
        self._url = url

    @property
    def url(self):
        return self._url

class Project:
    def __init__(self, name, source, configure, build_env):
        self._name = name
        self._source = source
        self._configure = configure
        self._build_env = build_env

    @property
    def name(self):
        return self._name

    @property
    def source(self):
        return self._source

    @property
    def configure(self):
        return self._configure

    @configure.setter
    def configure(self, value):
        self._configure = value

    @property
    def build_env(self):
        return self._build_env

class Profile:
    def __init__(self, virt_env, build_env, projects):
        self._virt_env = virt_env
        self._build_env = build_env
        self._projects = projects

    @property
    def virt_env(self):
        return self._virt_env

    @property
    def build_env(self):
        return self._build_env

    @property
    def projects(self):
        return self._projects

class Override:
    OP_REPLACE = 'replace'
    OP_APPEND = 'append'
    OP_REMOVE = 'remove'

    def __init__(self, path, op, rep):
        if len(path) is 0:
            raise InvalidOverride('Empty override path')

        self._path = path
        self._op = op
        self._rep = rep

    @property
    def path(self):
        return self._path

    @property
    def op(self):
        return self._op

    @property
    def rep(self):
        return self._rep

    def apply(self, node):
        # find the root node in which to override a property and the
        # remaining path from where the existing property is found
        common_node = node
        remaining_path = self._path

        for index, key in enumerate(self._path[:-1]):
            if key in common_node:
                common_node = common_node[key]

                if not isinstance(common_node, dict):
                    fmt = 'Cannot override a non-associative array property ("{}") with an associative array'
                    raise InvalidOverride(fmt.format(key))

                remaining_path = self._path[index + 1:]
                continue
            else:
                break

        # create new property from remaining path
        cur_node = common_node
        prop_key = remaining_path[-1]

        if self._op in (Override.OP_REPLACE, Override.OP_APPEND):
            if remaining_path:
                for key in remaining_path[:-1]:
                    cur_node[key] = {}
                    cur_node = cur_node[key]

                if prop_key not in cur_node:
                    cur_node[prop_key] = ''

        # apply
        if self._op == Override.OP_REPLACE:
            cur_node[prop_key] = self._rep
        elif self._op == Override.OP_APPEND:
            if prop_key == 'configure':
                cur_node[prop_key] += ' '

            cur_node[prop_key] += self._rep
        elif self._op == Override.OP_REMOVE:
            del cur_node[prop_key]

def _source_from_project_node(project_node):
    source = project_node['source']

    if source.startswith('git://') or source.endswith('.git') or 'checkout' in project_node:
        checkout = 'master'

        if 'checkout' in project_node:
            checkout_node = project_node['checkout']

            if checkout_node is not None:
                checkout = checkout_node

        return GitSource(source, checkout)

    if source.startswith('http://') or source.startswith('https://') or source.startswith('ftp://'):
        return HttpFtpSource(source)

    raise UnknownSourceFormat(source)

def _merge_envs(enva, envb):
    env = copy.deepcopy(enva)
    env.update(envb)

    return env

def _project_from_project_node(name, project_node, base_build_env):
    source = _source_from_project_node(project_node)
    configure = ''
    build_env = {}

    if 'configure' in project_node:
        configure_node = project_node['configure']

        if configure_node is not None:
            configure = str(configure_node)

    if 'build-env' in project_node:
        build_env_node = project_node['build-env']

        if build_env_node is not None:
            build_env = _merge_envs(base_build_env, build_env_node)
    else:
        build_env = copy.deepcopy(base_build_env)

    return Project(name, source, configure, build_env)

def _validate_projects(projects):
    valid_project_names = (
        'babeltrace',
        'babeltrace2',
        'elfutils',
        'glib',
        'libxml2',
        'lttng-analyses',
        'lttng-modules',
        'lttng-scope',
        'lttng-tools',
        'lttng-ust',
        'popt',
        'tracecompass',
        'urcu',
    )

    for name in projects:
        if name not in valid_project_names:
            raise InvalidProfile('Unknown project name: "{}"'.format(name))

def _merge_nodes(base, patch):
    if isinstance(base, dict) and isinstance(patch, dict):
        for k, v in patch.items():
            if isinstance(v, dict) and k in base:
                _merge_nodes(base[k], v)
            else:
                if k == 'configure' and type(v) is str:
                    if k not in base:
                        base[k] = ''

                    base[k] += ' {}'.format(v)
                else:
                    base[k] = v

def _from_yaml_files(paths, ignored_projects, overrides, verbose):
    root_node = {}

    for path in paths:
        with open(path) as f:
            patch_root_node = yaml.load(f, Loader=yaml.FullLoader)
            _merge_nodes(root_node, patch_root_node)

    for override in overrides:
        override.apply(root_node)

    if verbose:
        print('Effective profile:')
        print()
        print(yaml.dump(root_node, explicit_start=True, explicit_end=True,
                        indent=2, default_flow_style=False))

    build_env = root_node.get('build-env', {})
    virt_env = root_node.get('virt-env', {})
    projects = {}

    for name, project_node in root_node['projects'].items():
        if name in ignored_projects:
            continue

        if project_node is None:
            continue

        project = _project_from_project_node(name, project_node, build_env)
        projects[name] = project

    _validate_projects(projects)

    return Profile(virt_env, build_env, projects)

def from_yaml_files(paths, ignored_projects, overrides, verbose):
    try:
        return _from_yaml_files(paths, ignored_projects, overrides, verbose)
    except (UnknownSourceFormat, InvalidProfile):
        raise
    except Exception as e:
        raise ParseError() from e


text:
using System;
using Newtonsoft.Json;
using Paramore.Darker.Builder;

namespace Paramore.Darker.QueryLogging
{
    public static class Constants
    {
        public const string ContextBagKey = "Darker.JsonSerializer";
    }

    public static class QueryProcessorBuilderExtensions
    {
        public static IBuildTheQueryProcessor JsonQueryLogging(this IBuildTheQueryProcessor lastStageBuilder, Action<JsonSerializerSettings> settings = null)
        {
            var builder = lastStageBuilder.ToQueryProcessorBuilder();

            JsonSerializerSettings serializerSettings = null;

            if (settings != null)
            {
                serializerSettings = new JsonSerializerSettings();
                settings(serializerSettings);
            }

            return builder.ContextBagItem(Constants.ContextBagKey, new NewtonsftJsonSerializer(serializerSettings));
        }
    }
}


text:
import { expect } from 'chai'
import { before, describe, test } from 'mocha'
import { Environment } from '../../lib/entities/environment'
import { Release, ReleasePayload } from '../../lib/entities/release'
import { ReleaseAction } from '../../lib/entities/release-action'
import { Space } from '../../lib/entities/space'
import { TestDefaults } from '../defaults'
import { createTestSpace, initClient, initPlainClient } from '../helpers'
import { makeLink } from '../utils'

describe('ReleaseAction Api', async () => {
  let testSpace: Space
  let testEnvironment: Environment
  let testRelease: Release
  let testRelease2: Release

  let testReleaseAction: ReleaseAction
  let testReleaseAction2: ReleaseAction

  before(async () => {
    testSpace = (await createTestSpace(initClient(), 'Release Actions')) as unknown as Space
    testEnvironment = await testSpace.getEnvironment('master')

    const contentType = await testEnvironment.createContentTypeWithId('testContentType', {
      name: 'testContentType',
      fields: [
        {
          id: 'title',
          name: 'Title',
          localized: false,
          required: false,
          type: 'Symbol',
        },
      ],
    })
    await contentType.publish()
    await testEnvironment.createEntryWithId(
      'testContentType',
      TestDefaults.entry.testEntryReleasesId,
      {
        fields: {
          title: { 'en-US': 'Non-localized value' },
        },
      }
    )

    const releasePayload: ReleasePayload = {
      title: 'Release (test)',
      entities: {
        sys: { type: 'Array' },
        items: [makeLink('Entry', TestDefaults.entry.testEntryReleasesId)],
      },
    }

    ;[testRelease, testRelease2] = await Promise.all([
      testEnvironment.createRelease(releasePayload),
      testEnvironment.createRelease(releasePayload),
    ])

    /**
     * @summary Runs 2 Release Actions (validations) since we can only
     * run 2 per minute per environment (backend limitation).
     * **/
    testReleaseAction = await testRelease.validate()
    testReleaseAction2 = await testRelease2.validate()
  })

  after(async () => {
    if (testSpace) {
      return testSpace.delete()
    }
  })

  describe('Read', () => {
    test('Get ReleaseAction', async () => {
      const releaseAction = await testEnvironment.getReleaseAction({
        actionId: testReleaseAction.sys.id,
        releaseId: testRelease.sys.id,
      })

      expect(releaseAction.sys.id).to.eql(testReleaseAction.sys.id)
    })

    test('Get ReleaseAction with another release ID', async () => {
      const releaseAction = await testEnvironment.getReleaseAction({
        actionId: testReleaseAction2.sys.id,
        releaseId: testRelease2.sys.id,
      })

      expect(releaseAction.sys.id).to.eql(testReleaseAction2.sys.id)
    })

    test('Get ReleaseAction with an incorrect ID', async () => {
      try {
        await testEnvironment.getReleaseAction({
          releaseId: testRelease.sys.id,
          actionId: 'fakeId',
        })
      } catch (error) {
        const parsed = JSON.parse(error.message)
        expect(parsed.status).to.eql(404)
        expect(parsed.message).to.eql('The resource could not be found.')
        expect(parsed.details).to.eql({
          type: 'ReleaseAction',
          environment: testEnvironment.sys.id,
          space: testEnvironment.sys.space.sys.id,
          release: testRelease.sys.id,
          id: 'fakeId',
        })
      }
    })

    test('Get ReleaseActions with query options', async () => {
      const queryLimit = 1
      const queryResult = await testEnvironment.getReleaseActions({
        query: {
          'sys.release.sys.id[in]': testRelease2.sys.id,
          limit: queryLimit,
          order: 'sys.updatedAt',
          action: 'validate',
        },
      })

      // Returns the filtered results based on the limit
      expect(queryResult.items.length).to.eql(queryLimit)
      expect(queryResult.items[0].sys.release.sys.id).to.eql(testRelease2.sys.id)
    })
  })

  describe('PlainClient API', () => {
    test('releaseAction.getMany', async () => {
      const defaultParams = {
        environmentId: testEnvironment.sys.id,
        spaceId: testSpace.sys.id,
      }

      const plainClient = initPlainClient(defaultParams)

      const queryResult = await plainClient.releaseAction.getMany({
        query: { 'sys.release.sys.id[in]': testRelease.sys.id, limit: 1, action: 'validate' },
      })

      // Returns the filtered results based on the limit
      expect(queryResult.items.length).to.eql(1)
      expect(queryResult.items[0].sys.release.sys.id).to.eql(testRelease.sys.id)
    })

    test('releaseAction.get', async () => {
      const defaultParams = {
        environmentId: testEnvironment.sys.id,
        spaceId: testSpace.sys.id,
      }

      const plainClient = initPlainClient(defaultParams)

      const queryResult = await plainClient.releaseAction.get({
        releaseId: testRelease.sys.id,
        actionId: testReleaseAction.sys.id,
      })

      // Returns the filtered results based on the limit
      expect(queryResult.action).to.eql('validate')
      expect(queryResult.sys.id).to.eql(testReleaseAction.sys.id)
      expect(queryResult.sys.release.sys.id).to.eql(testRelease.sys.id)
    })
  })
})


text:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe CodeBuddy::Stack do

  it 'should create a series of stack frames from an exception' do
    backtrace = [
      "/Users/me/my_app/config.ru:1:in `new'",
      "/Users/me/my_app/config.ru:1"
    ]
    CodeBuddy::StackFrame.expects(:new).with("/Users/me/my_app/config.ru:1:in `new'").returns(frame1=mock)
    CodeBuddy::StackFrame.expects(:new).with("/Users/me/my_app/config.ru:1"         ).returns(frame2=mock)
    mock_exception = mock(:backtrace=>backtrace)
    mock_exception.expects(:is_a?).with(Exception).returns(true)
    stack = CodeBuddy::Stack.new mock_exception
    stack.stack_frames.should == [frame1, frame2]
  end

  it 'should save the currently selected stack frame' do
    mock_exception = mock(:backtrace=>[''])
    mock_exception.expects(:is_a?).with(Exception).returns(true)
    stack = CodeBuddy::Stack.new mock_exception
    stack.selected = 3
    stack.selected.should == 3
  end

end


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit4131b76bb94f2b6cd58bb447d86cf991::getLoader();


text:
/**
 * NodeBots Day - Sacramento
 *
 * Lesson 2: Operate a Servo
 *
 * NOTE: These answers are only one of many ways to accomplish each challenge.
 * If your code gets the job done but doesn't look exactly like this, THAT IS
 * 100% OK!
 */

var five = require('johnny-five');
var board = new five.Board();

board.on('ready', function() {
  var servo = new five.Servo({
    pin: 9,
    startAt: 0
  });

  // Sweep between 45- and 135-degrees
  servo.sweep([45, 135]);

  this.wait(3000, function() {
    servo.stop();
    servo.home();
    board.wait(3000, function() {
      servo.stop();
      servo.to(170, 500);
      board.wait(1000, function() {
        servo.to(25);
      });
    });
  });

  // Finally, clean up after ourselves when we exit
  this.on('exit', function() {
    servo.stop();
  });
});


text:
/* jshint esversion:6, node:true  */

'use strict';

let $supertest;
let app;
let expect;
let _;
let config;
let testsPrepareDb;

KlarkModule(module, 'testsSimpleCrud', (_$supertest_, $chai, ___, _app_, _config_, _testsPrepareDb_) => {
  $supertest = _$supertest_;
  app = _app_.create();
  _ = ___;
  expect = $chai.expect;
  config = _config_;
  testsPrepareDb = _testsPrepareDb_;
});

describe('Testing the CRUD functionality of a simple model', () => {

  let jwtToken;
  before(() => testsPrepareDb.connectWithAdmin(true)
                .then(pallet => jwtToken = pallet.token)
  );

  const rssProvider = {
    name: 'BBC',
    link: 'http://www.bbc.com'
  };
  let createRssProvider;

  it('Should create one record', (done) => {
    $supertest(app)
      .post('/' + config.API_URL_PREFIX + '/rssprovider')
      .send({
        RssProvider: rssProvider
      })
      .set('Accept', 'application/json')
      .set('authorization', jwtToken)
      .expect('Content-Type', /json/)
      .expect(200)
      .expect(res => {
        createRssProvider = res.body.data;
        expect(createRssProvider.name).to.equal(rssProvider.name);
      })
      .end(done);
  });

  it('Should retrieve one record', (done) => {
    $supertest(app)
      .get('/' + config.API_URL_PREFIX + '/rssprovider/' + createRssProvider._id)
      .set('Accept', 'application/json')
      .expect('Content-Type', /json/)
      .expect(200)
      .expect(res => {
          const respRssProvider = res.body.data;
          expect(_.isEqual(createRssProvider, respRssProvider)).to.equal(true);
      })
      .end(done);
  });

  it('Should retrieve all records', (done) => {
    $supertest(app)
      .get('/' + config.API_URL_PREFIX + '/rssprovider')
      .set('Accept', 'application/json')
      .expect('Content-Type', /json/)
      .expect(200)
      .expect(res => {
          const respRssProvider = res.body.data.content;
          expect(respRssProvider.length).to.equal(1);
          expect(_.isEqual(createRssProvider, respRssProvider[0])).to.equal(true);
          expect(res.body.data.total).to.equal(1);
      })
      .end(done);
  });

  it('Should update one record', (done) => {
    rssProvider.name = 'CNN';
    $supertest(app)
      .put('/' + config.API_URL_PREFIX + '/rssprovider/' + createRssProvider._id)
      .send({
        RssProvider: rssProvider
      })
      .set('authorization', jwtToken)
      .set('Accept', 'application/json')
      .expect('Content-Type', /json/)
      .expect(200)
      .expect(res => {
          const respRssProvider = res.body.data;
          expect(rssProvider.name).to.equal(respRssProvider.name);
          expect(createRssProvider._id).to.equal(respRssProvider._id);
      })
      .end(done);
  });

  it('Should delete one record', (done) => {
    $supertest(app)
      .delete('/' + config.API_URL_PREFIX + '/rssprovider/' + createRssProvider._id)
      .set('authorization', jwtToken)
      .set('Accept', 'application/json')
      .expect('Content-Type', /json/)
      .expect(200)
      .expect(res => {
          const data = res.body.data;
          expect(data.ok).to.equal(1);
          expect(data.n).to.equal(1);
      })
      .end(done);
  });

  it('Should retrieve all records, no records after delete', (done) => {
    $supertest(app)
      .get('/' + config.API_URL_PREFIX + '/rssprovider')
      .set('Accept', 'application/json')
      .expect('Content-Type', /json/)
      .expect(200)
      .expect(res => {
          const respRssProvider = res.body.data.content;
          expect(respRssProvider.length).to.equal(0);
          expect(res.body.data.total).to.equal(0);
      })
      .end(done);
  });

});


text:
#region License

#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics.CodeAnalysis;

namespace TMD.Algo.Collections.Generic
{
    /// <summary>
    /// Provides an implementation of a Heap, useful for priority queues.
    /// </summary>
    /// <typeparam name="T">
    /// Type of data stored in the heap.
    /// </typeparam>
    [SuppressMessage("Microsoft.Naming", "CA1710")]
    public class Heap<T> : IHeap<T>
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        public Heap() : this(Comparer<T>.Default)
        {
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="startList">
        /// List to initialy populate the heap with.  Construction runs in O(n) time.
        /// </param>
        public Heap(IEnumerable<T> startList) : this(startList, Comparer<T>.Default)
        {
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="comparer">
        /// Comparer to use to compare items.  Specify null to use the default comparer.
        /// </param>
        public Heap(IComparer<T> comparer)
        {
            if (comparer == null)
                comparer = Comparer<T>.Default;
            this.comparer = comparer;
            array = emptyHeapArray;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="startList">
        /// Initial list to populate the heap with.  Population occurs in O(n) time.
        /// </param>
        /// <param name="comparer">
        /// Comparer to use to compare items.  Specify null to use the default comparer.
        /// </param>
        public Heap(IEnumerable<T> startList, IComparer<T> comparer)
        {
            if (comparer == null)
                comparer = Comparer<T>.Default;
            this.comparer = comparer;
            count = startList.Count();
            array = new T[count + 1];
            int index = 1;
            foreach (T value in startList)
            {
                array[index] = value;
                index++;
            }
            for (int i = Parent(count); i >= 1; i--)
            {
                Heapify(i);
            }
        }

        /// <summary>
        /// Test method for validating heap structure.  DO NOT USE.
        /// </summary>
        internal void ___TESTValidateTEST()
        {
            for (int i = 2; i <= count; i++)
            {
                if (comparer.Compare(array[Parent(i)], array[i]) < 0)
                    throw new InvalidOperationException("Heap is corrupt.");
            }
        }

        /// <summary>
        /// Gets the first item in the heap, the largest item.
        /// </summary>
        public T Front
        {
            get
            {
                if (count <= 0)
                    throw new InvalidOperationException("The heap is currently empty.");
                return array[1];
            }
        }

        /// <summary>
        /// Gets the first item in the heap, if the heap isn't empty.
        /// </summary>
        /// <param name="var">
        /// Receives the first item in the heap, if there is one.
        /// </param>
        /// <returns>
        /// True if the heap was non-empty, false otherwise.
        /// </returns>
        public bool TryGetFront(out T var)
        {
            if (count <= 0)
            {
                var = default(T);
                return false;
            }
            else
            {
                var = array[1];
                return true;
            }
        }

        /// <summary>
        /// Gets and removes the first element in the heap.
        /// </summary>
        /// <returns>
        /// The first element in the heap, if the heap was not empty.
        /// </returns>
        public T PopFront()
        {
            if (count <= 0)
                throw new InvalidOperationException("The heap is currently empty.");
            T max = array[1];
            array[1] = array[count];
            array[count] = default(T); // Clear the entry incase it references something.
            count--;
            Heapify(1);
            version++;
            return max;
        }

        /// <summary>
        /// Gets and removes the first element in the heap if not empty.
        /// </summary>
        /// <param name="var">
        /// The first element in the heap if the heap was not empty.
        /// </param>
        /// <returns>
        /// True if the element was poped, false otherwise.
        /// </returns>
        public bool TryPopFront(out T var)
        {
            if (count <= 0)
            {
                var = default(T);
                return false;
            }
            else
            {
                var = PopFront();
                return true;
            }
        }

        private int version;
        private T[] array;
        private int count;
        private readonly IComparer<T> comparer;
        private static readonly T[] emptyHeapArray = new T[1];

        private static int Parent(int index)
        {
            return index >> 1;
        }

        private static int LeftChild(int index)
        {
            return index << 1;
        }

        private static int RightChild(int index)
        {
            return (index << 1) | 1;
        }

        private void Heapify(int index)
        {
            bool done;
            do
            {
                done = true;
                int l = LeftChild(index);
                int r = RightChild(index);
                int largest;
                if (l <= count && comparer.Compare(array[l], array[index]) > 0)
                    largest = l;
                else
                    largest = index;
                if (r <= count && comparer.Compare(array[r], array[largest]) > 0)
                    largest = r;
                if (largest != index)
                {
                    T tmp = array[index];
                    array[index] = array[largest];
                    array[largest] = tmp;
                    done = false;
                    index = largest;
                }
            } while (!done);
        }

        #region ICollection<T> Members

        /// <summary>
        /// Adds an item to the heap.
        /// </summary>
        /// <param name="item">
        /// Item to add.
        /// </param>
        public void Add(T item)
        {
            count++;
            if (count >= array.Length)
            {
                int newLength = array.Length << 1;
                if (newLength < 4)
                    newLength = 4;
                T[] newArray = new T[newLength];
                Array.Copy(array, newArray, count);
                array = newArray;
            }
            int i = count;
            while (i > 1 && comparer.Compare(array[Parent(i)], item) < 0)
            {
                array[i] = array[Parent(i)];
                i = Parent(i);
            }
            array[i] = item;
            version++;
        }

        /// <summary>
        /// Clears the heap.
        /// </summary>
        public void Clear()
        {
            Array.Clear(array, 1, count);
            count = 0;
            version++;
        }

        /// <summary>
        /// Returns true if the heap contains the specified item.
        /// </summary>
        /// <param name="item">
        /// Item to search for.
        /// </param>
        /// <returns>
        /// True if item exists in the heap, false otherwise.
        /// </returns>
        public bool Contains(T item)
        {
            for (int i = 1; i <= count; i++)
            {
                if (comparer.Compare(array[i], item) == 0)
                    return true;
            }
            return false;
        }

        /// <summary>
        /// Copies the elements in this heap to an array, in heap order.
        /// </summary>
        /// <param name="array">
        /// Array to receive the copied results.
        /// </param>
        /// <param name="arrayIndex">
        /// Offset in to target array to copy to.
        /// </param>
        public void CopyTo(T[] array, int arrayIndex)
        {
            Array.Copy(this.array, 1, array, arrayIndex, count);
        }

        /// <summary>
        /// Gets the count of the number of elements in the heap.
        /// </summary>
        public int Count => count;

        /// <summary>
        /// Returns false.
        /// </summary>
        public bool IsReadOnly => false;

        /// <summary>
        /// Removes the specified item from the heap if it exists.
        /// </summary>
        /// <param name="item">
        /// Item to remove from the heap.
        /// </param>
        /// <returns>
        /// True if the item was in the heap and removed, false otherwise.
        /// </returns>
        public bool Remove(T item)
        {
            for (int i = 1; i <= count; i++)
            {
                if (comparer.Compare(array[i], item) == 0)
                {
                    array[i] = array[count];
                    count--;
                    if (i == 1)
                        Heapify(1);
                    else if (comparer.Compare(array[Parent(i)], array[i]) >= 0)
                    {
                        Heapify(i);
                    }
                    else
                    {
                        while (i > 1 && comparer.Compare(array[Parent(i)], array[count + 1]) < 0)
                        {
                            array[i] = array[Parent(i)];
                            i = Parent(i);
                        }
                        array[i] = array[count + 1];
                    }
                    array[count + 1] = default(T); // Clear the entry incase it references something.
                    version++;
                    return true;
                }
            }
            return false;
        }

        #endregion

        #region IEnumerable<T> Members

        /// <summary>
        /// Gets the strongly typed enumerator.
        /// </summary>
        /// <returns>
        /// An enumerator to list all the values in the heap.
        /// </returns>
        public IEnumerator<T> GetEnumerator()
        {
            return new HeapEnumerator(this);
        }

        #endregion

        #region IEnumerable Members

        /// <summary>
        /// Gets the old style enumerator.
        /// </summary>
        /// <returns>
        /// An old style enumerator to return all the values in the heap.
        /// </returns>
        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return new HeapEnumerator(this);
        }

        #endregion

        /// <summary>
        /// Heap enumerator for enumerating values in the heap.
        /// </summary>
        [SuppressMessage("Microsoft.Performance", "CA1815")]
        public struct HeapEnumerator : IEnumerator<T>
        {
            /// <summary>
            /// Internal constructor.
            /// </summary>
            /// <param name="parent">
            /// Parent which this enumerator is enumerating.
            /// </param>
            internal HeapEnumerator(Heap<T> parent)
            {
                this.parent = parent;
                origVersion = parent.version;
                currentIndex = 0;
            }

            private readonly Heap<T> parent;
            private readonly int origVersion;
            private int currentIndex;

            #region IEnumerator<T> Members

            /// <summary>
            /// Gets the current item pointed to by this enumerator.
            /// </summary>
            public T Current
            {
                get
                {
                    if (origVersion != parent.version)
                        throw new InvalidOperationException(
                            "The collection being enumerated has been modified since enumerator was acquired.");
                    if (currentIndex > parent.count)
                        throw new InvalidOperationException("Current is not pointing to a valid location.");
                    if (currentIndex == 0)
                        return default(T);
                    else
                        return parent.array[currentIndex];
                }
            }

            #endregion

            #region IDisposable Members

            /// <summary>
            /// Does nothing.
            /// </summary>
            public void Dispose()
            {
            }

            #endregion

            #region IEnumerator Members

            /// <summary>
            /// Gets the current object this enumerator is pointing at.
            /// </summary>
            object System.Collections.IEnumerator.Current
            {
                get
                {
                    if (currentIndex == 0)
                        throw new InvalidOperationException("Current is not pointing to a valid location.");
                    return this.Current;
                }
            }

            /// <summary>
            /// Moves to the next entry in the heap, if available.
            /// </summary>
            /// <returns>
            /// True if there was an entry to move to, false otherwise.
            /// </returns>
            public bool MoveNext()
            {
                if (origVersion != parent.version)
                    throw new InvalidOperationException(
                        "The collection being enumerated has been modified since enumerator was acquired.");
                currentIndex++;
                if (currentIndex > parent.count)
                    return false;
                return true;
            }

            /// <summary>
            /// Resets the enumerator to enumerate from the begining.
            /// </summary>
            void System.Collections.IEnumerator.Reset()
            {
                if (origVersion != parent.version)
                    throw new InvalidOperationException(
                        "The collection being enumerated has been modified since enumerator was acquired.");
                currentIndex = 0;
            }

            #endregion
        }
    }
}


text:
using System.IO;
using CommandLine;
using log4net;
using log4net.Config;
using Ninject;

namespace GitBack.Console
{
    public static class Start
    {
        public static void Main(string[] args)
        {
            XmlConfigurator.Configure();

            var options = new CommandLineOptions();
            if (Parser.Default.ParseArguments(args, options))
            {
                var programOptions = ConvertCommandLineOptionsToProgramOptions(options);
                var kernel = new StandardKernel();

                Bootstrapper.ConfigureNinjectBindings(kernel, programOptions);

                var logger = kernel.Get<ILog>();
                logger.InfoFormat("Gitback starting...");

                var program = kernel.Get<Program>();
                program.Execute();
            }
        }

        private static ProgramOptions ConvertCommandLineOptionsToProgramOptions(CommandLineOptions commandLineOptions)
        {
            return new ProgramOptions
            {
                Username = commandLineOptions.UserName,
                Password = commandLineOptions.Password,
                Organization = commandLineOptions.Organization,
                BackupLocation = new DirectoryInfo(commandLineOptions.BackupLocation),
                PathToGit = commandLineOptions.PathToGit,
                ProjectFilter = commandLineOptions.ProjectFilter
            };
        }
    }
}


text:
package acceptance.example.thens;

import acceptance.example.test.TestResult;
import org.assertj.core.api.WithAssertions;

public class ThenTheResponse implements WithAssertions {

    private final String responseBody;

    public ThenTheResponse(TestResult testResult) {
        responseBody = testResult.response.body;
    }

    public ThenTheResponse isEqualTo(String response) {
        assertThat(responseBody).isEqualTo(response);
        return this;
    }
}


text:
-- Migration file V20160627171821__gift_certificate_module_seed_data.sql created at --
/*
  Currency seed data
 */
INSERT INTO currency (name, symbol) VALUES ('Ethiopian Birr','ETB');
INSERT INTO currency (name, symbol) VALUES ('US Dollar','USD');
INSERT INTO currency (name, symbol) VALUES ('Euro','EUR');
INSERT INTO currency (name, symbol) VALUES ('UK Pound','GBP');

/*
  Budget type seed data
 */

INSERT INTO budget_type (name, description) VALUES ('Regular','Regular budget');
INSERT INTO budget_type (name, description) VALUES ('Capital','Capital budget');

/*
  Fund source seed data
 */

INSERT INTO fund_source (name, description) VALUES ('Treasury','Treasury fund source');
INSERT INTO fund_source (name, description) VALUES ('Loan','Loan fund source');
INSERT INTO fund_source (name, description) VALUES ('Donation','Donation fund source');

/*
  Program seed data
 */

INSERT INTO program (name, short_name) VALUES ('Relief Program','RELIEF');
INSERT INTO program (name, short_name) VALUES ('Productive SafetyNet Program','PSNP');
INSERT INTO program (name, short_name) VALUES ('Internally Displaced People','IDPS');

/*
  Mode of transport seed data
 */
INSERT INTO mode_of_transport (name) VALUES ('Ship');
INSERT INTO mode_of_transport (name) VALUES ('Air');
INSERT INTO mode_of_transport (name) VALUES ('Land(Truck)');
INSERT INTO mode_of_transport (name) VALUES ('Land(Train)');


text:
package draw2d

type Path interface {
	// Return the current point of the path
	LastPoint() (x, y float64)
	// Create a new subpath that start at the specified point
	MoveTo(x, y float64)
	// Create a new subpath that start at the specified point
	// relative to the current point
	RMoveTo(dx, dy float64)
	// Add a line to the current subpath
	LineTo(x, y float64)
	// Add a line to the current subpath
	// relative to the current point
	RLineTo(dx, dy float64)

	QuadCurveTo(cx, cy, x, y float64)
	RQuadCurveTo(dcx, dcy, dx, dy float64)
	CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64)
	RCubicCurveTo(dcx1, dcy1, dcx2, dcy2, dx, dy float64)
	ArcTo(cx, cy, rx, ry, startAngle, angle float64)
	RArcTo(dcx, dcy, rx, ry, startAngle, angle float64)
	Close()
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Nephromium parile f. hybridum Gyeln. ex Nikol.

### Remarks
null