text:
#ifndef BABYLON_ANIMATIONS_EASING_QUARTIC_EASE_H
#define BABYLON_ANIMATIONS_EASING_QUARTIC_EASE_H

#include <memory>

#include <babylon/animations/easing/easing_function.h>
#include <babylon/babylon_api.h>

namespace BABYLON {

class QuarticEase;
using QuarticEasePtr = std::shared_ptr<QuarticEase>;

/**
 * @brief Easing function with a power of 4 shape (see link below).
 * @see https://easings.net/#easeInQuart
 * @see https://doc.babylonjs.com/babylon101/animations#easing-functions
 */
class BABYLON_SHARED_EXPORT QuarticEase : public EasingFunction {

public:
  template <typename... Ts>
  static QuarticEasePtr New(Ts&&... args)
  {
    return std::shared_ptr<QuarticEase>(new QuarticEase(std::forward<Ts>(args)...));
  }
  ~QuarticEase() override; // = default

  /**
   * @brief Hidden
   */
  [[nodiscard]] float easeInCore(float gradient) const override;

protected:
  QuarticEase() = default;

}; // end of class QuarticEase

} // end of namespace BABYLON

#endif // end of BABYLON_ANIMATIONS_EASING_QUARTIC_EASE_H


text:
package br.com.ifam.mvc.configuration;

import java.io.File;
import javax.servlet.MultipartConfigElement;
import javax.servlet.ServletRegistration;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

        private int maxUploadSizeInMb = 5 * 1024 * 1024; // 5 MB

        @Override
        protected Class<?>[] getServletConfigClasses() {
            return new Class[]{AppConfig.class};
        }

        @Override
        protected String[] getServletMappings() {
            return new String[]{"/"};
        }

        @Override
        protected Class<?>[] getRootConfigClasses() {
            return null;
        }

        @Override
        protected void customizeRegistration(ServletRegistration.Dynamic registration) {

            // upload temp file will put here
            File uploadDirectory = new File(System.getProperty("java.io.tmpdir"));

            // register a MultipartConfigElement
            MultipartConfigElement multipartConfigElement =
                    new MultipartConfigElement(uploadDirectory.getAbsolutePath(),
                            maxUploadSizeInMb, maxUploadSizeInMb * 2, maxUploadSizeInMb / 2);

            registration.setMultipartConfig(multipartConfigElement);

        }

}

redpajama_set_name: RedPajamaGithub


text:
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module      :  Graphics.GL.SGIX.FogOffset
-- Copyright   :  (c) Sven Panne 2019
-- License     :  BSD3
--
-- Maintainer  :  Sven Panne <svenpanne@gmail.com>
-- Stability   :  stable
-- Portability :  portable
--
--------------------------------------------------------------------------------

module Graphics.GL.SGIX.FogOffset (
  -- * Extension Support
  glGetSGIXFogOffset,
  gl_SGIX_fog_offset,
  -- * Enums
  pattern GL_FOG_OFFSET_SGIX,
  pattern GL_FOG_OFFSET_VALUE_SGIX
) where

import Graphics.GL.ExtensionPredicates
import Graphics.GL.Tokens


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace LeetCode.Test
{
    [TestClass]
    public class _034_SearchForARange_Test
    {
        [TestMethod]
        public void SearchRangeTest()
        {
            var input = new int[] { 5, 7, 7, 8, 8, 10 };
            var solution = new _034_SearchForARange();

            var result = solution.SearchRange(input, 5);
            Assert.AreEqual(0, result[0]);
            Assert.AreEqual(0, result[1]);

            result = solution.SearchRange(input, 10);
            Assert.AreEqual(5, result[0]);
            Assert.AreEqual(5, result[1]);
        }

        [TestMethod]
        public void SearchRangeTest_WithDuplicate()
        {
            var input = new int[] { 5, 7, 7, 8, 8, 10 };
            var solution = new _034_SearchForARange();

            var result = solution.SearchRange(input, 8);
            Assert.AreEqual(3, result[0]);
            Assert.AreEqual(4, result[1]);

            result = solution.SearchRange(input, 7);
            Assert.AreEqual(1, result[0]);
            Assert.AreEqual(2, result[1]);
        }

        [TestMethod]
        public void SearchRangeTest_NotFound()
        {
            var input = new int[] { 5, 7, 7, 8, 8, 10 };
            var solution = new _034_SearchForARange();

            var result = solution.SearchRange(input, 6);
            Assert.AreEqual(-1, result[0]);
            Assert.AreEqual(-1, result[1]);

            result = solution.SearchRange(input, 4);
            Assert.AreEqual(-1, result[0]);
            Assert.AreEqual(-1, result[1]);

            result = solution.SearchRange(input, 9);
            Assert.AreEqual(-1, result[0]);
            Assert.AreEqual(-1, result[1]);

            result = solution.SearchRange(input, 11);
            Assert.AreEqual(-1, result[0]);
            Assert.AreEqual(-1, result[1]);
        }

        [TestMethod]
        public void SearchRangeTest_OneItem_Match()
        {
            var input = new int[] { 5 };

            var solution = new _034_SearchForARange();
            var result = solution.SearchRange(input, 5);

            Assert.AreEqual(0, result[0]);
            Assert.AreEqual(0, result[1]);
        }

        [TestMethod]
        public void SearchRangeTest_OneItem_NotMatch()
        {
            var input = new int[] { 5 };

            var solution = new _034_SearchForARange();
            var result = solution.SearchRange(input, 6);

            Assert.AreEqual(-1, result[0]);
            Assert.AreEqual(-1, result[1]);
        }

        [TestMethod]
        public void SearchRangeTest_AllSame()
        {
            var input = new int[] { 5, 5 };

            var solution = new _034_SearchForARange();
            var result = solution.SearchRange(input, 5);

            Assert.AreEqual(0, result[0]);
            Assert.AreEqual(1, result[1]);
        }
    }
}


text:
%% Performance of a simple implementation
% If are viewing the ".mlx" file, you are looking at a Live Script.  If you
% are viewing the ".m" file, you are looking at that Live Script file, but converted
% to a regular ".m" file.  In that case, some of the comments may not apply!
%% What is a Live Script?
% A Live Script is a file that allows one to mix comments, including mathematical
% text, with executable code (in the light gray boxes).  This allows exercises,
% like this one, to be naturally intertwined with executable code.  How do you
% execute?  If you are viewing this, you will see "Run Section", "Run to End",
% etc. at the top. Clicking on these when your cursor is in some part of this
% file will have the obvious effect.  So does clicking on "Run All", which is
% what you will want to do most of the time.
%% This Live Script
% This Live Script helps you visualize the performance of the very simple implementation
% of matrix-matrix multiplication in Gemm_IJP.c.
%
% To gather the performance data, in the command (terminal) window change
% the directory to Assignments/Week1/C/ and execute
%
%        make IJP
%
% This compiles and executes a driver routine (the source of which is in
% driver.c) that collects accuracy and performance data for the implementation
% in Gemm_IJP.c.
%
% When completed, various data is in output file 'output_IJP.m' in the same
% directory where you found this Live Script (LAFF-On-HPC/Assignments/Week1/C/data/).
% This Life Script then creates graphs from that timing data.  Go ahead and click
% on "Run All".  It executes all the code in the rest of this file.  You will
% want to look at the graphs this creates.
%% Load timing data

output_IJP
%% Make sure you are getting the right answer
% In output_IJP.m, for different matrix sizes, timing data is collected as well
% as how close the answer is to the answer attained by the reference implementation.
% Here we look at the maximum difference over all experiments.  This should be
% somewhere on the order of  $10^{-11}$  or smaller.  You can expect some difference
% between the two implementations, due to round-off error and the order in which
% computations are performed.

assert( max(abs(data(:,6))) < 1.0e-10, 'Hmmm, better check if there is an accuracy problem');
%% Plot the timing data.
% A first graph shows the execution time of the implementation in Gemm_IJP.m
% for various matrix sizes $m = n = k$.

% Close all existing figures. (This is important for the ".m" version of this file.)
close all

% Create figure
figure1 = figure( 'Name', 'Time' );

% Create axes, labels, legends
axes1 = axes( 'Parent', figure1 );
hold( axes1, 'on' );
ylabel( 'Time (in sec.)', 'FontName', 'Helvetica Neue' );
xlabel( 'matrix dimension m=n=k', 'FontName', 'Helvetica Neue' );
box( axes1, 'on');
set( axes1, 'FontName', 'Helvetica Neue', 'FontSize', 18);

% Plot time data for IJP
plot( data(:,1), data(:,4), 'MarkerSize', 8, 'LineWidth', 2, ...
      'DisplayName', 'IJP', 'Marker', 'o', 'LineStyle', '-.', 'Color', [0 0 1] );

% Optionally show the reference implementation timing data
if ( 0 )
  plot( data(:,1), data(:,2), 'MarkerSize', 8, 'LineWidth', 2, ...
        'DisplayName', 'Reference', 'Color', [0 0 0] );
end

% Adjust the x-axis and y-axis range to start at 0
v = axis;                  % extract the current ranges of the graph
axis( [ 0 v(2) 0 v(4) ] )  % start the x axis and y axis at zero

legend1 = legend( axes1, 'show' );
set( legend1, 'Location', 'northwest', 'FontSize', 18) ;

% Uncomment if you want to create a pdf for the graph
% print( 'Plot_IJP_Timing.pdf', '-dpdf' );
%% Plotting performance (rate of computation)
% We will often examine the rate at which Gemm_IJP.c  compute rather than the
% time required for completing the computation.
%
% * When all matrices are $n \times n$, we know that a matrix-matrix  multiplication$
% A B + C$ requires $2n^3$ floating point operations (flops).
% * This means that the number of operations performed per second is given by
% ${2 n^3}/{t}$ flops, where $t$ is the time, in seconds, for computing the multiplication.
% * Now, a typical current core can perform billions of flops per second, so
% instead we report performance in GFLOPS. (billions of flops per second): ${2
% n^3}/{t} \times 10^{-9}$.  This is reported computed in the third (for the reference
% implementation) and fifth colum (for IJP) of the data file.

% Create figure
figure2 = figure('Name','GFLOPS');

% Create axes, labels, legends.  In future routines for plotting performance,
% the next few lines will be hidden in the script.
axes2 = axes('Parent',figure2);
hold(axes2,'on');
ylabel( 'GFLOPS', 'FontName', 'Helvetica Neue' );
xlabel( 'matrix dimension m=n=k', 'FontName', 'Helvetica Neue' );
box(axes2,'on');
set( axes2, 'FontName', 'Helvetica Neue', 'FontSize', 18);

% Plot time data for IJP
% Important: the myplot routine is a wrapper to plot that gets around
% a incompatibility between MATLAB and Octave regarding the 'DisplayName'
% parameter.  It is important to keep the list of parameters exactly as is,
% with the exact some number of parameters.
plot( data(:,1), data(:,5), 'DisplayName', 'IJP', 'MarkerSize', 8, 'LineWidth', 2, ...
      'Marker', 'o', 'LineStyle', '-.', 'Color', [0 0 1] );

% Optionally show the reference implementation performance data
if ( 0 )
  plot( data(:,1), data(:,3), 'MarkerSize', 8, 'LineWidth', 2, ...
        'DisplayName', 'Ref', 'Color', [0 0 0] );
end

% Adjust the x-axis and y-axis range to start at 0
v = axis;                   % extract the current ranges
axis( [ 0 v(2) 0 v(4) ] )   % start the x axis and y axis at zero

% Optionally change the top of the graph to capture the theoretical peak
if ( 0 )
    turbo_clock_rate = 2.6;
    flops_per_cycle = 16;
    peak_gflops = turbo_clock_rate * flops_per_cycle;

    axis( [ 0 v(2) 0 peak_gflops ] )
end

legend2 = legend( axes2, 'show' );
set( legend2, 'Location', 'northwest', 'FontSize', 18) ;

% Uncomment if you want to create a pdf for the graph
% print( 'Plot_IJP_GFLOPS.pdf', '-dpdf' );
%%


text:
<?php

namespace PureBilling\Bundle\SDKBundle\Store\V1\Option;

use PureMachine\Bundle\SDKBundle\Store\Base\BaseStore;
use PureMachine\Bundle\SDKBundle\Store\Annotation as Store;
use Symfony\Component\Validator\Constraints as Assert;
use PureBilling\Bundle\SDKBundle\Constraints as PBAssert;

class OptionBase extends BaseStore
{

    /**
     * @Store\Property(description="option id")
     * @PBAssert\Type(type="id", idPrefixes={"option"})
     */
    protected $id;

    /**
     * @Store\Property(description="boolean flag")
     * @PBAssert\Type(type="bool")
     */
    protected $enabled=true;

}


text:
package com.facebook.buck.ocaml;

import com.facebook.buck.cxx.CxxPlatforms;
import com.facebook.buck.io.ProjectFilesystem;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.parser.NoSuchBuildTargetException;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.CellPathResolver;
import com.facebook.buck.rules.CommonDescriptionArg;
import com.facebook.buck.rules.Description;
import com.facebook.buck.rules.HasDeclaredDeps;
import com.facebook.buck.rules.ImplicitDepsInferringDescription;
import com.facebook.buck.rules.TargetGraph;
import com.facebook.buck.rules.args.StringArg;
import com.facebook.buck.rules.coercer.OcamlSource;
import com.facebook.buck.rules.macros.StringWithMacros;
import com.facebook.buck.util.immutables.BuckStyleImmutable;
import com.facebook.buck.versions.VersionPropagator;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import java.util.Optional;
import org.immutables.value.Value;

public class OcamlLibraryDescription
    implements Description<OcamlLibraryDescriptionArg>,
        ImplicitDepsInferringDescription<
            OcamlLibraryDescription.AbstractOcamlLibraryDescriptionArg>,
        VersionPropagator<OcamlLibraryDescriptionArg> {

  private final OcamlBuckConfig ocamlBuckConfig;

  public OcamlLibraryDescription(OcamlBuckConfig ocamlBuckConfig) {
    this.ocamlBuckConfig = ocamlBuckConfig;
  }

  public OcamlBuckConfig getOcamlBuckConfig() {
    return ocamlBuckConfig;
  }

  @Override
  public Class<OcamlLibraryDescriptionArg> getConstructorArgType() {
    return OcamlLibraryDescriptionArg.class;
  }

  @Override
  public BuildRule createBuildRule(
      TargetGraph targetGraph,
      BuildTarget buildTarget,
      ProjectFilesystem projectFilesystem,
      BuildRuleParams params,
      BuildRuleResolver resolver,
      CellPathResolver cellRoots,
      OcamlLibraryDescriptionArg args)
      throws NoSuchBuildTargetException {

    ImmutableList<OcamlSource> srcs = args.getSrcs();
    ImmutableList.Builder<com.facebook.buck.rules.args.Arg> flags = ImmutableList.builder();
    flags.addAll(
        OcamlDescriptionEnhancer.toStringWithMacrosArgs(
            buildTarget, cellRoots, resolver, args.getCompilerFlags()));
    if (ocamlBuckConfig.getWarningsFlags().isPresent() || args.getWarningsFlags().isPresent()) {
      flags.addAll(
          StringArg.from(
              "-w",
              ocamlBuckConfig.getWarningsFlags().orElse("") + args.getWarningsFlags().orElse("")));
    }
    ImmutableList<String> linkerflags = args.getLinkerFlags();

    boolean bytecodeOnly = args.getBytecodeOnly();
    boolean nativePlugin = !bytecodeOnly && args.getNativePlugin();

    return OcamlRuleBuilder.createBuildRule(
        ocamlBuckConfig,
        buildTarget,
        projectFilesystem,
        params,
        resolver,
        srcs,
        /*isLibrary*/ true,
        bytecodeOnly,
        flags.build(),
        linkerflags,
        nativePlugin);
  }

  @Override
  public void findDepsForTargetFromConstructorArgs(
      BuildTarget buildTarget,
      CellPathResolver cellRoots,
      AbstractOcamlLibraryDescriptionArg constructorArg,
      ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
      ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {
    extraDepsBuilder.addAll(CxxPlatforms.getParseTimeDeps(ocamlBuckConfig.getCxxPlatform()));
  }

  @BuckStyleImmutable
  @Value.Immutable
  interface AbstractOcamlLibraryDescriptionArg extends CommonDescriptionArg, HasDeclaredDeps {
    ImmutableList<OcamlSource> getSrcs();

    ImmutableList<StringWithMacros> getCompilerFlags();

    ImmutableList<String> getLinkerFlags();

    Optional<String> getWarningsFlags();

    @Value.Default
    default boolean getBytecodeOnly() {
      return false;
    }

    @Value.Default
    default boolean getNativePlugin() {
      return false;
    }
  }
}


text:
package org.jasig.portal.tools.dbloader;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

/**
 * Describes a class that is able to drop, create and populate database tables based on XML
 * definition files.
 *
 * @author Eric Dalquist
 * @version $Revision$
 */
public interface IDbLoader {

    /**
     * Executes database loading based on the provided configuration
     */
    public abstract void process(DbLoaderConfig configuration) throws ParserConfigurationException,
            SAXException, IOException;

}


text:
<?php

namespace AppBundle\Controller;

use AppBundle\Entity\ArkounayImage;
use AppBundle\Entity\Contact;
use AppBundle\Entity\Fixture;
use AppBundle\Form\ArkounayImageType;
use AppBundle\Form\ContactType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
 * @author Arthur Gribet <a.gribet@gmail.com>
 * @Route("/bundle")
 */
class BundleController extends Controller
{

    /**
     * @Route("/", name="bundle")
     */
    public function bundleAction()
    {

        $this->generateBreadcrumbs();

        $bundles = [
            ['arkounay/imageBundle', 'https://github.com/Arkounay/imageBundle', 'composer require arkounay/image-bundle'],
            ['arkounay/block-bundle', 'https://github.com/Arkounay/BlockBundle', 'c require arkounay/block-bundle'],
            ['KnpLabs/KnpPaginatorBundle', 'https://github.com/KnpLabs/KnpPaginatorBundle', 'composer require knplabs/knp-paginator-bundle'],
            ['KnpLabs/KnpSnappyBundle', ' https://github.com/KnpLabs/KnpSnappyBundle', '"knplabs/knp-snappy-bundle": "~1.4"'],
            ['misd/phone-number-bundle', 'https://github.com/misd-service-development/phone-number-bundle', 'composer require misd/phone-number-bundle', "This bundle integrates Google's libphonenumber into your Symfony2 application through the giggsey/libphonenumber-for-php port."],
            ['artgris/version-checker-bundle', 'https://github.com/artgris/VersionCheckerBundle', 'composer require artgris/version-checker-bundle'],
            ['artgris/InteractiveSVGBundle', 'https://github.com/artgris/InteractiveSVGBundle', 'composer require artgris/interactive-svg-bundle'],
            ['Gregwar/ImageBundle', 'https://github.com/Gregwar/ImageBundle', '"gregwar/image-bundle": "dev-master"'],
            ['FOSUserBundle', 'https://github.com/FriendsOfSymfony/FOSUserBundle', 'c require friendsofsymfony/user-bundle "~2.0@dev'],
            ['Asset Management', 'https://symfony.com/doc/current/assetic/asset_management.html', 'c require symfony/assetic-bundle'],
            ['whiteoctober/BreadcrumbsBundle', 'https://github.com/whiteoctober/BreadcrumbsBundle', 'c require whiteoctober/breadcrumbs-bundle'],
            ['StofDoctrineExtensionsBundle', 'https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html', 'c require stof/doctrine-extensions-bundle'],
            ['artgris/MaintenanceBundle', 'https://github.com/artgris/MaintenanceBundle', 'c require artgris/maintenance-bundle'],
            ['liuggio/ExcelBundle', 'https://github.com/liuggio/ExcelBundle', '"liuggio/excelbundle": "^2.1"', "This bundle permits you to create, modify and read excel objects"],
            ['knplabs/knp-menu-bundle', "https://github.com/KnpLabs/KnpMenuBundle", 'composer require knplabs/knp-menu-bundle "^2.0"'],

        ];
        $multilinguals = [
            ['knplabs/doctrine-behaviors', '  https://github.com/KnpLabs/DoctrineBehaviors#translatable', '"knplabs/doctrine-behaviors": "~1.1"', 'add behaviors to Doctrine2 entites and repositories.'],
            ['jms/translation-bundle', 'http://jmsyst.com/bundles/JMSTranslationBundle', '"jms/translation-bundle": "dev-master",', 'en : s translation:extract en --config=app'],
            ['jms/di-extra-bundle', 'http://jmsyst.com/bundles/JMSDiExtraBundle', '"jms/di-extra-bundle": "dev-master"'],
            ['jms/i18n-routing-bundle', ' http://jmsyst.com/bundles/JMSI18nRoutingBundle', '"jms/i18n-routing-bundle": "dev-master"', "This bundle allows you to create i18n routes"],
            ['a2lix/translation-form-bundle', 'http://a2lix.fr/bundles/translation-form/3.x.html', '"a2lix/translation-form-bundle": "2.*"'],
        ];
        $useFul = [
            ['soundasleep/html2text', '', ' "soundasleep/html2text": "~0.3"'],
            ['twig/extensions', 'http://twig.sensiolabs.org/doc/extensions/index.html', ' "twig/extensions": "^1.4"'],
            ['doctrine/doctrine-fixtures-bundle', 'https://github.com/doctrine/DoctrineFixturesBundle', 'composer require --dev doctrine/doctrine-fixtures-bundle']
        ];
        return $this->render('bundle/bundle.html.twig', [
            'title' => 'menu_bundles',
            'bundles' => $bundles,
            'useFul' => $useFul,
            'multilinguals' => $multilinguals
        ]);
    }

    /**
     * @Route("/artgris_version_checker_bundle", name="bundle_artgris_version_checker")
     */
    public function artgrisVersionCheckerAction()
    {
        $versions = $this->get('version_checker_service')->versionChecker();
        $this->generateBreadcrumbs()->addItem('menu_artgris_version_checker');

        return $this->render('bundle/artgris/version_checker_bundle.html.twig', [
            'versions' => $versions,
            'bundle' => 'artgris/VersionCheckerBundle'
        ]);
    }

    /**
     * @Route("/arkounay_image_bundle", name="bundle_arkounay_image")
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response
     */
    public function arkounayImageAction(Request $request)
    {
        $arkounayImageExist = $this->getDoctrine()->getRepository("AppBundle:ArkounayImage")->findOneBy([]);
        $arkounayImage = $arkounayImageExist !== null ? $arkounayImageExist : new ArkounayImage();
        $form = $this->createForm(ArkounayImageType::class, $arkounayImage);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($arkounayImage);
            $em->flush();
            $this->addFlash("success", $this->get('translator')->trans('image.saved_successfully'));
            return $this->redirectToRoute('bundle_arkounay_image');
        }

        $this->generateBreadcrumbs()->addItem('menu_arkounay_image');
        return $this->render('bundle/arkounay/image_bundle.html.twig', [
            'form' => $form->createView(),
            'bundle' => 'Arkounay/ImageBundle'
        ]);
    }

    /**
     * @Route("/arkounay_block_bundle", name="bundle_arkounay_block")
     */
    public function arkounayBlockAction()
    {
        $entityExist = $this->getDoctrine()->getRepository("AppBundle:Fixture")->findOneBy([]);
        $entity = $entityExist !== null ? $entityExist : new Fixture();
        $this->generateBreadcrumbs()->addItem('menu_arkounay_block');
        return $this->render('bundle/arkounay/block_bundle.html.twig', [
            'entity' => $entity,
            'bundle' => 'Arkounay/BlockBundle'
        ]);
    }

    /**
     * @Route("/gregwar_image_bundle", name="bundle_gregwar_image")
     */
    public function gregwarImageAction()
    {
        $this->generateBreadcrumbs()->addItem('menu_gregwar_image');
        return $this->render('bundle/gregwar/image_bundle.html.twig', [
            'imageLena' => "images/lena.gif",
            'bundle' => 'Gregwar/ImageBundle'
        ]);
    }

    /**
     * @Route("/knp_paginator_bundle", name="bundle_knp_paginator")
     * @param Request $request
     * @return Response
     */
    public function knpPaginatorAction(Request $request)
    {

        $em = $this->get('doctrine.orm.entity_manager');
        $dql = "SELECT f FROM AppBundle:Fixture f";
        $query = $em->createQuery($dql);

        $paginator = $this->get('knp_paginator');
        $pagination = $paginator->paginate(
            $query, /* query NOT result */
            $request->query->getInt('page', 1)/*page number*/,
            10/*limit per page*/
        );
        $this->generateBreadcrumbs()->addItem('menu_knp_paginator');
        // parameters to template
        return $this->render('bundle/knpLabs/knp_paginator_bundle.html.twig', [
            'pagination' => $pagination,
            'bundle' => 'KnpLabs/KnpPaginatorBundle'
        ]);
    }

    /**
     * @Route("/knp_snappy_bundle", name="bundle_knp_snappy")
     */
    public function KnpSnappyAction()
    {
        $this->generateBreadcrumbs()->addItem('menu_knp_snappy');
        return $this->render('bundle/knpLabs/knp_snappy_bundle.html.twig', [
            'bundle' => 'KnpLabs/KnpSnappyBundle'
        ]);

    }

    /**
     * @Route("/knp_snappy_bundle/pdf", name="bundle_knp_snappy_pdf")
     */
    public function KnpSnappyPdfAction()
    {
        $html = $this->renderView(':bundle/knpLabs:knp_snappy_bundle_export.html.twig', [
            'bundle' => 'KnpLabs/KnpSnappyBundle'
        ]);

        return new Response(
            $this->get('knp_snappy.pdf')->getOutputFromHtml($html),
            200,
            [
                'Content-Type' => 'application/pdf',
                'Content-Disposition' => 'attachment; filename="file.pdf"'
            ]
        );
    }

    /**
     * @Route("/knp_snappy_bundle/image", name="bundle_knp_snappy_image")
     */
    public function KnpSnappyImageAction()
    {
        $html = $this->renderView(':bundle/knpLabs:knp_snappy_bundle_export.html.twig', [
            'bundle' => 'KnpLabs/KnpSnappyBundle'
        ]);

        return new Response(
            $this->get('knp_snappy.image')->getOutputFromHtml($html),
            200,
            [
                'Content-Type' => 'image/jpg',
                'Content-Disposition' => 'attachment; filename="file.jpg"'
            ]
        );
    }

    /**
     * @Route("/phone_number_bundle", name="bundle_phone_number")
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response
     */
    public function phoneNumberAction(Request $request)
    {
        $contactExist = $this->getDoctrine()->getRepository("AppBundle:Contact")->findOneBy([]);
        $contact = $contactExist !== null ? $contactExist : new Contact();

        $form = $this->createForm(ContactType::class, $contact);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($contact);
            $em->flush();
            $this->addFlash("success", "Contact <b>{$contact->getId()}</b> créé avec succès.");

            return $this->redirectToRoute('bundle_phone_number');
        }
        $this->generateBreadcrumbs()->addItem('menu_phone_number');
        return $this->render('bundle/misd-service-development/phone_number_bundle.html.twig', [
            'form' => $form->createView(),
            'contact' => $contact,
            'bundle' => 'misd-service-development/phone-number-bundle'
        ]);
    }

    /**
     * @Route("/interactive_svg_bundle", name="bundle_interactive_svg")
     */
    public function InteractiveSVGAction()
    {
        $this->generateBreadcrumbs()->addItem('menu_interactive_svg');
        return $this->render('bundle/artgris/interactive_svg_bundle.html.twig', [
            'bundle' => 'artgris/InteractiveSVGBundle'
        ]);

    }

    /**
     * @return object|\WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs
     */
    private function generateBreadcrumbs()
    {
        return $this->get("breadcrumbs")->generate('menu_bundles', 'bundle');
    }
}


text:
import { XE, XmlError } from "xml-core";
import * as XmlCore from "xml-core";

import { IHashAlgorithm, ISignatureAlgorithm } from "./algorithm";
import { PssAlgorithmParams } from "./xml/key_infos";
import { SignatureMethod } from "./xml/signature_method";

// rsa pkcs1
import {
    RSA_PKCS1,
    RSA_PKCS1_SHA1_NAMESPACE, RSA_PKCS1_SHA256_NAMESPACE, RSA_PKCS1_SHA384_NAMESPACE, RSA_PKCS1_SHA512_NAMESPACE,
    RsaPkcs1Sha1, RsaPkcs1Sha256, RsaPkcs1Sha384, RsaPkcs1Sha512,
} from "./algorithms";
// rsa pss without params
import {
    RSA_PSS,
    RSA_PSS_SHA1_NAMESPACE, RSA_PSS_SHA256_NAMESPACE, RSA_PSS_SHA384_NAMESPACE, RSA_PSS_SHA512_NAMESPACE,
    RsaPssWithoutParamsSha1, RsaPssWithoutParamsSha256, RsaPssWithoutParamsSha384, RsaPssWithoutParamsSha512,
} from "./algorithms";
// rsa pss with params
import {
    RSA_PSS_WITH_PARAMS_NAMESPACE,
    RsaPssSha1, RsaPssSha256, RsaPssSha384, RsaPssSha512,
} from "./algorithms";
// ec dsa
import {
    ECDSA,
    ECDSA_SHA1_NAMESPACE, ECDSA_SHA256_NAMESPACE, ECDSA_SHA384_NAMESPACE, ECDSA_SHA512_NAMESPACE,
    EcdsaSha1, EcdsaSha256, EcdsaSha384, EcdsaSha512,
} from "./algorithms";
// hmac
import {
    HMAC,
    HMAC_SHA1_NAMESPACE, HMAC_SHA256_NAMESPACE, HMAC_SHA384_NAMESPACE, HMAC_SHA512_NAMESPACE,
    HmacSha1, HmacSha256, HmacSha384, HmacSha512,
} from "./algorithms";
// Sha
import {
    SHA1, Sha1, SHA1_NAMESPACE, SHA256,
    Sha256, SHA256_NAMESPACE, SHA384, Sha384,
    SHA384_NAMESPACE, SHA512, Sha512, SHA512_NAMESPACE,
} from "./algorithms";

import { HashAlgorithm, IHashAlgorithmConstructable, ISignatureAlgorithmConstructable, SignatureAlgorithm } from "./algorithm";
import { Transform, XmlSignature } from "./xml";
import {
    XmlDsigBase64Transform,
    XmlDsigC14NTransform,
    XmlDsigC14NWithCommentsTransform,
    XmlDsigEnvelopedSignatureTransform,
    XmlDsigExcC14NTransform,
    XmlDsigExcC14NWithCommentsTransform,
} from "./xml/transforms";

const SignatureAlgorithms: { [index: string]: ISignatureAlgorithmConstructable } = {};
SignatureAlgorithms[RSA_PKCS1_SHA1_NAMESPACE] = RsaPkcs1Sha1;
SignatureAlgorithms[RSA_PKCS1_SHA256_NAMESPACE] = RsaPkcs1Sha256;
SignatureAlgorithms[RSA_PKCS1_SHA384_NAMESPACE] = RsaPkcs1Sha384;
SignatureAlgorithms[RSA_PKCS1_SHA512_NAMESPACE] = RsaPkcs1Sha512;
SignatureAlgorithms[ECDSA_SHA1_NAMESPACE] = EcdsaSha1;
SignatureAlgorithms[ECDSA_SHA256_NAMESPACE] = EcdsaSha256;
SignatureAlgorithms[ECDSA_SHA384_NAMESPACE] = EcdsaSha384;
SignatureAlgorithms[ECDSA_SHA512_NAMESPACE] = EcdsaSha512;
SignatureAlgorithms[HMAC_SHA1_NAMESPACE] = HmacSha1;
SignatureAlgorithms[HMAC_SHA256_NAMESPACE] = HmacSha256;
SignatureAlgorithms[HMAC_SHA384_NAMESPACE] = HmacSha384;
SignatureAlgorithms[HMAC_SHA512_NAMESPACE] = HmacSha512;
SignatureAlgorithms[RSA_PSS_SHA1_NAMESPACE] = RsaPssWithoutParamsSha1;
SignatureAlgorithms[RSA_PSS_SHA256_NAMESPACE] = RsaPssWithoutParamsSha256;
SignatureAlgorithms[RSA_PSS_SHA384_NAMESPACE] = RsaPssWithoutParamsSha384;
SignatureAlgorithms[RSA_PSS_SHA512_NAMESPACE] = RsaPssWithoutParamsSha512;

const HashAlgorithms: { [namespace: string]: IHashAlgorithmConstructable } = {};
HashAlgorithms[SHA1_NAMESPACE] = Sha1;
HashAlgorithms[SHA256_NAMESPACE] = Sha256;
HashAlgorithms[SHA384_NAMESPACE] = Sha384;
HashAlgorithms[SHA512_NAMESPACE] = Sha512;

export class CryptoConfig {
    /**
     * Creates Transform from given name
     * if name is not exist then throws error
     *
     * @static
     * @param {(string |)} [name=null]
     * @returns
     *
     * @memberOf CryptoConfig
     */
    public static CreateFromName(name: string | null): Transform {
        let transform: Transform;
        switch (name) {
            case XmlSignature.AlgorithmNamespaces.XmlDsigBase64Transform:
                transform = new XmlDsigBase64Transform();
                break;
            case XmlSignature.AlgorithmNamespaces.XmlDsigC14NTransform:
                transform = new XmlDsigC14NTransform();
                break;
            case XmlSignature.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:
                transform = new XmlDsigC14NWithCommentsTransform();
                break;
            case XmlSignature.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:
                transform = new XmlDsigEnvelopedSignatureTransform();
                break;
            case XmlSignature.AlgorithmNamespaces.XmlDsigXPathTransform:
                throw new XmlError(XE.ALGORITHM_NOT_SUPPORTED, name);
            // t = new XmlDsigXPathTransform();
            // break;
            case XmlSignature.AlgorithmNamespaces.XmlDsigXsltTransform:
                throw new XmlError(XE.ALGORITHM_NOT_SUPPORTED, name);
            // t = new XmlDsigXsltTransform();
            // break;
            case XmlSignature.AlgorithmNamespaces.XmlDsigExcC14NTransform:
                transform = new XmlDsigExcC14NTransform();
                break;
            case XmlSignature.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:
                transform = new XmlDsigExcC14NWithCommentsTransform();
                break;
            case XmlSignature.AlgorithmNamespaces.XmlDecryptionTransform:
                throw new XmlError(XE.ALGORITHM_NOT_SUPPORTED, name);
            // t = new XmlDecryptionTransform();
            // break;
            default:
                throw new XmlError(XE.ALGORITHM_NOT_SUPPORTED, name);
        }
        return transform;
    }

    public static CreateSignatureAlgorithm(method: SignatureMethod): SignatureAlgorithm {
        const alg = SignatureAlgorithms[method.Algorithm] || null;
        if (alg) {
            return new alg();
        } else if (method.Algorithm === RSA_PSS_WITH_PARAMS_NAMESPACE) {
            let pssParams: PssAlgorithmParams | undefined;
            method.Any.Some((item) => {
                if (item instanceof PssAlgorithmParams) {
                    pssParams = item;
                }
                return !!pssParams;
            });
            if (pssParams) {
                switch (pssParams.DigestMethod.Algorithm) {
                    case SHA1_NAMESPACE:
                        return new RsaPssSha1(pssParams.SaltLength);
                    case SHA256_NAMESPACE:
                        return new RsaPssSha256(pssParams.SaltLength);
                    case SHA384_NAMESPACE:
                        return new RsaPssSha384(pssParams.SaltLength);
                    case SHA512_NAMESPACE:
                        return new RsaPssSha512(pssParams.SaltLength);
                }
            }
            throw new XmlError(XE.CRYPTOGRAPHIC, `Cannot get params for RSA-PSS algoriithm`);
        }
        throw new Error(`signature algorithm '${method.Algorithm}' is not supported`);
    }

    public static CreateHashAlgorithm(namespace: string): HashAlgorithm {
        const alg = HashAlgorithms[namespace];
        if (alg) {
            return new alg();
        } else {
            throw new Error("hash algorithm '" + namespace + "' is not supported");
        }
    }

    public static GetHashAlgorithm(algorithm: AlgorithmIdentifier): IHashAlgorithm {
        const alg = typeof algorithm === "string" ? { name: algorithm } : algorithm;
        switch (alg.name.toUpperCase()) {
            case SHA1:
                return new Sha1();
            case SHA256:
                return new Sha256();
            case SHA384:
                return new Sha384();
            case SHA512:
                return new Sha512();
            default:
                throw new XmlCore.XmlError(XmlCore.XE.ALGORITHM_NOT_SUPPORTED, alg.name);
        }
    }

    public static GetSignatureAlgorithm(algorithm: Algorithm): ISignatureAlgorithm {
        if (typeof (algorithm as any).hash === "string") {
            (algorithm as any).hash = {
                name: (algorithm as any).hash,
            };
        }
        const hashName: string = (algorithm as any).hash.name;
        if (!hashName) {
            throw new Error("Signing algorithm doesn't have name for hash");
        }
        let alg: ISignatureAlgorithm;
        switch (algorithm.name.toUpperCase()) {
            case RSA_PKCS1.toUpperCase():
                switch (hashName.toUpperCase()) {
                    case SHA1:
                        alg = new RsaPkcs1Sha1();
                        break;
                    case SHA256:
                        alg = new RsaPkcs1Sha256();
                        break;
                    case SHA384:
                        alg = new RsaPkcs1Sha384();
                        break;
                    case SHA512:
                        alg = new RsaPkcs1Sha512();
                        break;
                    default:
                        throw new XmlCore.XmlError(XmlCore.XE.ALGORITHM_NOT_SUPPORTED, `${algorithm.name}:${hashName}`);
                }
                break;
            case RSA_PSS.toUpperCase():
                const saltLength = (algorithm as any).saltLength;
                switch (hashName.toUpperCase()) {
                    case SHA1:
                        alg = saltLength ? new RsaPssSha1(saltLength) : new RsaPssWithoutParamsSha1();
                        break;
                    case SHA256:
                        alg = saltLength ? new RsaPssSha256(saltLength) : new RsaPssWithoutParamsSha256();
                        break;
                    case SHA384:
                        alg = saltLength ? new RsaPssSha384(saltLength) : new RsaPssWithoutParamsSha384();
                        break;
                    case SHA512:
                        alg = saltLength ? new RsaPssSha512(saltLength) : new RsaPssWithoutParamsSha512();
                        break;
                    default:
                        throw new XmlCore.XmlError(XmlCore.XE.ALGORITHM_NOT_SUPPORTED, `${algorithm.name}:${hashName}`);
                }
                (algorithm as RsaPssParams).saltLength = (alg.algorithm as RsaPssParams).saltLength;
                break;
            case ECDSA:
                switch (hashName.toUpperCase()) {
                    case SHA1:
                        alg = new EcdsaSha1();
                        break;
                    case SHA256:
                        alg = new EcdsaSha256();
                        break;
                    case SHA384:
                        alg = new EcdsaSha384();
                        break;
                    case SHA512:
                        alg = new EcdsaSha512();
                        break;
                    default:
                        throw new XmlCore.XmlError(XmlCore.XE.ALGORITHM_NOT_SUPPORTED, `${algorithm.name}:${hashName}`);
                }
                break;
            case HMAC:
                switch (hashName.toUpperCase()) {
                    case SHA1:
                        alg = new HmacSha1();
                        break;
                    case SHA256:
                        alg = new HmacSha256();
                        break;
                    case SHA384:
                        alg = new HmacSha384();
                        break;
                    case SHA512:
                        alg = new HmacSha512();
                        break;
                    default:
                        throw new XmlCore.XmlError(XmlCore.XE.ALGORITHM_NOT_SUPPORTED, `${algorithm.name}:${hashName}`);
                }
                break;
            default:
                throw new XmlCore.XmlError(XmlCore.XE.ALGORITHM_NOT_SUPPORTED, algorithm.name);
        }
        return alg;
    }
}


text:
function [sp, p, noise_var] = mle_sto_uc_1d(R, n, design, wavelength, x0, varargin)
%MLE_STO_UC_1D Maximum-likelihood estimator for the stochastic model with
%uncorrelated source assumption. The estimates are obtained by solving the
%following optimization problem:
%   min_{\theta, p, \sigma} logdet(S) + tr(S^{-1} R)
%   s.t. S = A(\theta) diag(p) A(\theta)^H + \sigma I,
%        -pi/2 <= \theta <= pi/2,
%        p, \sigma >= 0.
%This optimization problem is solved by MATLAB's built-in function
%`fmincon`. It is adviced to provide a good initial guess to obtain good
%results.
%Syntax:
%   sp = MLE_STO_UC_1D(R, n, design, wavelength, [x_0, ...]);
%   sp = MLE_STO_UC_1D(R, n, f_steering, [], [x_0, ...]);
%   [sp, p, noise_var] = MLE_STO_UC_1D(R, n, design, wavelength, [x_0, ...]);
%   [sp, p, noise_var] = MLE_STO_UC_1D(R, n, f_steering, [], [x_0, ...]);
%Inputs:
%   R - Sample covariance matrix.
%   n - Number of sources.
%   design - Array design. Can also be a function handle that generates
%            a steering matrix. This function must take two arguments,
%            wavelength and the doa vector.
%   wavelength - Wavelength.
%   x_0 - (Optional) an (2n+1)x1 vector storing the initial guess in the
%         following order: [doas; p; noise_var]. If absent, an initial
%         guess will be obtained using the MVDR beamformer.
%   ... - Options:
%       'Unit' - Can be 'radian', 'degree', or 'sin'. Default value is
%                'radian'.
%       'Verbose' - If set to true, will display detailed solver
%                   outputs.
%Output:
%   sp - Spectrum structure with the following fields:
%           x - An 1 x grid_size vector.
%           y - An 1 x grid_size vector. Calling `plot(x, y)` will plot the
%               spectrum.
%           x_est - An 1 x n vector storing the estimated DOAs.
%           x_unit - The same as the unit specified by 'Unit'.
%           resolved - Constant value true.
%           discrete - Constant value true.
%   p - An nx1 vector of estimated source powers.
%   noise_var - Estimated noise power.
if nargin < 5
    x0 = [];
else
    if length(x0) ~= 2*n + 1
        error('The vector of the initial guess has incorrect length.');
    end
end
unit = 'radian';
verbose = false;
for ii = 1:2:nargin - 5
    option_name = varargin{ii};
    option_value = varargin{ii + 1};
    switch lower(option_name)
        case 'unit'
            unit = option_value;
        case 'verbose'
            verbose = option_value;
        otherwise
            error('Unknown option ''%s''.', option_name);
    end
end
% prepare initial guess
if isempty(x0)
    % generate initial guess
    x0 = zeros(2*n + 1, 1);
    sp_mvdr = mvdr_1d(R, n, design, wavelength, 180);
    if sp_mvdr.resolved
        x0(1:n) = sp_mvdr.x_est;
    else
        warning('Failed to obtain a good initial guess.');
        % we just assume the doas is uniformly placed
        x0(1:n) = linspace(-pi/3, pi/3, n);
    end
    if ishandle(design)
        A = design(wavelength, x0(1:n));
    else
        A = steering_matrix(design, wavelength, x0(1:n));
    end
    B = [khatri_rao(conj(A), A) reshape(eye(size(A, 1)), [], 1)];
    z = real(B\R(:));
    z(z < 0) = 0;
    x0(n + 1:end) = z;
else
    x0 = x0(:);
    % Unify to radians.
    switch (unit)
        case 'degree'
            x0(1:n) = deg2rad(x0(1:n));
        case 'sin'
            x0(1:n) = asin(x0(1:n));
        case 'radian'
        otherwise
            error('Unexpected unit ''%s''.', unit);
    end
end
% prepare the optimization problem
if verbose
    options = optimoptions('fmincon', 'Display', 'iter');
else
    options = optimoptions('fmincon', 'Display', 'off');
end
lb = zeros(2*n + 1, 1);
lb(1:n) = -pi/2;
ub = inf(2*n + 1, 1);
ub(1:n) = pi/2;
% solve it
x_opt = fmincon(@(x) nll(R, design, wavelength, x(1:n)', x(n + 1:n + n), x(end)), ...
    x0, [], [], [], [], lb, ub, [], options);
doas = sort(x_opt(1:n));
p = x_opt(n + 1:n + n);
noise_var = x_opt(end);
switch (unit)
    case 'degree'
        doas = rad2deg(doas);
    case 'sin'
        doas = sin(doas);
    case 'radian'
    otherwise
        error('Unexpected unit ''%s''.', unit);
end
% store results
sp = struct();
sp.x_est = doas';
sp.x = sp.x_est;
sp.x_unit = unit;
sp.y = ones(1, n);
sp.resolved = true;
sp.discrete = true;
end

function obj = nll(R, design, wavelength, doas, p, noise_var)
% negative log-likelihood function.
if ishandle(design)
    A = design(wavelength, doas);
else
    A = steering_matrix(design, wavelength, doas);
end
S = A*bsxfun(@times, p, A') + eye(size(A, 1))*noise_var;
S = 0.5*(S + S');
[L,p] = chol(S);
if p > 0
    obj = inf;
    return;
end
logdetS = sum(log(diag(L)));
obj = logdetS + sum(real(diag(R/S)));
end


text:
package org.jetbrains.plugins.groovy.lang.completion;

import com.intellij.codeInsight.completion.InsertionContext;
import com.intellij.psi.*;
import com.intellij.psi.scope.BaseScopeProcessor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.dsl.GroovyDslFileIndex;
import org.jetbrains.plugins.groovy.lang.completion.closureParameters.ClosureDescriptor;
import org.jetbrains.plugins.groovy.lang.completion.closureParameters.ClosureParameterInfo;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrClosableBlock;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.GrReferenceResolveUtil;
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
import org.jetbrains.plugins.groovy.lang.psi.util.GroovyCommonClassNames;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Max Medvedev
 */
public class GdslClosureCompleter extends ClosureCompleter {
  @Override
  protected List<ClosureParameterInfo> getParameterInfos(InsertionContext context,
                                                         PsiMethod method,
                                                         PsiSubstitutor substitutor,
                                                         PsiElement place) {
    final ArrayList<ClosureDescriptor> descriptors = new ArrayList<ClosureDescriptor>();
    GrReferenceExpression ref = (GrReferenceExpression)place;
    PsiType qtype = GrReferenceResolveUtil.getQualifierType(ref);
    if (qtype == null) return null;

    GrExpression qualifier = ref.getQualifier();
    if (qualifier != null) {
      PsiType type = qualifier.getType();
      if (type == null) return null;
      processExecutors(qtype, ref, descriptors);
    }
    else {
      PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.getProject());
      for (PsiElement parent = ref.getParent(); parent != null; parent = parent.getParent()) {
        if (parent instanceof GrClosableBlock) {
          processExecutors(TypesUtil.createTypeByFQClassName(GroovyCommonClassNames.GROOVY_LANG_CLOSURE, ref), ref, descriptors);
        }
        else if (parent instanceof GrTypeDefinition) {
          processExecutors(factory.createType(((GrTypeDefinition)parent), PsiType.EMPTY_ARRAY), ref, descriptors);
        }
      }
    }

    for (ClosureDescriptor descriptor : descriptors) {
      if (descriptor.isMethodApplicable(method, ref)) {
        return descriptor.getParameters();
      }
    }
    return null;
  }

  private static void processExecutors(PsiType qtype, GrReferenceExpression ref, final ArrayList<ClosureDescriptor> descriptors) {
    GroovyDslFileIndex.processExecutors(qtype, ref, new BaseScopeProcessor() {
      @Override
      public boolean execute(@NotNull PsiElement element, ResolveState state) {
        if (element instanceof ClosureDescriptor) {
          descriptors.add((ClosureDescriptor)element);
        }
        return true;
      }
    }, ResolveState.initial());
  }
}