text:
package org.fastser.web.message;

import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * @author wj.ye
 */
public class Messages {

    private static final String BUNDLE_NAME = "org/fastser/web/message/messages";

    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);

    private Messages() {
    }

    public static String getString(String key) {
        try {
            return RESOURCE_BUNDLE.getString(key);
        } catch (MissingResourceException e) {
            return '!' + key + '!';
        }
    }

    public static String getString(String key, String parm1) {
        try {
            return MessageFormat.format(RESOURCE_BUNDLE.getString(key),
                    new Object[] { parm1 });
        } catch (MissingResourceException e) {
            return '!' + key + '!';
        }
    }

    public static String getString(String key, String parm1, String parm2) {
        try {
            return MessageFormat.format(RESOURCE_BUNDLE.getString(key),
                    new Object[] { parm1, parm2 });
        } catch (MissingResourceException e) {
            return '!' + key + '!';
        }
    }

    public static String getString(String key, String parm1, String parm2,
            String parm3) {
        try {
            return MessageFormat.format(RESOURCE_BUNDLE.getString(key),
                    new Object[] { parm1, parm2, parm3 });
        } catch (MissingResourceException e) {
            return '!' + key + '!';
        }
    }

    public static String getString(String key, String parm1, String parm2,
            String parm3, String parm4) {
        try {
            return MessageFormat.format(RESOURCE_BUNDLE.getString(key),
                    new Object[] { parm1, parm2, parm3, parm4 });
        } catch (MissingResourceException e) {
            return '!' + key + '!';
        }
    }
}


text:
class AddCategoryToExercise < ActiveRecord::Migration[5.0]
  def change
    add_reference :exercises, :category, foreign_key: true
  end
end

redpajama_set_name: RedPajamaGithub


text:
namespace _03.BigFactorial
{
    using System;
    using System.Numerics;

    public class BigFactorial
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            BigInteger factorial = 1;
            for (int i = 1; i <= n; i++)
            {
                factorial = i * factorial;
            }
            Console.WriteLine(factorial);
        }
    }
}


text:
#ifndef HB_OT_SHAPE_HH
#define HB_OT_SHAPE_HH

#include "hb.hh"

#include "hb-ot-map.hh"
#include "hb-aat-map.hh"

struct hb_ot_shape_plan_key_t
{
  unsigned int variations_index[2];

  void init (hb_face_t *face,
	     const int *coords,
	     unsigned   num_coords)
  {
    for (unsigned int table_index = 0; table_index < 2; table_index++)
      hb_ot_layout_table_find_feature_variations (face,
						  table_tags[table_index],
						  coords,
						  num_coords,
						  &variations_index[table_index]);
  }

  bool equal (const hb_ot_shape_plan_key_t *other)
  {
    return 0 == memcmp (this, other, sizeof (*this));
  }
};

struct hb_shape_plan_key_t;

struct hb_ot_shape_plan_t
{
  hb_segment_properties_t props;
  const struct hb_ot_complex_shaper_t *shaper;
  hb_ot_map_t map;
  hb_aat_map_t aat_map;
  const void *data;
#ifndef HB_NO_OT_SHAPE_FRACTIONS
  hb_mask_t frac_mask, numr_mask, dnom_mask;
#else
  static constexpr hb_mask_t frac_mask = 0;
  static constexpr hb_mask_t numr_mask = 0;
  static constexpr hb_mask_t dnom_mask = 0;
#endif
  hb_mask_t rtlm_mask;
#ifndef HB_NO_OT_KERN
  hb_mask_t kern_mask;
#else
  static constexpr hb_mask_t kern_mask = 0;
#endif
#ifndef HB_NO_AAT_SHAPE
  hb_mask_t trak_mask;
#else
  static constexpr hb_mask_t trak_mask = 0;
#endif

#ifndef HB_NO_OT_KERN
  bool requested_kerning : 1;
#else
  static constexpr bool requested_kerning = false;
#endif
#ifndef HB_NO_AAT_SHAPE
  bool requested_tracking : 1;
#else
  static constexpr bool requested_tracking = false;
#endif
#ifndef HB_NO_OT_SHAPE_FRACTIONS
  bool has_frac : 1;
#else
  static constexpr bool has_frac = false;
#endif
  bool has_vert : 1;
  bool has_gpos_mark : 1;
  bool zero_marks : 1;
  bool fallback_glyph_classes : 1;
  bool fallback_mark_positioning : 1;
  bool adjust_mark_positioning_when_zeroing : 1;

  bool apply_gpos : 1;
#ifndef HB_NO_OT_KERN
  bool apply_kern : 1;
#else
  static constexpr bool apply_kern = false;
#endif
#ifndef HB_NO_AAT_SHAPE
  bool apply_kerx : 1;
  bool apply_morx : 1;
  bool apply_trak : 1;
#else
  static constexpr bool apply_kerx = false;
  static constexpr bool apply_morx = false;
  static constexpr bool apply_trak = false;
#endif

  void collect_lookups (hb_tag_t table_tag, hb_set_t *lookups) const
  {
    unsigned int table_index;
    switch (table_tag) {
      case HB_OT_TAG_GSUB: table_index = 0; break;
      case HB_OT_TAG_GPOS: table_index = 1; break;
      default: return;
    }
    map.collect_lookups (table_index, lookups);
  }

  HB_INTERNAL bool init0 (hb_face_t                     *face,
			  const hb_shape_plan_key_t     *key);
  HB_INTERNAL void fini ();

  HB_INTERNAL void substitute (hb_font_t *font, hb_buffer_t *buffer) const;
  HB_INTERNAL void position (hb_font_t *font, hb_buffer_t *buffer) const;
};

struct hb_shape_plan_t;

struct hb_ot_shape_planner_t
{
  /* In the order that they are filled in. */
  hb_face_t *face;
  hb_segment_properties_t props;
  hb_ot_map_builder_t map;
  hb_aat_map_builder_t aat_map;
#ifndef HB_NO_AAT_SHAPE
  bool apply_morx : 1;
#else
  static constexpr bool apply_morx = false;
#endif
  bool script_zero_marks : 1;
  bool script_fallback_mark_positioning : 1;
  const struct hb_ot_complex_shaper_t *shaper;

  HB_INTERNAL hb_ot_shape_planner_t (hb_face_t                     *face,
				     const hb_segment_properties_t *props);

  HB_INTERNAL void compile (hb_ot_shape_plan_t           &plan,
			    const hb_ot_shape_plan_key_t &key);
};

#endif /* HB_OT_SHAPE_HH */


text:
<?php

namespace Imhonet\Connection\DataFormat\Arr\Elastic;

use GuzzleHttp\Ring\Future\CompletedFutureArray;

class SearchTest extends \PHPUnit_Framework_TestCase
{
    private $ids = [12345, 1545, 1123];

    /**
     * @var Search
     */
    private $formater;

    protected function setUp()
    {
        $this->formater = new Search();
    }

    public function testCreate()
    {
        $this->assertInstanceOf('Imhonet\Connection\DataFormat\IArr', $this->formater);
    }

    public function testData()
    {
        $this->formater->setData($this->getData());
        $this->assertEquals($this->ids, $this->formater->formatData());
    }

    public function testValue()
    {
        $this->formater->setData($this->getData());
        $this->assertNull($this->formater->formatValue());
    }

    public function testFailure()
    {
        assert_options(ASSERT_WARNING, 0);

        $this->formater->setData(null);
        $this->assertEquals(array(), $this->formater->formatData());
    }

    public function getData()
    {
        $result = array(
            'total' => sizeof($this->ids),
            'hits' => array(),
        );

        foreach ($this->ids as $id) {
            $result['hits'][] = array('_id' => $id);
        }

        return [new CompletedFutureArray(array('hits' => $result))];
    }

    protected function tearDown()
    {
        $this->formater = null;
    }
}


text:
<?php

final class ArcanistInlinesWorkflow extends ArcanistWorkflow {

  public function getWorkflowName() {
    return 'inlines';
  }

  public function getCommandSynopses() {
    return phutil_console_format(<<<EOTEXT
      **inlines** [--revision __revision_id__]
EOTEXT
      );
  }

  public function getCommandHelp() {
    return phutil_console_format(<<<EOTEXT
          Display inline comments related to a particular revision.
EOTEXT
      );
  }

  public function getArguments() {
    return array(
      'revision' => array(
        'param' => 'revision_id',
        'help' =>
          'Display inline comments for a specific revision. If you do not '.
          'specify a revision, arc will look in the commit message at HEAD.',
      ),
      'root' => array(
        'param' => 'directory',
        'help' => 'Specify a string printed in front of each path.',
      ),
    );
  }

  public function requiresConduit() {
    return true;
  }

  public function requiresAuthentication() {
    return true;
  }

  public function requiresRepositoryAPI() {
    return true;
  }

  public function run() {
    if ($this->getArgument('revision')) {
      $revision_id = $this->normalizeRevisionID($this->getArgument('revision'));
    } else {
      $revisions = $this->getRepositoryAPI()
        ->loadWorkingCopyDifferentialRevisions($this->getConduit(), array());
      $revision_id = head(ipull($revisions, 'id'));
    }

    if (!$revision_id) {
      throw new ArcanistUsageException('No revisions found.');
    }

    $comments = array_mergev(
      $this->getConduit()->callMethodSynchronous(
        'differential.getrevisioncomments',
        array(
          'ids' => array($revision_id),
          'inlines' => true,
        )));

    $authors = array();
    if ($comments) {
      $authors = $this->getConduit()->callMethodSynchronous(
        'user.query',
        array(
          'phids' => array_unique(ipull($comments, 'authorPHID')),
        ));
      $authors = ipull($authors, 'userName', 'phid');
    }

    $inlines = array();
    foreach ($comments as $comment) {
      $author = idx($authors, $comment['authorPHID']);
      foreach ($comment['inlines'] as $inline) {
        $file = $inline['filePath'];
        $line = $inline['lineNumber'];
        $inlines[$file][$line][] = "({$author}) {$inline['content']}";
      }
    }

    $root = $this->getArgument('root');
    ksort($inlines);
    foreach ($inlines as $file => $file_inlines) {
      ksort($file_inlines);
      foreach ($file_inlines as $line => $line_inlines) {
        foreach ($line_inlines as $content) {
          echo "{$root}{$file}:{$line}:{$content}\n";
        }
      }
    }
  }

}


text:
package jarta.thoughtservice

import com.twitter.finatra.thrift.Controller
import jarta.converters.TwitterConverters._
import jarta.thoughtservice.model.ThoughtRepository
import jarta.thoughtservice.thriftscala.ThoughtService.{BaseServiceIface, DeleteThought, GetThought, InsertThought}

class ThoughtService(repository: ThoughtRepository) extends Controller with BaseServiceIface {

  override val insertThought = handle(InsertThought) { args: InsertThought.Args =>
    repository.insert(args.thought).toTwitterFuture
  }

  override val getThought = handle(GetThought) { args: GetThought.Args =>
    repository.select(args.id).toTwitterFuture.map(_.orNull)
  }

  override val deleteThought = handle(DeleteThought) { args: DeleteThought.Args =>
    repository.delete(args.id).toTwitterFuture.map(_ => Unit)
  }

}


text:
module Compass
  module Installers

    class Base

      include Actions

      attr_accessor :template_path, :target_path, :working_path
      attr_accessor :options

      def initialize(template_path, target_path, options = {})
        @template_path = template_path
        @target_path = target_path
        @working_path = Dir.getwd
        @options = options
        self.logger = options[:logger]
      end

      [:css_dir, :sass_dir, :images_dir, :javascripts_dir, :http_stylesheets_path, :fonts_dir, :preferred_syntax].each do |dir|
        define_method dir do
          Compass.configuration.send(dir)
        end
        define_method "#{dir}_without_default" do
          Compass.configuration.send("#{dir}_without_default")
        end
      end

      # Runs the installer.
      # Every installer must conform to the installation strategy of prepare, install, and then finalize.
      # A default implementation is provided for each step.
      def run(run_options = {})
        prepare unless run_options[:skip_preparation]
        install unless options[:prepare]
        finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization]
      end

      # The default prepare method -- it is a no-op.
      # Generally you would create required directories, etc.
      def prepare
      end

      # The install method override this to install
      def install
        raise "Not Yet Implemented"
      end

      # The default finalize method -- it is a no-op.
      # This could print out a message or something.
      def finalize(options = {})
      end

      def compilation_required?
        false
      end

      def pattern_name_as_dir
        "#{options[:pattern_name]}/" if options[:pattern_name]
      end

      def self.installer(type, installer_opts = {}, &locator)
        locator ||= lambda{|to| to}
        loc_method = "install_location_for_#{type}".to_sym
        define_method("simple_#{loc_method}", locator)
        define_method(loc_method) do |to, options|
          if options[:like] && options[:like] != type
            send("install_location_for_#{options[:like]}", to, options)
          else
            send("simple_#{loc_method}", to)
          end
        end
        define_method "install_#{type}" do |from, to, options|
          from = templatize(from)
          to = targetize(send(loc_method, to, options))
          is_binary = installer_opts[:binary] || options[:binary]
          if is_binary
            copy from, to, nil, is_binary
          else
            contents = File.new(from).read
            if options.delete(:erb)
              ctx = TemplateContext.ctx(:to => to, :options => options)
              contents = process_erb(contents, ctx)
            end
            write_file to, contents
          end
        end
      end

      installer :stylesheet do |to|
        "#{sass_dir}/#{pattern_name_as_dir}#{to}"
      end

      def install_stylesheet(from, to, options)
        from = templatize(from)
        to = targetize(install_location_for_stylesheet(to, options))
        contents = File.new(from).read
        if options.delete(:erb)
          ctx = TemplateContext.ctx(:to => to, :options => options)
          contents = process_erb(contents, ctx)
        end
        if preferred_syntax.to_s != from[-4..-1]
          # logger.record :convert, basename(from)
          tree = Sass::Engine.new(contents, Compass.sass_engine_options.merge(:syntax => from[-4..-1].intern)).to_tree
          contents = tree.send("to_#{preferred_syntax}")
          to[-4..-1] = preferred_syntax.to_s
        end
        write_file to, contents
      end

      installer :css do |to|
        "#{css_dir}/#{to}"
      end

      installer :image, :binary => true do |to|
        "#{images_dir}/#{to}"
      end

      installer :javascript do |to|
        "#{javascripts_dir}/#{to}"
      end

      installer :font do |to|
        "#{fonts_dir}/#{to}"
      end

      installer :file do |to|
        "#{pattern_name_as_dir}#{to}"
      end

      installer :html do |to|
        "#{pattern_name_as_dir}#{to}"
      end

      def install_directory(from, to, options)
        d = if within = options[:within]
          if respond_to?(within)
            targetize("#{send(within)}/#{to}")
          else
            raise Compass::Error, "Unrecognized location: #{within}"
          end
        else
          targetize(to)
        end
        directory d
      end

      alias install_html_without_haml install_html
      def install_html(from, to, options)
        if to =~ /\.haml$/
          require 'haml'
          to = to[0..-(".haml".length+1)]
          if respond_to?(:install_location_for_html)
            to = install_location_for_html(to, options)
          end
          contents = File.read(templatize(from))
          if options.delete(:erb)
            ctx = TemplateContext.ctx(:to => to, :options => options)
            contents = process_erb(contents, ctx)
          end
          Compass.configure_sass_plugin!
          html = Haml::Engine.new(contents, :filename => templatize(from)).render
          write_file(targetize(to), html, options)
        else
          install_html_without_haml(from, to, options)
        end
      end

      # returns an absolute path given a path relative to the current installation target.
      # Paths can use unix style "/" and will be corrected for the current platform.
      def targetize(path)
        strip_trailing_separator File.join(target_path, separate(path))
      end

      # returns an absolute path given a path relative to the current template.
      # Paths can use unix style "/" and will be corrected for the current platform.
      def templatize(path)
        strip_trailing_separator File.join(template_path, separate(path))
      end

      # Emits an HTML fragment that can be used to link to the compiled css files
      def stylesheet_links
        ""
      end
    end
  end
end
require 'compass/installers/bare_installer'
require 'compass/installers/manifest_installer'


text:
category ComponentObjectModel:

interface IUnknown
{
    HRESULT QueryInterface(
        [IID] REFIID iid,
        [out] COM_INTERFACE_PTR* ppvObject );

    ULONG AddRef();
    ULONG Release();
};

typedef IUnknown* LPUNKNOWN;

interface IClassFactory : IUnknown
{
    HRESULT CreateInstance(
        IUnknown * pUnkOuter,
        [IID] REFIID riid,
        [out] COM_INTERFACE_PTR* ppvObject );

    HRESULT LockServer( BOOL fLock );
};

interface IDispatch : IUnknown
{
    HRESULT GetTypeInfoCount( UINT pctinfo  );

    HRESULT GetTypeInfo(
        UINT iTInfo,
        LCID lcid,
        LPVOID ppTInfo );

    HRESULT GetIDsOfNames(
        REFIID riid,
        LPOLECHAR* rgszNames,
        UINT cNames,
        LCID lcid,
        [out] DISPID* rgDispId );

    HRESULT Invoke(
        DISPID  dispIdMember,
        REFIID  riid,
        LCID  lcid,
        WORD  wFlags,
        DISPPARAMS*  pDispParams,
        VARIANT*  pVarResult,
        EXCEPINFO*  pExcepInfo,
        UINT*  puArgErr );
};

interface IPersist : IUnknown
{
    HRESULT GetClassID(
        [out] CLSID *pClassID  //Pointer to CLSID of object
    );
};

interface IPersistFile : IPersist
{
    HRESULT IsDirty();

    HRESULT Load(
      LPCOLESTR pszFileName,
                    //Pointer to absolute path of the file to open
      DWORD dwMode  //Specifies the access mode from the STGM enumeration
    );

    HRESULT Save(
      LPCOLESTR pszFileName,   //Pointer to absolute path of the file
                               //where the object is saved
      BOOL fRemember           //Specifies whether the file is to be the
                               //current working file or not
    );

    HRESULT SaveCompleted(
      LPCOLESTR pszFileName  //Pointer to absolute path of the file
                             //where the object was saved
    );

    HRESULT GetCurFile(
      LPOLESTR *ppszFileName  //Pointer to the path for the current file
                              //or the default save prompt
    );
};

typedef VOID            DVTARGETDEVICE;
typedef LPVOID          CONTINUEPROC;
typedef LPVOID          IAdviseSink;

interface IViewObject : IUnknown
{

    HRESULT Draw
    (
        [in] DWORD dwDrawAspect,
        [in] LONG lindex,
        [in] void * pvAspect,
        [in] DVTARGETDEVICE *ptd,
        [in] HDC hdcTargetDev,
        [in] HDC hdcDraw,
        [in] LPCRECTL lprcBounds,
        [in] LPCRECTL lprcWBounds,
        [in] CONTINUEPROC ContinueProc,
        [in] ULONG_PTR dwContinue
    );

    HRESULT GetColorSet
    (
        [in] DWORD dwDrawAspect,
        [in] LONG lindex,
        [in] void *pvAspect,
        [in] DVTARGETDEVICE *ptd,
        [in] HDC hicTargetDev,
        [out] LOGPALETTE **ppColorSet
    );

    HRESULT Freeze
    (
        [in] DWORD dwDrawAspect,
        [in] LONG lindex,
        [in] void *pvAspect,
        [out] DWORD *pdwFreeze
    );

    HRESULT Unfreeze
    (
        [in] DWORD dwFreeze
    );

    HRESULT SetAdvise
    (
        [in] DWORD aspects,
        [in] DWORD advf,
        [in] IAdviseSink *pAdvSink
    );

    HRESULT GetAdvise
    (
        [out] DWORD *pAspects,
        [out] DWORD *pAdvf,
        [out] IAdviseSink **ppAdvSink
    );
};

interface IViewObject2 : IViewObject
{
    HRESULT GetExtent
    (
        [in]  DWORD dwDrawAspect,
        [in]  LONG lindex,
        [in]  DVTARGETDEVICE* ptd,
        [out] LPSIZEL lpsizel
    );
};

typedef struct tagExtentInfo {
    ULONG   cb;
    DWORD   dwExtentMode;
    SIZEL   sizelProposed;
} DVEXTENTINFO;

interface IViewObjectEx : IViewObject2
{

    HRESULT GetRect(
                [in] DWORD dwAspect,
                [out] LPRECTL pRect
            );

    HRESULT GetViewStatus(
                [out] DWORD * pdwStatus
            );

    HRESULT QueryHitPoint(
                [in] DWORD dwAspect,
                [in] LPCRECT pRectBounds,
                [in] POINT ptlLoc,
                [in] LONG lCloseHint,
                [out] DWORD * pHitResult
            );

    HRESULT QueryHitRect(
                [in] DWORD dwAspect,
                [in] LPCRECT pRectBounds,
                [in] LPCRECT pRectLoc,
                [in] LONG lCloseHint,
                [out] DWORD * pHitResult
            );

    HRESULT GetNaturalExtent (
                [in] DWORD dwAspect,
                [in] LONG lindex,
                [in] DVTARGETDEVICE * ptd,
                [in] HDC hicTargetDev,
                [in] DVEXTENTINFO * pExtentInfo,
                [out] LPSIZEL pSizel
            );
};

// We can't log IMalloc because it is a global object.
// It causes recursion problems in LogProcessHook because
// StringFromCLSID uses the global interface.
/*
interface IMalloc : IUnknown
{
    PVOID   Alloc( SIZE_T cb );

    PVOID   Realloc(
        PVOID pv,
        SIZE_T cb );

    VOID    Free( PVOID pv);

    SIZE_T  GetSize( PVOID pv );

    int     DidAlloc( PVOID pv );

    VOID    HeapMinimize();

};
*/


text:
"""
Gaia photometry tools.

This package provides classes and functions for transforming between the Gaia
photometric system and other photometric systems. The formulae and tables are
taken from the `Gaia science performance pages
<https://www.cosmos.esa.int/web/gaia/science-performance>`_ and from the
paper by `Jordi et al <http://adsabs.harvard.edu/abs/2010A%26A...523A..48J>`_.
"""

from . import transformations
from . import utils


text:
Lol, you probably want libbsd instead of this.

[![Build Status](https://travis-ci.org/cemeyer/linux-sys-tree.png?branch=master)](https://travis-ci.org/cemeyer/linux-sys-tree)

This is just a direct import of sys/tree.h and documentation from FreeBSD.

I will also add an example and a Makefile for build verification purposes.


text:
function [ No_Files_In_Class_Folder, Class, A, Test ] = getSets( Dict, pSize, overflow )
%GETSETS Summary of this function goes here
%   Detailed explanation goes here

imgCount = 1;
No_Files_In_Class_Folder = zeros(1,size(Dict,2));
%%% These are the training data
for i = 1:size(Dict,2) % Pour chaque 'class d'image'
    No_Files_In_Class_Folder(i) = uint16(size(Dict(i).set, 2))/2;
    for j = 1:No_Files_In_Class_Folder(i) % Pour chaque image d'une classe
        Rs = getRegions(Dict(i).set(j).img);
        for k = 1:4 % Pour chaque région d'une image
            patches = getPatches(Rs(:,:,k), pSize, overflow);
            patchNormDCT2 = normDct2(patches, true, true);
            % Line below does not affect time spent, dont waste time on
            % optimizing the allocation
            % Get description of one vector
            %%% IS it important to keep Class ? see if can get rid for less
            %%% memory usage
            Class(i).img(j).R(k).descriptor = 1/size(patchNormDCT2,2)*sum(getLowFreqComp(patchNormDCT2),2);
        end
        Class(i).img(j).imgDescrip = zeros(15,1);
        for k = 1:4
            % Once we got all the descriptor we add them to create the img
            % descriptor
            Class(i).img(j).imgDescrip = Class(i).img(j).R(k).descriptor + Class(i).img(j).imgDescrip;
        end
        A(:,imgCount) = Class(i).img(j).imgDescrip;
        imgCount = imgCount + 1;
    end
end
%%% These are the test data
begJ = uint16(size(Dict(i).set, 2))/2;
for i = 1:size(Dict,2) % Pour chaque 'class d'image'
    for j = begJ+1:size(Dict(i).set, 2) % Pour chaque image d'une classe
        Rs = getRegions(Dict(i).set(j).img);
        for k = 1:4 % Pour chaque région d'une image
            patches = getPatches(Rs(:,:,k), pSize, overflow);
            patchNormDCT2 = normDct2(patches, true, true);
            % Line below does not affect time spent, dont waste time on
            % optimizing the allocation
            % Get description of one vector
            Test(i).img(j-begJ).R(k).descriptor = 1/size(patchNormDCT2,2)*sum(getLowFreqComp(patchNormDCT2),2);
        end
        Test(i).img(j-begJ).imgDescrip = zeros(15,1);
        for k = 1:4
            % Once we got all the descriptor we add them to create the img
            % descriptor
            Test(i).img(j-begJ).imgDescrip = Test(i).img(j-begJ).R(k).descriptor + Test(i).img(j-begJ).imgDescrip;
        end
    end
end
% Now that A contains all the stuff, we can copy the method from SRC
A = A/(diag(sqrt(diag(A'*A)))); % Learning ? idk wtf it does, just get lower coef, matrix still same size

end


text:
from ._dashboards_v2 import DashboardsClientV2
from ._dashboards_v3 import DashboardsClientV3
from ._events_v1 import EventsClientV1
from ._events_v2 import EventsClientV2

__all__ = ["DashboardsClientV3", "DashboardsClientV2", "EventsClientV1", "EventsClientV2"]


text:
package io.apiman.gateway.engine;

import io.apiman.common.plugin.Plugin;
import io.apiman.common.plugin.PluginCoordinates;
import io.apiman.gateway.engine.async.IAsyncResult;
import io.apiman.gateway.engine.async.IAsyncResultHandler;

import java.util.concurrent.Future;

/**
 * A simple registry that can be used to lookup a plugin.  The plugin is loaded
 * asynchronously - a provided handler is invoked when the plugin has been loaded
 * and is ready to use.
 *
 * @author eric.wittmann@redhat.com
 */
public interface IPluginRegistry {

    /**
     * Asynchronously loads a plugin.
     * @param coordinates the coordinates
     * @param handler result handler
     */
    public Future<IAsyncResult<Plugin>> loadPlugin(PluginCoordinates coordinates, IAsyncResultHandler<Plugin> handler);

}


text:
package com.amazonaws.services.logs;

import javax.annotation.Generated;

import com.amazonaws.services.logs.model.*;

/**
 * Abstract implementation of {@code AWSLogsAsync}. Convenient method forms pass through to the corresponding overload
 * that takes a request object and an {@code AsyncHandler}, which throws an {@code UnsupportedOperationException}.
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AbstractAWSLogsAsync extends AbstractAWSLogs implements AWSLogsAsync {

    protected AbstractAWSLogsAsync() {
    }

    @Override
    public java.util.concurrent.Future<AssociateKmsKeyResult> associateKmsKeyAsync(AssociateKmsKeyRequest request) {

        return associateKmsKeyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<AssociateKmsKeyResult> associateKmsKeyAsync(AssociateKmsKeyRequest request,
            com.amazonaws.handlers.AsyncHandler<AssociateKmsKeyRequest, AssociateKmsKeyResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<CancelExportTaskResult> cancelExportTaskAsync(CancelExportTaskRequest request) {

        return cancelExportTaskAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CancelExportTaskResult> cancelExportTaskAsync(CancelExportTaskRequest request,
            com.amazonaws.handlers.AsyncHandler<CancelExportTaskRequest, CancelExportTaskResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<CreateExportTaskResult> createExportTaskAsync(CreateExportTaskRequest request) {

        return createExportTaskAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreateExportTaskResult> createExportTaskAsync(CreateExportTaskRequest request,
            com.amazonaws.handlers.AsyncHandler<CreateExportTaskRequest, CreateExportTaskResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<CreateLogGroupResult> createLogGroupAsync(CreateLogGroupRequest request) {

        return createLogGroupAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreateLogGroupResult> createLogGroupAsync(CreateLogGroupRequest request,
            com.amazonaws.handlers.AsyncHandler<CreateLogGroupRequest, CreateLogGroupResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<CreateLogStreamResult> createLogStreamAsync(CreateLogStreamRequest request) {

        return createLogStreamAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<CreateLogStreamResult> createLogStreamAsync(CreateLogStreamRequest request,
            com.amazonaws.handlers.AsyncHandler<CreateLogStreamRequest, CreateLogStreamResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DeleteDestinationResult> deleteDestinationAsync(DeleteDestinationRequest request) {

        return deleteDestinationAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteDestinationResult> deleteDestinationAsync(DeleteDestinationRequest request,
            com.amazonaws.handlers.AsyncHandler<DeleteDestinationRequest, DeleteDestinationResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DeleteLogGroupResult> deleteLogGroupAsync(DeleteLogGroupRequest request) {

        return deleteLogGroupAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteLogGroupResult> deleteLogGroupAsync(DeleteLogGroupRequest request,
            com.amazonaws.handlers.AsyncHandler<DeleteLogGroupRequest, DeleteLogGroupResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DeleteLogStreamResult> deleteLogStreamAsync(DeleteLogStreamRequest request) {

        return deleteLogStreamAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteLogStreamResult> deleteLogStreamAsync(DeleteLogStreamRequest request,
            com.amazonaws.handlers.AsyncHandler<DeleteLogStreamRequest, DeleteLogStreamResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DeleteMetricFilterResult> deleteMetricFilterAsync(DeleteMetricFilterRequest request) {

        return deleteMetricFilterAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteMetricFilterResult> deleteMetricFilterAsync(DeleteMetricFilterRequest request,
            com.amazonaws.handlers.AsyncHandler<DeleteMetricFilterRequest, DeleteMetricFilterResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DeleteResourcePolicyResult> deleteResourcePolicyAsync(DeleteResourcePolicyRequest request) {

        return deleteResourcePolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteResourcePolicyResult> deleteResourcePolicyAsync(DeleteResourcePolicyRequest request,
            com.amazonaws.handlers.AsyncHandler<DeleteResourcePolicyRequest, DeleteResourcePolicyResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DeleteRetentionPolicyResult> deleteRetentionPolicyAsync(DeleteRetentionPolicyRequest request) {

        return deleteRetentionPolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteRetentionPolicyResult> deleteRetentionPolicyAsync(DeleteRetentionPolicyRequest request,
            com.amazonaws.handlers.AsyncHandler<DeleteRetentionPolicyRequest, DeleteRetentionPolicyResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DeleteSubscriptionFilterResult> deleteSubscriptionFilterAsync(DeleteSubscriptionFilterRequest request) {

        return deleteSubscriptionFilterAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteSubscriptionFilterResult> deleteSubscriptionFilterAsync(DeleteSubscriptionFilterRequest request,
            com.amazonaws.handlers.AsyncHandler<DeleteSubscriptionFilterRequest, DeleteSubscriptionFilterResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DescribeDestinationsResult> describeDestinationsAsync(DescribeDestinationsRequest request) {

        return describeDestinationsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeDestinationsResult> describeDestinationsAsync(DescribeDestinationsRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeDestinationsRequest, DescribeDestinationsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    /**
     * Simplified method form for invoking the DescribeDestinations operation.
     *
     * @see #describeDestinationsAsync(DescribeDestinationsRequest)
     */
    @Override
    public java.util.concurrent.Future<DescribeDestinationsResult> describeDestinationsAsync() {

        return describeDestinationsAsync(new DescribeDestinationsRequest());
    }

    /**
     * Simplified method form for invoking the DescribeDestinations operation with an AsyncHandler.
     *
     * @see #describeDestinationsAsync(DescribeDestinationsRequest, com.amazonaws.handlers.AsyncHandler)
     */
    @Override
    public java.util.concurrent.Future<DescribeDestinationsResult> describeDestinationsAsync(
            com.amazonaws.handlers.AsyncHandler<DescribeDestinationsRequest, DescribeDestinationsResult> asyncHandler) {

        return describeDestinationsAsync(new DescribeDestinationsRequest(), asyncHandler);
    }

    @Override
    public java.util.concurrent.Future<DescribeExportTasksResult> describeExportTasksAsync(DescribeExportTasksRequest request) {

        return describeExportTasksAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeExportTasksResult> describeExportTasksAsync(DescribeExportTasksRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeExportTasksRequest, DescribeExportTasksResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DescribeLogGroupsResult> describeLogGroupsAsync(DescribeLogGroupsRequest request) {

        return describeLogGroupsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeLogGroupsResult> describeLogGroupsAsync(DescribeLogGroupsRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeLogGroupsRequest, DescribeLogGroupsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    /**
     * Simplified method form for invoking the DescribeLogGroups operation.
     *
     * @see #describeLogGroupsAsync(DescribeLogGroupsRequest)
     */
    @Override
    public java.util.concurrent.Future<DescribeLogGroupsResult> describeLogGroupsAsync() {

        return describeLogGroupsAsync(new DescribeLogGroupsRequest());
    }

    /**
     * Simplified method form for invoking the DescribeLogGroups operation with an AsyncHandler.
     *
     * @see #describeLogGroupsAsync(DescribeLogGroupsRequest, com.amazonaws.handlers.AsyncHandler)
     */
    @Override
    public java.util.concurrent.Future<DescribeLogGroupsResult> describeLogGroupsAsync(
            com.amazonaws.handlers.AsyncHandler<DescribeLogGroupsRequest, DescribeLogGroupsResult> asyncHandler) {

        return describeLogGroupsAsync(new DescribeLogGroupsRequest(), asyncHandler);
    }

    @Override
    public java.util.concurrent.Future<DescribeLogStreamsResult> describeLogStreamsAsync(DescribeLogStreamsRequest request) {

        return describeLogStreamsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeLogStreamsResult> describeLogStreamsAsync(DescribeLogStreamsRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeLogStreamsRequest, DescribeLogStreamsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DescribeMetricFiltersResult> describeMetricFiltersAsync(DescribeMetricFiltersRequest request) {

        return describeMetricFiltersAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeMetricFiltersResult> describeMetricFiltersAsync(DescribeMetricFiltersRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeMetricFiltersRequest, DescribeMetricFiltersResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DescribeQueriesResult> describeQueriesAsync(DescribeQueriesRequest request) {

        return describeQueriesAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeQueriesResult> describeQueriesAsync(DescribeQueriesRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeQueriesRequest, DescribeQueriesResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DescribeResourcePoliciesResult> describeResourcePoliciesAsync(DescribeResourcePoliciesRequest request) {

        return describeResourcePoliciesAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeResourcePoliciesResult> describeResourcePoliciesAsync(DescribeResourcePoliciesRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeResourcePoliciesRequest, DescribeResourcePoliciesResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DescribeSubscriptionFiltersResult> describeSubscriptionFiltersAsync(DescribeSubscriptionFiltersRequest request) {

        return describeSubscriptionFiltersAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeSubscriptionFiltersResult> describeSubscriptionFiltersAsync(DescribeSubscriptionFiltersRequest request,
            com.amazonaws.handlers.AsyncHandler<DescribeSubscriptionFiltersRequest, DescribeSubscriptionFiltersResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<DisassociateKmsKeyResult> disassociateKmsKeyAsync(DisassociateKmsKeyRequest request) {

        return disassociateKmsKeyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DisassociateKmsKeyResult> disassociateKmsKeyAsync(DisassociateKmsKeyRequest request,
            com.amazonaws.handlers.AsyncHandler<DisassociateKmsKeyRequest, DisassociateKmsKeyResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<FilterLogEventsResult> filterLogEventsAsync(FilterLogEventsRequest request) {

        return filterLogEventsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<FilterLogEventsResult> filterLogEventsAsync(FilterLogEventsRequest request,
            com.amazonaws.handlers.AsyncHandler<FilterLogEventsRequest, FilterLogEventsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<GetLogEventsResult> getLogEventsAsync(GetLogEventsRequest request) {

        return getLogEventsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetLogEventsResult> getLogEventsAsync(GetLogEventsRequest request,
            com.amazonaws.handlers.AsyncHandler<GetLogEventsRequest, GetLogEventsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<GetLogGroupFieldsResult> getLogGroupFieldsAsync(GetLogGroupFieldsRequest request) {

        return getLogGroupFieldsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetLogGroupFieldsResult> getLogGroupFieldsAsync(GetLogGroupFieldsRequest request,
            com.amazonaws.handlers.AsyncHandler<GetLogGroupFieldsRequest, GetLogGroupFieldsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<GetLogRecordResult> getLogRecordAsync(GetLogRecordRequest request) {

        return getLogRecordAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetLogRecordResult> getLogRecordAsync(GetLogRecordRequest request,
            com.amazonaws.handlers.AsyncHandler<GetLogRecordRequest, GetLogRecordResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<GetQueryResultsResult> getQueryResultsAsync(GetQueryResultsRequest request) {

        return getQueryResultsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetQueryResultsResult> getQueryResultsAsync(GetQueryResultsRequest request,
            com.amazonaws.handlers.AsyncHandler<GetQueryResultsRequest, GetQueryResultsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<ListTagsLogGroupResult> listTagsLogGroupAsync(ListTagsLogGroupRequest request) {

        return listTagsLogGroupAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListTagsLogGroupResult> listTagsLogGroupAsync(ListTagsLogGroupRequest request,
            com.amazonaws.handlers.AsyncHandler<ListTagsLogGroupRequest, ListTagsLogGroupResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<PutDestinationResult> putDestinationAsync(PutDestinationRequest request) {

        return putDestinationAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutDestinationResult> putDestinationAsync(PutDestinationRequest request,
            com.amazonaws.handlers.AsyncHandler<PutDestinationRequest, PutDestinationResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<PutDestinationPolicyResult> putDestinationPolicyAsync(PutDestinationPolicyRequest request) {

        return putDestinationPolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutDestinationPolicyResult> putDestinationPolicyAsync(PutDestinationPolicyRequest request,
            com.amazonaws.handlers.AsyncHandler<PutDestinationPolicyRequest, PutDestinationPolicyResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<PutLogEventsResult> putLogEventsAsync(PutLogEventsRequest request) {

        return putLogEventsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutLogEventsResult> putLogEventsAsync(PutLogEventsRequest request,
            com.amazonaws.handlers.AsyncHandler<PutLogEventsRequest, PutLogEventsResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<PutMetricFilterResult> putMetricFilterAsync(PutMetricFilterRequest request) {

        return putMetricFilterAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutMetricFilterResult> putMetricFilterAsync(PutMetricFilterRequest request,
            com.amazonaws.handlers.AsyncHandler<PutMetricFilterRequest, PutMetricFilterResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<PutResourcePolicyResult> putResourcePolicyAsync(PutResourcePolicyRequest request) {

        return putResourcePolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutResourcePolicyResult> putResourcePolicyAsync(PutResourcePolicyRequest request,
            com.amazonaws.handlers.AsyncHandler<PutResourcePolicyRequest, PutResourcePolicyResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<PutRetentionPolicyResult> putRetentionPolicyAsync(PutRetentionPolicyRequest request) {

        return putRetentionPolicyAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutRetentionPolicyResult> putRetentionPolicyAsync(PutRetentionPolicyRequest request,
            com.amazonaws.handlers.AsyncHandler<PutRetentionPolicyRequest, PutRetentionPolicyResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<PutSubscriptionFilterResult> putSubscriptionFilterAsync(PutSubscriptionFilterRequest request) {

        return putSubscriptionFilterAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutSubscriptionFilterResult> putSubscriptionFilterAsync(PutSubscriptionFilterRequest request,
            com.amazonaws.handlers.AsyncHandler<PutSubscriptionFilterRequest, PutSubscriptionFilterResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<StartQueryResult> startQueryAsync(StartQueryRequest request) {

        return startQueryAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<StartQueryResult> startQueryAsync(StartQueryRequest request,
            com.amazonaws.handlers.AsyncHandler<StartQueryRequest, StartQueryResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<StopQueryResult> stopQueryAsync(StopQueryRequest request) {

        return stopQueryAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<StopQueryResult> stopQueryAsync(StopQueryRequest request,
            com.amazonaws.handlers.AsyncHandler<StopQueryRequest, StopQueryResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<TagLogGroupResult> tagLogGroupAsync(TagLogGroupRequest request) {

        return tagLogGroupAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<TagLogGroupResult> tagLogGroupAsync(TagLogGroupRequest request,
            com.amazonaws.handlers.AsyncHandler<TagLogGroupRequest, TagLogGroupResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<TestMetricFilterResult> testMetricFilterAsync(TestMetricFilterRequest request) {

        return testMetricFilterAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<TestMetricFilterResult> testMetricFilterAsync(TestMetricFilterRequest request,
            com.amazonaws.handlers.AsyncHandler<TestMetricFilterRequest, TestMetricFilterResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

    @Override
    public java.util.concurrent.Future<UntagLogGroupResult> untagLogGroupAsync(UntagLogGroupRequest request) {

        return untagLogGroupAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<UntagLogGroupResult> untagLogGroupAsync(UntagLogGroupRequest request,
            com.amazonaws.handlers.AsyncHandler<UntagLogGroupRequest, UntagLogGroupResult> asyncHandler) {

        throw new java.lang.UnsupportedOperationException();
    }

}


text:
import {Observable} from '../../Observable';
import {FromEventPatternObservable} from '../../observable/fromEventPattern';
Observable.fromEventPattern = FromEventPatternObservable.create;

export var _void: void;


text:
namespace System.Windows.Forms.ComponentModel.Com2Interop {

    using Microsoft.Win32;
    using System;
    using System.ComponentModel;
    using System.ComponentModel.Design;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Design;
    using System.Runtime.InteropServices;
    using System.Windows.Forms.Design;
    using System.Globalization;

    /// <include file='doc\COM2PropertyBuilderUITypeEditor.uex' path='docs/doc[@for="Com2PropertyBuilderUITypeEditor"]/*' />
    /// <devdoc>
    /// </devdoc>
    internal class Com2PropertyBuilderUITypeEditor : Com2ExtendedUITypeEditor {

        private Com2PropertyDescriptor propDesc;
        string  guidString;
        int     bldrType;

        public Com2PropertyBuilderUITypeEditor(Com2PropertyDescriptor pd, string guidString, int type, UITypeEditor baseEditor) : base(baseEditor) {
            propDesc = pd;
            this.guidString = guidString;
            this.bldrType = type;
        }

        /// <include file='doc\COM2PropertyBuilderUITypeEditor.uex' path='docs/doc[@for="Com2PropertyBuilderUITypeEditor.EditValue"]/*' />
        /// <devdoc>
        ///     Takes the value returned from valueAccess.getValue() and modifies or replaces
        ///     the value, passing the result into valueAccess.setValue().  This is where
        ///     an editor can launch a modal dialog or create a drop down editor to allow
        ///     the user to modify the value.  Host assistance in presenting UI to the user
        ///     can be found through the valueAccess.getService function.
        /// </devdoc>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) {

            IntPtr parentHandle = (IntPtr)UnsafeNativeMethods.GetFocus();

            IUIService uiSvc = (IUIService)provider.GetService(typeof(IUIService));
            if (uiSvc != null) {
                IWin32Window parent = uiSvc.GetDialogOwnerWindow();
                if (parent != null) {
                    parentHandle = parent.Handle;
                }
            }

            bool useValue = false;
            //VARIANT pValue = null;
            object pValue = value;

            try{
               object obj = propDesc.TargetObject;

               if (obj is ICustomTypeDescriptor) {
                  obj = ((ICustomTypeDescriptor)obj).GetPropertyOwner(propDesc);
               }

                Debug.Assert(obj is NativeMethods.IProvidePropertyBuilder, "object is not IProvidePropertyBuilder");
                NativeMethods.IProvidePropertyBuilder propBuilder = (NativeMethods.IProvidePropertyBuilder)obj;

                if (NativeMethods.Failed(propBuilder.ExecuteBuilder(propDesc.DISPID,
                                                          guidString,
                                                          null,
                                                          new HandleRef(null, parentHandle),
                                                          ref pValue, ref useValue))){
                    useValue = false;
                }

            }catch(ExternalException ex) {
                Debug.Fail("Failed to show property frame: " + ex.ErrorCode.ToString(CultureInfo.InvariantCulture));
            }

            if (useValue && (bldrType & _CTLBLDTYPE.CTLBLDTYPE_FEDITSOBJDIRECTLY) == 0){

               return pValue;//pValue.ToVariant();
            }
            return value;
        }

        /// <include file='doc\COM2PropertyBuilderUITypeEditor.uex' path='docs/doc[@for="Com2PropertyBuilderUITypeEditor.GetEditStyle"]/*' />
        /// <devdoc>
        ///      Retrieves the editing style of the Edit method.  If the method
        ///      is not supported, this will return None.
        /// </devdoc>
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) {
            return UITypeEditorEditStyle.Modal;
        }

    }

}


text:
package mem_test

import (
	"testing"

	"github.com/katydid/katydid/parser"
	"github.com/katydid/katydid/relapse/ast"
	"github.com/katydid/katydid/relapse/interp"
	"github.com/katydid/katydid/relapse/mem"
	"github.com/katydid/katydid/relapse/testsuite"
)

func TestSuite(t *testing.T) {
	if !testsuite.TestSuiteExists() {
		t.Skip("testsuite not avaliable")
	}
	tests, err := testsuite.ReadTestSuite()
	if err != nil {
		t.Fatal(err)
	}
	for _, testCase := range tests {
		t.Run(testCase.Name, func(t *testing.T) {
			test(t, testCase.Grammar, testCase.Parser, testCase.Expected, "", testCase.Record)
		})
	}
}

func test(t *testing.T, g *ast.Grammar, p parser.Interface, expected bool, desc string, record bool) {
	if interp.HasRecursion(g) {
		t.Skipf("interp was not designed to handle left recursion")
	}
	var m *mem.Mem
	var err error
	if record {
		m, err = mem.NewRecord(g)
	} else {
		m, err = mem.New(g)
	}
	if err != nil {
		t.Fatal(err)
	}
	match, err := m.Validate(p)
	if err != nil {
		t.Fatal(err)
	}
	if match != expected {
		t.Fatalf("Expected %v on given \n%s\n on \n%s", expected, g.String(), desc)
	}
}


text:
import { CharCode } from 'vs/base/common/charCode';
import { CursorColumns } from 'vs/editor/common/controller/cursorCommon';

export const enum Direction {
	Left,
	Right,
	Nearest,
}

export class AtomicTabMoveOperations {
	/**
	 * Get the visible column at the position. If we get to a non-whitespace character first
	 * or past the end of string then return -1.
	 *
	 * **Note** `position` and the return value are 0-based.
	 */
	public static whitespaceVisibleColumn(lineContent: string, position: number, tabSize: number): [number, number, number] {
		const lineLength = lineContent.length;
		let visibleColumn = 0;
		let prevTabStopPosition = -1;
		let prevTabStopVisibleColumn = -1;
		for (let i = 0; i < lineLength; i++) {
			if (i === position) {
				return [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn];
			}
			if (visibleColumn % tabSize === 0) {
				prevTabStopPosition = i;
				prevTabStopVisibleColumn = visibleColumn;
			}
			const chCode = lineContent.charCodeAt(i);
			switch (chCode) {
				case CharCode.Space:
					visibleColumn += 1;
					break;
				case CharCode.Tab:
					// Skip to the next multiple of tabSize.
					visibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize);
					break;
				default:
					return [-1, -1, -1];
			}
		}
		if (position === lineLength) {
			return [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn];
		}
		return [-1, -1, -1];
	}

	/**
	 * Return the position that should result from a move left, right or to the
	 * nearest tab, if atomic tabs are enabled. Left and right are used for the
	 * arrow key movements, nearest is used for mouse selection. It returns
	 * -1 if atomic tabs are not relevant and you should fall back to normal
	 * behaviour.
	 *
	 * **Note**: `position` and the return value are 0-based.
	 */
	public static atomicPosition(lineContent: string, position: number, tabSize: number, direction: Direction): number {
		const lineLength = lineContent.length;

		// Get the 0-based visible column corresponding to the position, or return
		// -1 if it is not in the initial whitespace.
		const [prevTabStopPosition, prevTabStopVisibleColumn, visibleColumn] = AtomicTabMoveOperations.whitespaceVisibleColumn(lineContent, position, tabSize);

		if (visibleColumn === -1) {
			return -1;
		}

		// Is the output left or right of the current position. The case for nearest
		// where it is the same as the current position is handled in the switch.
		let left: boolean;
		switch (direction) {
			case Direction.Left:
				left = true;
				break;
			case Direction.Right:
				left = false;
				break;
			case Direction.Nearest:
				// The code below assumes the output position is either left or right
				// of the input position. If it is the same, return immediately.
				if (visibleColumn % tabSize === 0) {
					return position;
				}
				// Go to the nearest indentation.
				left = visibleColumn % tabSize <= (tabSize / 2);
				break;
		}

		// If going left, we can just use the info about the last tab stop position and
		// last tab stop visible column that we computed in the first walk over the whitespace.
		if (left) {
			if (prevTabStopPosition === -1) {
				return -1;
			}
			// If the direction is left, we need to keep scanning right to ensure
			// that targetVisibleColumn + tabSize is before non-whitespace.
			// This is so that when we press left at the end of a partial
			// indentation it only goes one character. For example '      foo' with
			// tabSize 4, should jump from position 6 to position 5, not 4.
			let currentVisibleColumn = prevTabStopVisibleColumn;
			for (let i = prevTabStopPosition; i < lineLength; ++i) {
				if (currentVisibleColumn === prevTabStopVisibleColumn + tabSize) {
					// It is a full indentation.
					return prevTabStopPosition;
				}

				const chCode = lineContent.charCodeAt(i);
				switch (chCode) {
					case CharCode.Space:
						currentVisibleColumn += 1;
						break;
					case CharCode.Tab:
						currentVisibleColumn = CursorColumns.nextRenderTabStop(currentVisibleColumn, tabSize);
						break;
					default:
						return -1;
				}
			}
			if (currentVisibleColumn === prevTabStopVisibleColumn + tabSize) {
				return prevTabStopPosition;
			}
			// It must have been a partial indentation.
			return -1;
		}

		// We are going right.
		const targetVisibleColumn = CursorColumns.nextRenderTabStop(visibleColumn, tabSize);

		// We can just continue from where whitespaceVisibleColumn got to.
		let currentVisibleColumn = visibleColumn;
		for (let i = position; i < lineLength; i++) {
			if (currentVisibleColumn === targetVisibleColumn) {
				return i;
			}

			const chCode = lineContent.charCodeAt(i);
			switch (chCode) {
				case CharCode.Space:
					currentVisibleColumn += 1;
					break;
				case CharCode.Tab:
					currentVisibleColumn = CursorColumns.nextRenderTabStop(currentVisibleColumn, tabSize);
					break;
				default:
					return -1;
			}
		}
		// This condition handles when the target column is at the end of the line.
		if (currentVisibleColumn === targetVisibleColumn) {
			return lineLength;
		}
		return -1;
	}
}


text:
package org.hibernate.jpamodelgen.test.blob;

import java.sql.Blob;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * @author Hardy Ferentschik
 */
@Entity
@Table
public class BlobEntity {
	@Id
	private String id;

	@Lob
	private Blob blob;
}


text:
layout: post
date:	2009-10-28 22:54:00
title:  A walk that I participated in, and another that I didnt...
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
While in St.Louis, I

 walked for ALS

...and later just before leaving, I took part in the

 Walk for Autism

on October 10th.

The turnout for this walk was phenomenally large compared to any of the other fund-raising walks I have been participating over the years. Obviously, the problem of

 autism in children

 strikes a very responsive chord amongst people.

Here's the official tee for the walk:

You can see just how crowded the walk was!

Another worthy cause which I could not join (I had already done an hour and a half of walking in the Park, and was meeting people for breakfast) was on Oct 17, the very next week.

This was the

 Second Wing Lung Walk

  Second Wind Lung Foundation

This walk is to benefit those who  need a "second wind" that a lung transplant can give them.

Here are the details of the walk:

The slogan is, "Every breath counts"...and indeed it does...it's up to us to make each breath count, not only for ourselves, but for those less fortunate than ourselves, in so many different ways.

Such walks help me realize the extreme good fortune that I have in my good health...

Walking for a cause is such a great way of combining exercise, meeting people, and contributing your litte mite to research.


text:
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var OAuthAuthCodeSchema = new Schema({
  authCode: { type: String, required: true, unique: true },
  clientId: String,
  userId: { type: String, required: true },
  expires: Date
});

mongoose.model('oauth_authcodes', OAuthAuthCodeSchema);

var OAuthAuthCodeModel = mongoose.model('oauth_authcodes');

module.exports.getAuthCode = function(authCode, callback) {
  OAuthAuthCodeModel.findOne({ authCode: authCode }, callback);
};

module.exports.saveAuthCode = function(code, clientId, expires, userId, callback) {
  var fields = {
    clientId: clientId,
    userId: userId,
    expires: expires
  };

  OAuthAuthCodeModel.update({ authCode: code }, fields, { upsert: true }, function(err) {
    if (err) {
      console.error(err);
    }

    callback(err);
  });
};


text:
package io.finch.middleware

import cats.effect.IO
import cats.syntax.apply._
import com.twitter.finagle.Http
import com.twitter.finagle.http.{Response, Status}
import com.twitter.util.{Await, Time}
import io.finch._

/**
  * Small Finch hello world application serving endpoint protected by serious authentication
  * where each request & response are also logged and measured.
  *
  * This is achieved using Kleisli-based middleware together with [[Bootstrap.compile]]
  *
  * Use the following curl commands to test it:
  *
  * {{{
  *   curl -v -H "Authorization: secret" http://localhost:8081/hello
  *   curl -V -H "Authorization: wrong" http://localhost:8081/hello
  * }}}
  *
  * !Disclaimer: most likely you would need to use proper libraries for logging, auth, and metrics
  * instead but their use will be quite similar.
  */
object Main extends App with Endpoint.Module[IO] {

  val helloWorld: Endpoint[IO, String] = get("hello") {
    Ok("Hello world")
  }

  val auth: Endpoint.Compiled[IO] => Endpoint.Compiled[IO] = compiled => {
    Endpoint.Compiled[IO] {
      case req if req.authorization.contains("secret") => compiled(req)
      case _ => IO.pure(Trace.empty -> Right(Response(Status.Unauthorized)))
    }
  }

  val logging: Endpoint.Compiled[IO] => Endpoint.Compiled[IO] = compiled => {
    compiled.tapWithF((req, res) => {
      IO(print(s"Request: $req\n")) *> IO(print(s"Response: $res\n")) *> IO.pure(res)
    })
  }

  val stats: Endpoint.Compiled[IO] => Endpoint.Compiled[IO] = compiled => {
    val now = IO(Time.now)
    Endpoint.Compiled[IO] { req =>
      for {
        start <- now
        traceAndResponse <- compiled(req)
        (trace, response) = traceAndResponse
        stop <- now
        _ <- IO(print(s"Response time: ${stop.diff(start)}. Trace: $trace\n"))
      } yield {
        (trace, response)
      }
    }
  }

  val filters = Function.chain(Seq(stats, logging, auth))
  val compiled = filters(Bootstrap.serve[Text.Plain](helloWorld).compile)

  Await.ready(Http.server.serve(":8081", Endpoint.toService(compiled)))

}


text:
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@android:color/white"
    android:padding="@dimen/padding_std_large"
    tools:context="za.org.grassroot2.view.fragment.LongTextInputFragment">

    <TextView
        android:id="@+id/header"
        style="@style/MediumHeader"
        android:layout_marginLeft="@dimen/margin_std_small"
        android:layout_marginStart="@dimen/margin_std_small"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:text="Header text" />

    <!-- todo: get rid of the line at the bottom -->
    <EditText
        android:id="@+id/inputText"
        style="@style/MultiLineLargeInput"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        tools:hint="Write some things here"/>

    <LinearLayout
        android:id="@+id/skip_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:id="@+id/skipButton"
            style="@style/DefaultActionButton"
            android:layout_weight="0.5"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            tools:text="SKIP" />

        <Button
            android:id="@+id/nextButton"
            style="@style/DefaultActionButton"
            android:layout_weight="0.5"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            tools:text="NEXT" />

    </LinearLayout>

</LinearLayout>


text:
var obj = {
    get [Symbol.isConcatSpreadable]() { return '' },
    set [Symbol.isConcatSpreadable](x) { }
}


text:
angular.module("proton.controllers.Auth", [
    "proton.authentication",
    "proton.pmcw",
    "proton.constants"
])

.controller("LoginController", function(
    $rootScope,
    $state,
    $scope,
    $log,
    $timeout,
    $http,
    $location,
    CONSTANTS,
    CONFIG,
    gettextCatalog,
    authentication,
    networkActivityTracker,
    notify,
    loginModal,
    pmcw,
    tools
) {
    $rootScope.pageName = 'Login';
    $rootScope.tempUser = $rootScope.tempUser || [];
    $scope.maxPW = CONSTANTS.LOGIN_PW_MAX_LEN;

    if ($rootScope.isLoggedIn && $rootScope.isLocked === false && $rootScope.user === undefined) {
        try {
            $rootScope.user = authentication.fetchUserInfo();
        }
        catch(err) {
            $log.error('appjs',err);
            alert(err);
        }
    }

    var clearErrors = function() {
        $scope.error = null;
        notify.closeAll();
    };

    $scope.initialization = function() {
        var ua = window.navigator.userAgent;
        var iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i);
        var webkit = !!ua.match(/WebKit/i);
        var iOSSafari = iOS && webkit && !ua.match(/CriOS/i);

        if (iOSSafari) {
            // Don't focus the input field
        } else {
            angular.element('input.focus').focus();
        }

        // If #help
        if ($location.hash() === 'help') {
            $scope.getLoginHelp();
        }

        // Detect if the current browser have session storage enable
        if (tools.hasSessionStorage() === false) {
            notify({message: gettextCatalog.getString('You are in Private Mode or have Session Storage disabled.\nPlease deactivate Private Mode and then reload the page.\nMore information here.', null, 'Error'), classes: 'notification-danger', duration: '0'});
        }

        // Detect if the current browser have cookie enable
        if (tools.hasCookie() === false) {
            notify({message: gettextCatalog.getString('Cookies are disabled.\nPlease activate it and then reload the page.\nMore information here.', null, 'Error'), classes: 'notification-danger', duration: '0'});
        }
    };

    /**
     * Open login modal to help the user
     */
    $scope.getLoginHelp = function() {
        loginModal.activate({
            params: {
                cancel: function() {
                    loginModal.deactivate();
                }
            }
        });
    };

    // this does not add security and was only active for less than a day in 2013.
    // required for accounts created back then.
    // goal was to obfuscate the password in a basic manner.
    $scope.basicObfuscate = function(username, password) {
        var salt = username.toLowerCase();

        if (salt.indexOf("@") > -1) {
            salt = salt.match(/^([^@]*)@/)[1];
        }

        return pmcrypto.getHashedPassword(salt+password);
    };

    $scope.login = function() {
        angular.element('input').blur();
        angular.element('#pm_login').attr({action:'/*'});
        clearErrors();

        // Check username and password
        if(
            angular.isUndefined($scope.username) ||
            angular.isUndefined($scope.password) ||
            $scope.username.length === 0 ||
            $scope.password.length === 0
        ) {
            notify({message: gettextCatalog.getString('Please enter your username and password.', null, 'Error'), classes: 'notification-danger'});
            return;
        }

        // Transform to lowercase and remove the domain
        $scope.username = $scope.username.toLowerCase();

        // Custom validation
        try {
            if (pmcw.encode_utf8($scope.password).length > CONSTANTS.LOGIN_PW_MAX_LEN) {
                notify({message: gettextCatalog.getString('Passwords are limited to ' + CONSTANTS.LOGIN_PW_MAX_LEN + ' characters.', null, 'Error'), classes: 'notification-danger'});
                return;
            }
        } catch(err) {
            notify({message: err.message, classes: 'notification-danger'});
            return;
        }

        networkActivityTracker.track(
            authentication.loginWithCredentials({
                Username: $scope.username,
                Password: $scope.password
            })
            .then(
                function(result) {
                    $log.debug('loginWithCredentials:result.data ', result);
                    if (angular.isDefined(result.data) && angular.isDefined(result.data.Code) && result.data.Code === 401) {
                        $scope.selectPassword();
                        notify({message: result.data.ErrorDescription, classes: 'notification-danger'});
                    } else if (angular.isDefined(result.data) && angular.isDefined(result.data.Code) && result.data.Code === 10002) {
                        var message;

                        if (result.data.Error) {
                            message = result.data.Error;
                        } else {
                            message = "Your account has been disabled.";
                        }
                        // This account is disabled.
                        notify({message: message, classes: 'notification-danger'});
                    } else if (angular.isDefined(result.data) && angular.isDefined(result.data.AccessToken)) {
                        // TODO: where is tempUser used?
                        $rootScope.isLoggedIn = true;
                        $rootScope.tempUser = {
                            username: $scope.username,
                            password: $scope.password
                        };

                        $state.go('login.unlock');
                        return;
                    } else if (angular.isDefined(result.data) && angular.isDefined(result.data.Code) && result.data.Code === 5003) {
                        // Nothing
                    } else if (angular.isDefined(result.data) && angular.isDefined(result.data.Error)) {
                        // TODO: This might be buggy
	                	var error  = (angular.isDefined(result.data.ErrorDescription) && result.data.ErrorDescription.length) ? result.data.ErrorDescription : result.data.Error;

                        notify({message: error, classes: 'notification-danger'});
	                } else {
	                	notify({message: 'Unable to log you in.', classes: 'notification-danger'});
	                }
                },
                function(result) {
                    if (result.message === undefined) {
                        result.message = 'Sorry, our login server is down. Please try again later.';
                    }

                    notify({message: result.message, classes: 'notification-danger'});
                    angular.element('input[name="Username"]').focus();
                }
            )
        );
    };

    $scope.unlock = function() {
        // Blur unlock password field
        angular.element('[type=password]').blur();
        // Make local so extensions (or Angular) can't mess with it by clearing the form too early
        var mailboxPassword = $scope.mailboxPassword;

        clearErrors();

        networkActivityTracker.track(
            authentication.unlockWithPassword(
                $rootScope.TemporaryEncryptedPrivateKeyChallenge,
                mailboxPassword,
                $rootScope.TemporaryEncryptedAccessToken,
                $rootScope.TemporaryAccessData
            )
            .then(
                function(resp) {
                    $log.debug('unlockWithPassword:resp'+resp);
                    return authentication.setAuthCookie()
                    .then(
                        function(resp) {
                            $log.debug('setAuthCookie:resp'+resp);
                            authentication.savePassword(mailboxPassword);
                            $rootScope.isLoggedIn = authentication.isLoggedIn();
                            $rootScope.isLocked = authentication.isLocked();
                            $rootScope.isSecure = authentication.isSecured();

                            $state.go('secured.inbox');
                        },
                        function(err) {
                            $log.error('unlock', err);
                            notify({message: err.message, classes: 'notification-danger'});
                            angular.element('[type=password]').focus();
                        }
                    );
                },
                function(err) {
                    $log.error('unlock', err);

                    // clear password for user
                    $scope.selectPassword();

                    notify({message: err.message, classes: 'notification-danger'});
                }
            )
        );
    };

    $scope.selectPassword = function() {
        var input = angular.element('#password');

        input.focus();
        input.select();
    };

    $scope.initialization();
});


text:
<?php

namespace Oro\Component\Testing\Tests\Unit\Assert;

use Oro\Component\Testing\Assert\ArrayContainsConstraint;

class ArrayContainsConstraintTest extends \PHPUnit\Framework\TestCase
{
    public function testNullActualData()
    {
        $expected = ['key' => 'value'];
        $actual = null;
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "". Error: Failed asserting that null is of type "array".
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testNotArrayActualData()
    {
        $expected = ['key' => 'value'];
        $actual = 'test';
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "". Error: Failed asserting that 'test' is of type "array".
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArraysEquals()
    {
        $expected = ['key' => 'value'];
        $actual = ['key' => 'value'];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArraysEqualsForIntKey()
    {
        $expected = ['value'];
        $actual = ['value'];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArrayContains()
    {
        $expected = ['key' => 'value'];
        $actual = ['key' => 'value', 'anotherKey' => 'anotherValue'];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArrayContainsForIntKey()
    {
        $expected = ['value'];
        $actual = ['value', 'anotherValue'];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArrayContainsWhenExpectedArrayHasMoreItemsThanActualArray()
    {
        $expected = ['key' => 'value', 'anotherKey' => 'anotherValue'];
        $actual = ['key' => 'value'];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "anotherKey". Error: Failed asserting that an array has the key 'anotherKey'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArrayContainsWhenExpectedArrayHasMoreItemsThanActualArrayForIntKey()
    {
        $expected = ['value', 'anotherValue'];
        $actual = ['value'];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "1". Error: Failed asserting that an array has the key 1.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArraysEqualsForMultiDimensionalArrays()
    {
        $expected = [
            'key1' => 'value1',
            'key2' => [
                'key21' => 'value21',
                'key22' => [
                    'key221' => 'value221',
                ]
            ]
        ];
        $actual = [
            'key1' => 'value1',
            'key2' => [
                'key21' => 'value21',
                'key22' => [
                    'key221' => 'value221',
                ]
            ]
        ];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArraysEqualsForMultiDimensionalArraysWithIntKeys()
    {
        $expected = [
            'value1',
            [
                'value21',
                [
                    'value221',
                ]
            ]
        ];
        $actual = [
            'value1',
            [
                'value21',
                [
                    'value221',
                ]
            ]
        ];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArrayContainsForMultiDimensionalArrays()
    {
        $expected = [
            'key1' => 'value1',
            'key2' => [
                'key21' => 'value21',
                'key22' => [
                    'key221' => 'value221',
                ]
            ]
        ];
        $actual = [
            'key1' => 'value1',
            'key2' => [
                'key21' => 'value21',
                'key22' => [
                    'key221' => 'value221',
                    'key222' => 'value222',
                ],
                'key23' => 'value23'
            ],
            'key3' => 'value3'
        ];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testArrayContainsForMultiDimensionalArraysWithIntKeys()
    {
        $expected = [
            'value1',
            [
                'value21',
                [
                    'value221',
                ]
            ]
        ];
        $actual = [
            'value1',
            [
                'value21',
                [
                    'value221',
                    'value222',
                ],
                'value23'
            ],
            'value3'
        ];

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testStrictArrayContainsForIntKeyAndIndexOfElementIsDifferent()
    {
        $expected = ['value1', 'value2'];
        $actual = ['value1', 'anotherValue', 'value2'];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "1". Error: Failed asserting that 'anotherValue' is identical to 'value2'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForIntKeyAndIndexOfElementIsDifferent()
    {
        $expected = ['value1', 'value2'];
        $actual = ['value1', 'anotherValue', 'value2'];

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testStrictArrayContainsForIntKeyAndOrderOfElementIsDifferent()
    {
        $expected = ['value1', 'value2'];
        $actual = ['value2', 'anotherValue', 'value1'];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "0". Error: Failed asserting that 'value2' is identical to 'value1'.
Path: "1". Error: Failed asserting that 'anotherValue' is identical to 'value2'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForIntKeyAndOrderOfElementIsDifferent()
    {
        $expected = ['value1', 'value2'];
        $actual = ['value2', 'anotherValue', 'value1'];

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testStrictArrayContainsWhenMoreThen10ErrorsFound()
    {
        $expected = [
            'value1',
            'value2',
            'value3',
            'value4',
            'value5',
            'value6',
            'value7',
            'value8',
            'value9',
            'value10',
            'value11',
            'value12',
        ];
        $actual = [];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "0". Error: Failed asserting that an array has the key 0.
Path: "1". Error: Failed asserting that an array has the key 1.
Path: "2". Error: Failed asserting that an array has the key 2.
Path: "3". Error: Failed asserting that an array has the key 3.
Path: "4". Error: Failed asserting that an array has the key 4.
Path: "5". Error: Failed asserting that an array has the key 5.
Path: "6". Error: Failed asserting that an array has the key 6.
Path: "7". Error: Failed asserting that an array has the key 7.
Path: "8". Error: Failed asserting that an array has the key 8.
Path: "9". Error: Failed asserting that an array has the key 9.
and others ...
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testStrictArrayContainsWhenMultiDimensionalArraysAreDifferent()
    {
        $expected = [
            'key1' => 'value1',
            'key2' => [
                'key21' => 'value21',
                'key22' => [
                    'key221' => 'value221',
                ]
            ]
        ];
        $actual = [
            'key1' => 'value1',
            'key2' => [
                'key21' => 'value21',
                'key22' => [
                    'key221' => 'value221_other',
                ]
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "key2.key22.key221". Error: Failed asserting that 'value221_other' is identical to 'value221'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testStrictArrayContainsForMultiDimensionalArraysWithIntKeyAndOrderOfElementIsDifferent()
    {
        $expected = [
            'key1' => 'value1',
            'key2' => [
                ['key' => 'value221'],
                ['key' => 'value222'],
            ]
        ];
        $actual = [
            'key1' => 'value1',
            'key2' => [
                ['key' => 'value222'],
                ['key' => 'value221'],
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "key2.0.key". Error: Failed asserting that 'value222' is identical to 'value221'.
Path: "key2.1.key". Error: Failed asserting that 'value221' is identical to 'value222'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForMultiDimensionalArraysWithIntKeyAndOrderOfElementIsDifferent()
    {
        $expected = [
            'key1' => 'value1',
            'key2' => [
                ['key' => 'value221'],
                ['key' => 'value222'],
            ]
        ];
        $actual = [
            'key1' => 'value1',
            'key2' => [
                ['key' => 'value222'],
                ['key' => 'value221'],
            ]
        ];

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForMultiDimensionalArraysWithIntKeyAndHasErrors()
    {
        $expected = [
            'key1' => 'value1',
            'key2' => [
                ['key' => 'value221'],
                ['key' => 'value222'],
            ]
        ];
        $actual = [
            'key1' => 'value1',
            'key2' => [
                ['key' => ['value222']],
                ['key' => ['value221']],
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "key2.0.key". Error: Failed asserting that Array &0 (
    0 => 'value222'
) is identical to 'value221'.
Path: "key2.1.key". Error: Failed asserting that Array &0 (
    0 => 'value221'
) is identical to 'value222'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForMultiDimensionalArraysWithIntKeyAndHasErrorsOnDifferentLevels()
    {
        $expected = [
            'key1' => 'value1',
            'key2' => [
                ['key1' => 'value1', 'key2' => 'value2'],
            ]
        ];
        $actual = [
            'key1' => 'value1',
            'key2' => [
                ['key1' => 'value1'],
                ['key2' => 'value2'],
                ['key1' => 1, 'key2' => 2],
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "key2.0.key2". Error: Failed asserting that an array has the key 'key2'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArraysNotEqualForWhenSeveralNotMatchedItemsFoundBeforeCallOfTryMatchIndexedElement()
    {
        $expected = [
            [
                'key1' => 'value1',
                'key2' => [
                    'key21' => 'value21',
                    'key22' => [
                        'key221' => 'value221',
                        'key222' => 'value222',
                        'key223' => 'value223'
                    ]
                ],
                'key3' => [
                    'key31' => [
                        ['type' => 'test', 'key' => '1'],
                        ['type' => 'test', 'key' => '2']
                    ]
                ]
            ]
        ];
        $actual = [
            [
                'key1' => 'value1',
                'key2' => [
                    'key21' => 'value21',
                    'key22' => [
                        'key221' => 'value221',
                        'key222' => 'value222_a',
                        'key223' => 'value223_a'
                    ]
                ],
                'key3' => [
                    'key31' => [
                        ['type' => 'test', 'key' => '2'],
                        ['type' => 'test', 'key' => '1']
                    ]
                ]
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "0.key2.key22.key222". Error: Failed asserting that 'value222_a' is identical to 'value222'.
Path: "0.key2.key22.key223". Error: Failed asserting that 'value223_a' is identical to 'value223'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsWithNestedAttributesAndAndOrderOfElementIsDifferent()
    {
        $expected = [
            'data' => [
                ['id' => '3', 'attributes' => ['attr1' => 'val31']],
                ['id' => '1', 'attributes' => ['attr1' => 'val11']],
                ['id' => '2', 'attributes' => ['attr1' => 'val21']]
            ]
        ];
        $actual = [
            'data' => [
                ['id' => '1', 'attributes' => ['attr1' => 'val11']],
                ['id' => '2', 'attributes' => ['attr1' => 'val21']],
                ['id' => '3', 'attributes' => ['attr1' => 'val31']]
            ]
        ];

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsWhenNestedAttributeOfFirstItemIsNotEqualAndOrderOfNextItemsAreDifferent()
    {
        $expected = [
            'data' => [
                ['id' => '1', 'attributes' => ['attr1' => 'val11', 'attr2' => 'val12']],
                ['id' => '3', 'attributes' => ['attr1' => 'val31']],
                ['id' => '2', 'attributes' => ['attr1' => 'val21']]
            ]
        ];
        $actual = [
            'data' => [
                ['id' => '1', 'attributes' => ['attr1' => 'val11']],
                ['id' => '2', 'attributes' => ['attr1' => 'val21']],
                ['id' => '3', 'attributes' => ['attr1' => 'val31']]
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "data.0.attributes.attr2". Error: Failed asserting that an array has the key 'attr2'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForTwoSimilarItemAndSameOrderOfItems()
    {
        $expected = [
            'data' => [
                ['attributes' => ['attr1' => 'val11']],
                ['attributes' => ['attr1' => 'val41']],
                ['attributes' => ['attr1' => 'val31']],
                ['attributes' => ['attr1' => 'val41', 'attr2' => 'val42']]
            ]
        ];
        $actual = [
            'data' => [
                ['attributes' => ['attr1' => 'val11', 'attr2' => 'val12']],
                ['attributes' => ['attr1' => 'val21', 'attr2' => 'val22']],
                ['attributes' => ['attr1' => 'val31', 'attr2' => 'val32']],
                ['attributes' => ['attr1' => 'val41', 'attr2' => 'val42']]
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "data.1.attributes.attr1". Error: Failed asserting that 'val21' is identical to 'val41'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForTwoSimilarItemAndDifferentOrderOfItems()
    {
        $expected = [
            'data' => [
                ['attributes' => ['attr1' => 'val31']],
                ['attributes' => ['attr1' => 'val41']],
                ['attributes' => ['attr1' => 'val11']],
                ['attributes' => ['attr1' => 'val41', 'attr2' => 'val42']],
                ['attributes' => ['attr1' => 'val21']]
            ]
        ];
        $actual = [
            'data' => [
                ['attributes' => ['attr1' => 'val11', 'attr2' => 'val12']],
                ['attributes' => ['attr1' => 'val21', 'attr2' => 'val22']],
                ['attributes' => ['attr1' => 'val31', 'attr2' => 'val32']],
                ['attributes' => ['attr1' => 'val41', 'attr2' => 'val42']],
                ['attributes' => ['attr1' => 'val51', 'attr2' => 'val52']]
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "data.1.attributes.attr1". Error: Failed asserting that 'val21' is identical to 'val41'.
Path: "data.4.attributes.attr1". Error: Failed asserting that 'val51' is identical to 'val21'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }

    public function testNotStrictArrayContainsForTwoSimilarItemAndTheseItemsKeysDifferentThanInActualData()
    {
        $expected = [
            'data' => [
                ['attributes' => ['attr1' => 'val11']],
                ['attributes' => ['attr1' => 'val31']],
                ['attributes' => ['attr1' => 'val21']],
                ['attributes' => ['attr1' => 'val31', 'attr2' => 'val32']]
            ]
        ];
        $actual = [
            'data' => [
                ['attributes' => ['attr1' => 'val11', 'attr2' => 'val12']],
                ['attributes' => ['attr1' => 'val21', 'attr2' => 'val22']],
                ['attributes' => ['attr1' => 'val31', 'attr2' => 'val32']],
                ['attributes' => ['attr1' => 'val41', 'attr2' => 'val42']]
            ]
        ];
        $expectedMessage = <<<TEXT
Failed asserting that the array contains other array.
Errors:
Path: "data.3.attributes.attr1". Error: Failed asserting that 'val41' is identical to 'val31'.
Path: "data.3.attributes.attr2". Error: Failed asserting that 'val42' is identical to 'val32'.
TEXT;

        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
        $this->expectExceptionMessage($expectedMessage);

        $constraint = new ArrayContainsConstraint($expected, false);
        $constraint->evaluate($actual);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.artech.prototype2</groupId>
    <artifactId>PrototypeV2</artifactId>
    <version>2.0</version>
  </parent>
  <groupId>com.artech.prototype2</groupId>
  <artifactId>Model</artifactId>
  <version>2.0</version>
  <packaging>pom</packaging>
  <name>Model</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
      <dependency>
          <groupId>com.artech.prototype2</groupId>
          <artifactId>Utils</artifactId>
          <version>2.0</version>
      </dependency>
  </dependencies>
  <modules>
    <module>Memory</module>
    <module>Statistics</module>
    <module>SolutionCenter</module>
    <module>Analisys</module>
    <module>SearchEngine</module>
  </modules>
</project>


text:
<script src="{{ "js/jquery-3.1.1.js" }}"></script>
<script src="{{ "js/jquery.easing.min.js" }}"></script>
<script src="{{ "js/pgwslideshow.js" }}"></script>

<!-- Bootstrap Core JavaScript -->
<script src="{{ "js/bootstrap.js" }}"></script>

<script src="{{ "js/classie.js" }}"></script>
<!-- Custom Theme JavaScript -->
<script src="{{ "js/gmb.js" }}"></script>


text:
<?php namespace ZN\Routing;
/**
 * ZN PHP Web Framework
 *
 * "Simplicity is the ultimate sophistication." ~ Da Vinci
 *
 * @package ZN
 * @license MIT [http://opensource.org/licenses/MIT]
 * @author  Ozan UYKUN [ozan@znframework.com]
 */

use ZN\Request;

/**
 * @codeCoverageIgnore
 */
class AjaxFilter
{
    public function __construct($filters, $get, $config, $class)
    {
        if( Request::isAjax() !== true )
        {
            $class->redirectRequest();
        }
    }
}