text:
AliAnalysisCombinedHadronSpectra2MC* AddTOFTaskMC()
{
  //pp settings
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr)
    {
      ::Error("AddTOFTask", "No analysis manager to connect to.");
      return NULL;
    }
  // Check the analysis type using the event handlers connected to the analysis manager.
  //==============================================================================
  if (!mgr->GetInputEventHandler())
    {
      ::Error("AddTOFTask", "This task requires an input event handler");
      return NULL;
    }

  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
  if(type.Contains("AOD"))
    {
      ::Error("AddTOFTask", "This task requires to run on ESD");
      return NULL;
    }

 //  TString outputFileName = AliAnalysisManager::GetCommonFileName();
//   outputFileName += ":PWG2SpectraTOF";

  AliAnalysisCombinedHadronSpectra2MC* task = new AliAnalysisCombinedHadronSpectra2MC("AliAnalysisCombinedHadronSpectra2MC");

  mgr->AddTask(task);

  //Attach input
  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
  mgr->ConnectInput(task,0,cinput);

  AliAnalysisDataContainer *cOutputL1= mgr->CreateContainer("cOutputL1",TList::Class(), AliAnalysisManager::kOutputContainer, "TListCheckMatchEffMC.root");
  mgr->ConnectOutput(task, 1, cOutputL1);

  return task;

}


text:
package org.springframework.cloud.contract.verifier.builder;

import org.springframework.cloud.contract.spec.internal.ExecutionProperty;
import org.springframework.cloud.contract.spec.internal.Request;
import org.springframework.cloud.contract.spec.internal.Url;
import org.springframework.cloud.contract.verifier.file.SingleContractMetadata;
import org.springframework.cloud.contract.verifier.util.MapConverter;

class MockMvcUrlWhen implements When, MockMvcAcceptor, QueryParamsResolver {

	private final BlockBuilder blockBuilder;

	private final BodyParser bodyParser;

	MockMvcUrlWhen(BlockBuilder blockBuilder, BodyParser bodyParser) {
		this.blockBuilder = blockBuilder;
		this.bodyParser = bodyParser;
	}

	@Override
	public MethodVisitor<When> apply(SingleContractMetadata metadata) {
		Request request = metadata.getContract().getRequest();
		Url url = getUrl(request);
		addUrl(url, request);
		return this;
	}

	private Url getUrl(Request request) {
		if (request.getUrl() != null) {
			return request.getUrl();
		}
		if (request.getUrlPath() != null) {
			return request.getUrlPath();
		}
		throw new IllegalStateException("URL is not set!");
	}

	private void addUrl(Url buildUrl, Request request) {
		Object testSideUrl = MapConverter.getTestSideValues(buildUrl);
		String method = request.getMethod().getServerValue().toString().toLowerCase();
		String url = testSideUrl.toString();
		if (!(testSideUrl instanceof ExecutionProperty)) {
			url = this.bodyParser.quotedShortText(testSideUrl.toString());
		}
		this.blockBuilder.addIndented("." + method + "(" + url + ")");
	}

	@Override
	public boolean accept(SingleContractMetadata metadata) {
		return true;
	}

}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Graphis inaequalis Fée

### Remarks
null


text:
module Fastlane
  module Actions
    class SonarAction < Action
      def self.run(params)
        verify_sonar_scanner_binary

        command_prefix = [
          'cd',
          File.expand_path('.').shellescape,
          '&&'
        ].join(' ')

        sonar_scanner_args = []
        sonar_scanner_args << "-Dproject.settings=\"#{params[:project_configuration_path]}\"" if params[:project_configuration_path]
        sonar_scanner_args << "-Dsonar.projectKey=\"#{params[:project_key]}\"" if params[:project_key]
        sonar_scanner_args << "-Dsonar.projectName=\"#{params[:project_name]}\"" if params[:project_name]
        sonar_scanner_args << "-Dsonar.projectVersion=\"#{params[:project_version]}\"" if params[:project_version]
        sonar_scanner_args << "-Dsonar.sources=\"#{params[:sources_path]}\"" if params[:sources_path]
        sonar_scanner_args << "-Dsonar.language=\"#{params[:project_language]}\"" if params[:project_language]
        sonar_scanner_args << "-Dsonar.sourceEncoding=\"#{params[:source_encoding]}\"" if params[:source_encoding]
        sonar_scanner_args << params[:sonar_runner_args] if params[:sonar_runner_args]

        command = [
          command_prefix,
          'sonar-scanner',
          sonar_scanner_args
        ].join(' ')

        Action.sh command
      end

      def self.verify_sonar_scanner_binary
        UI.user_error!("You have to install sonar-scanner using `brew install sonar-runner`") unless `which sonar-scanner`.to_s.length > 0
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Invokes sonar-scanner to programmatically run SonarQube analysis"
      end

      def self.details
        [
          "See http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner for details.",
          "It can process unit test results if formatted as junit report as shown in [xctest](#xctest) action. It can also integrate coverage reports in Cobertura format, which can be transformed into by [slather](#slather) action."
        ].join("\n")
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :project_configuration_path,
                                        env_name: "FL_SONAR_RUNNER_PROPERTIES_PATH",
                                        description: "The path to your sonar project configuration file; defaults to `sonar-project.properties`", # default is enforced by sonar-scanner binary
                                        optional: true,
                                        verify_block: proc do |value|
                                          UI.user_error!("Couldn't find file at path '#{value}'") unless value.nil? or File.exist?(value)
                                        end),
          FastlaneCore::ConfigItem.new(key: :project_key,
                                       env_name: "FL_SONAR_RUNNER_PROJECT_KEY",
                                       description: "The key sonar uses to identify the project, e.g. `name.gretzki.awesomeApp`. Must either be specified here or inside the sonar project configuration file",
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :project_name,
                                       env_name: "FL_SONAR_RUNNER_PROJECT_NAME",
                                       description: "The name of the project that gets displayed on the sonar report page. Must either be specified here or inside the sonar project configuration file",
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :project_version,
                                       env_name: "FL_SONAR_RUNNER_PROJECT_VERSION",
                                       description: "The project's version that gets displayed on the sonar report page. Must either be specified here or inside the sonar project configuration file",
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :sources_path,
                                       env_name: "FL_SONAR_RUNNER_SOURCES_PATH",
                                       description: "Comma-separated paths to directories containing source files. Must either be specified here or inside the sonar project configuration file",
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :project_language,
                                       env_name: "FL_SONAR_RUNNER_PROJECT_LANGUAGE",
                                       description: "Language key, e.g. objc",
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :source_encoding,
                                       env_name: "FL_SONAR_RUNNER_SOURCE_ENCODING",
                                       description: "Used encoding of source files, e.g., UTF-8",
                                       optional: true),
          FastlaneCore::ConfigItem.new(key: :sonar_runner_args,
                                       env_name: "FL_SONAR_RUNNER_ARGS",
                                       description: "Pass additional arguments to sonar-scanner. Be sure to provide the arguments with a leading `-D` e.g. FL_SONAR_RUNNER_ARGS=\"-Dsonar.verbose=true\"",
                                       optional: true)
        ]
      end

      def self.return_value
        "The exit code of the sonar-scanner binary"
      end

      def self.authors
        ["c_gretzki"]
      end

      def self.is_supported?(platform)
        true
      end

      def self.example_code
        [
          'sonar(
            project_key: "name.gretzki.awesomeApp",
            project_version: "1.0",
            project_name: "iOS - AwesomeApp",
            sources_path: File.expand_path("../AwesomeApp")
          )'
        ]
      end

      def self.category
        :testing
      end
    end
  end
end


text:
using System.IO;
using System.Threading.Tasks;

namespace Microsoft.DataTransfer.Extensibility.Basics.Source.StreamProviders
{
    /// <summary>
    /// Provides <see cref="StreamReader" /> instance to read data from the source stream.
    /// </summary>
    public interface ISourceStreamProvider
    {
        /// <summary>
        /// Gets the identifier of the stream.
        /// </summary>
        string Id { get; }

        /// <summary>
        /// Creates a new <see cref="StreamReader" /> to read data from the stream.
        /// </summary>
        /// <returns>Task that represents asynchronous create operation.</returns>
        Task<StreamReader> CreateReader();
    }
}


text:
package com.smartdevicelink.proxy.rpc.enums;

public enum SdlDisconnectedReason {
	USER_EXIT,
    IGNITION_OFF,
    BLUETOOTH_OFF,
    USB_DISCONNECTED,
    REQUEST_WHILE_IN_NONE_HMI_LEVEL,
    TOO_MANY_REQUESTS,
    DRIVER_DISTRACTION_VIOLATION,
    LANGUAGE_CHANGE,
    MASTER_RESET,
    FACTORY_DEFAULTS,
    TRANSPORT_ERROR,
    APPLICATION_REQUESTED_DISCONNECT,
    DEFAULT,
    TRANSPORT_DISCONNECT,
    HB_TIMEOUT,
    BLUETOOTH_DISABLED,
    BLUETOOTH_ADAPTER_ERROR,
    SDL_REGISTRATION_ERROR,
    APP_INTERFACE_UNREG,
    GENERIC_ERROR;

	public static SdlDisconnectedReason valueForString(String value) {
        try{
            return valueOf(value);
        }catch(Exception e){
            return null;
        }
    }

	public static SdlDisconnectedReason convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason reason) {
	    if(reason == null){
	        return null;
	    }

		SdlDisconnectedReason returnReason = SdlDisconnectedReason.DEFAULT;

		switch(reason) {
			case USER_EXIT:
				returnReason = SdlDisconnectedReason.USER_EXIT;
				break;
			case IGNITION_OFF:
				returnReason = SdlDisconnectedReason.IGNITION_OFF;
				break;
			case BLUETOOTH_OFF:
				returnReason = SdlDisconnectedReason.BLUETOOTH_OFF;
				break;
			case USB_DISCONNECTED:
				returnReason = SdlDisconnectedReason.USB_DISCONNECTED;
				break;
			case REQUEST_WHILE_IN_NONE_HMI_LEVEL:
				returnReason = SdlDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL;
				break;
			case TOO_MANY_REQUESTS:
				returnReason = SdlDisconnectedReason.TOO_MANY_REQUESTS;
				break;
			case DRIVER_DISTRACTION_VIOLATION:
				returnReason = SdlDisconnectedReason.DRIVER_DISTRACTION_VIOLATION;
				break;
			case LANGUAGE_CHANGE:
				returnReason = SdlDisconnectedReason.LANGUAGE_CHANGE;
				break;
			case MASTER_RESET:
				returnReason = SdlDisconnectedReason.MASTER_RESET;
				break;
			case FACTORY_DEFAULTS:
				returnReason = SdlDisconnectedReason.FACTORY_DEFAULTS;
				break;
            default:
                break;
		}

		return returnReason;
	}
}


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

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Maven Bundle Plugin -
    bundle:bundleall</title>

    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
    <meta name="Date-Revision-yyyymmdd" content="20120211" />
    <meta http-equiv="Content-Language" content="en" />

                Maven Bundle Plugin

        Last Published: 2012-02-11
                   | Version: 2.4.0-SNAPSHOT

Overview

                          Introduction

                          Goals

                          Wiki

                          FAQ

                          Release Notes

Project Documentation

                          Project Information

                          Project Reports

bundle:bundleall

Full name:

org.apache.felix:maven-bundle-plugin:2.4.0-SNAPSHOT:bundleall

This plugin goal has been deprecated:

The bundleall goal is no longer supported and may be removed in a
future release

Description:

Create OSGi bundles from all dependencies in the Maven project

Attributes:

Requires a Maven project to be executed.

Requires dependency resolution of artifacts in scope: <tt>test</tt>.

The goal is thread-safe and supports parallel builds.

Binds by default to the lifecycle phase: <tt>package</tt>.

Required Parameters

            Name
            Type
            Since
            Description

            buildDirectory
            <tt>String</tt>
            <tt>-</tt>
            The directory for the generated JAR.

            outputDirectory
            <tt>File</tt>
            <tt>-</tt>
            The directory for the generated bundles.

Optional Parameters

            Name
            Type
            Since
            Description

            archive
            <tt>MavenArchiveConfiguration</tt>
            <tt>-</tt>
            The archive configuration to use.

            classifier
            <tt>String</tt>
            <tt>-</tt>
            Classifier type of the bundle to be installed. For example,
"jdk14". Defaults to none which means this is the project's main
bundle.

            depth
            <tt>int</tt>
            <tt>-</tt>
            Process up to some depth

            dumpClasspath
            <tt>File</tt>
            <tt>-</tt>
            File where the BND class-path will be dumped

            dumpInstructions
            <tt>File</tt>
            <tt>-</tt>
            File where the BND instructions will be dumped

            excludeDependencies
            <tt>String</tt>
            <tt>-</tt>
            Comma separated list of artifactIds to exclude from the dependency
classpath passed to BND (use "true" to exclude everything)

            ignoreMissingArtifacts
            <tt>boolean</tt>
            <tt>-</tt>
            Ignore missing artifacts that are not required by current project
but are required by the transitive dependencies.

            instructions
            <tt>Map</tt>
            <tt>-</tt>
            The BND instructions for the bundle.

            manifestLocation
            <tt>File</tt>
            <tt>-</tt>
            Directory where the manifest will be written
Default value is: <tt>${project.build.outputDirectory}/META-INF</tt>.

            rebuildBundle
            <tt>boolean</tt>
            <tt>-</tt>
            When true, generate the manifest by rebuilding the full bundle in
memory

            supportedProjectTypes
            <tt>List</tt>
            <tt>-</tt>
            Project types which this plugin supports.

            unpackBundle
            <tt>boolean</tt>
            <tt>-</tt>
            When true, unpack the bundle contents to the outputDirectory

            wrapImportPackage
            <tt>String</tt>
            <tt>-</tt>
            Import-Package to be used when wrapping dependencies.
Default value is: <tt>*</tt>.

Parameter Details

archive:

The archive configuration to use.

Type: <tt>org.apache.maven.archiver.MavenArchiveConfiguration</tt>

Required: <tt>No</tt>

buildDirectory:

The directory for the generated JAR.

Type: <tt>java.lang.String</tt>

Required: <tt>Yes</tt>

Expression: <tt>${project.build.directory}</tt>

classifier:

Classifier type of the bundle to be installed. For example,
"jdk14". Defaults to none which means this is the project's main
bundle.

Type: <tt>java.lang.String</tt>

Required: <tt>No</tt>

depth:

Process up to some depth

Type: <tt>int</tt>

Required: <tt>No</tt>

dumpClasspath:

File where the BND class-path will be dumped

Type: <tt>java.io.File</tt>

Required: <tt>No</tt>

Expression: <tt>${dumpClasspath}</tt>

dumpInstructions:

File where the BND instructions will be dumped

Type: <tt>java.io.File</tt>

Required: <tt>No</tt>

Expression: <tt>${dumpInstructions}</tt>

excludeDependencies:

Comma separated list of artifactIds to exclude from the dependency
classpath passed to BND (use "true" to exclude everything)

Type: <tt>java.lang.String</tt>

Required: <tt>No</tt>

Expression: <tt>${excludeDependencies}</tt>

ignoreMissingArtifacts:

Ignore missing artifacts that are not required by current project
but are required by the transitive dependencies.

Type: <tt>boolean</tt>

Required: <tt>No</tt>

instructions:

The BND instructions for the bundle.

Type: <tt>java.util.Map</tt>

Required: <tt>No</tt>

manifestLocation:

Directory where the manifest will be written

Type: <tt>java.io.File</tt>

Required: <tt>No</tt>

Expression: <tt>${manifestLocation}</tt>

Default: <tt>${project.build.outputDirectory}/META-INF</tt>

outputDirectory:

The directory for the generated bundles.

Type: <tt>java.io.File</tt>

Required: <tt>Yes</tt>

Expression: <tt>${project.build.outputDirectory}</tt>

rebuildBundle:

When true, generate the manifest by rebuilding the full bundle in
memory

Type: <tt>boolean</tt>

Required: <tt>No</tt>

Expression: <tt>${rebuildBundle}</tt>

supportedProjectTypes:

Project types which this plugin supports.

Type: <tt>java.util.List</tt>

Required: <tt>No</tt>

unpackBundle:

When true, unpack the bundle contents to the outputDirectory

Type: <tt>boolean</tt>

Required: <tt>No</tt>

Expression: <tt>${unpackBundle}</tt>

wrapImportPackage:

Import-Package to be used when wrapping dependencies.

Type: <tt>java.lang.String</tt>

Required: <tt>No</tt>

Expression: <tt>${wrapImportPackage}</tt>

Default: <tt>*</tt>

Copyright ©                    2006-2012
                        The Apache Software Foundation.
            All Rights Reserved.


text:
/* Header file for Tcp Server using epoll based reads.

The epoll interface is automatically available on Linux operating systems.
However, a significant amount of our development work happens on Mac OS.

One of our goals is to have a codebase that can be built and tested on both
Mac OS and Linux. However, the code only needs to be performant on our Linux
cluster machines.

Current module is a layer imitating the Linux epoll mechanism. On Linux, this
module uses epoll directly in edge triggered mode. On Mac OS this module uses
polling internally.

*/
#ifndef __CC_NET_EPOLL_SERVER__
#define __CC_NET_EPOLL_SERVER__

#include "cc/net/epoll_shim.h"
#include "cc/shared/common.h"
#include "cc/shared/mutex.h"
#include "cc/shared/scoped_ptr.h"

#include <boost/unordered_map.hpp>

// Forward declarations.
namespace boost {
class thread_group;
}  // boost

namespace cc_net {

class EpollServer {
 public:
  // Connection handler interface.
  class EpollConnectionHandler {
   public:
    // Initial context. Parameters can be used for sending packets.
    virtual void set_context(int64 connection_handle,
                             EpollServer* epoll_server) = 0;

    // Upcall packets.
    virtual void handle_buffer(const char* buffer, int byte_count) = 0;

    // Connection handler object can be destroyed after this.
    virtual void finalize() {
      delete this;
    }
  };

  // Connection handler factory interface.
  class EpollConnectionHandlerFactory {
   public:
    virtual EpollConnectionHandler* get() = 0;
  };

  EpollServer(const char* host, const char* port,
              EpollConnectionHandlerFactory* getter, int wait_thread_count);

  ~EpollServer();

  int32 get_actual_port() {
    return actual_port_;
  }

  // Methods that can be called by Connection Handler only.
  void close_connection(int64 connection_handle);
  void send_blocking(int64 connection_handle, const char* buffer,
                     int byte_count);

  // Methods that can be called by lower shim layer.
  void handle_upcall(int64 connection_handle);

 private:
  int64 acceptor_handle_;
  int acceptor_fd_;
  int32 actual_port_;
  EpollConnectionHandlerFactory* getter_;
  cc_shared::scoped_ptr<EpollShim> epoll_shim_;

  cc_shared::scoped_ptr<boost::thread_group> wait_threads_;
  int wait_thread_count_;

  cc_shared::Mutex lock_;
  int64 handle_seed_;
  boost::unordered_map<int64, int> handle_to_fd_lookup_;
  boost::unordered_map<int64, EpollConnectionHandler*> handler_lookup_;
  boost::unordered_map<int64, int> handler_refcount_;

  int64 get_new_connection_handle(int descriptor);

  void wait_worker();

  void do_connection_accept();

  void do_connection_upcall(int64 connection_handle);

  void complete_connection_socket(int64 connection_handle);

  // TODO: Remove map lookup implementation from this class and use the generic
  // implementation in cc_shared::RefcountedLookup.
  void handler_ref(int64 connection_handle);

  void handler_deref(int64 connection_handle);

  void upcall_connection_started(int64 connection_handle);

  void upcall_connection_closed(int64 connection_handle);

  void upcall_handle_buffer(int64 connection_handle, const char* buffer,
                            int byte_count);

  DISALLOW_COPY_AND_ASSIGN(EpollServer);
};

// Getter implementation.
template <typename _ParentType, typename _HandlerType>
class HandlerGetter : public EpollServer::EpollConnectionHandlerFactory {
 public:
  explicit HandlerGetter(_ParentType* parent) : parent_(parent) {
  }

  virtual ~HandlerGetter() {
  }

  virtual EpollServer::EpollConnectionHandler* get() {
    _HandlerType* instance = new(std::nothrow) _HandlerType();
    if (instance) {
      instance->set_parent(parent_);
    }
    return instance;
  }
 private:
  _ParentType* parent_;
  DISALLOW_COPY_AND_ASSIGN(HandlerGetter);
};

}  // cc_net

#endif  // __CC_NET_EPOLL_SERVER__


text:
class Account
  class Surah < ApplicationRecord
    belongs_to :account
    belongs_to :surah, class_name: 'Quran::Surah'
  end
end


text:
package server

import org.specs2.mutable.Specification
import server.helpers.{TestUser2, TestUser}

/**
  * Created by Lapanti on 15.3.2016.
  */
class EndpointSpec extends Specification {

  "A \"TestUser\" class's objectPath extending Endpoint" should {
    (new TestUser).objectPath mustEqual "testuser"
  }

  "A \"TestUser2\" class's overridden objectPath extending Endpoint" should {
    (new TestUser2).objectPath mustEqual "notuser"
  }

}