text:
module Mongoid
  class Criteria
    module Queryable
      module Extensions

        # This module contains additional object behavior.
        module String

          # Evolve the string into a mongodb friendly date.
          #
          # @example Evolve the string.
          #   "2012-1-1".__evolve_date__
          #
          # @return [ Time ] The time at UTC midnight.
          #
          # @since 1.0.0
          def __evolve_date__
            time = ::Time.parse(self)
            ::Time.utc(time.year, time.month, time.day, 0, 0, 0, 0)
          end

          # Evolve the string into a mongodb friendly time.
          #
          # @example Evolve the string.
          #   "2012-1-1".__evolve_time__
          #
          # @return [ Time ] The string as a time.
          #
          # @since 1.0.0
          def __evolve_time__
            __mongoize_time__.utc
          end

          # Get the string as a mongo expression, adding $ to the front.
          #
          # @example Get the string as an expression.
          #   "test".__mongo_expression__
          #
          # @return [ String ] The string with $ at the front.
          #
          # @since 2.0.0
          def __mongo_expression__
            start_with?("$") ? self : "$#{self}"
          end

          # Get the string as a sort option.
          #
          # @example Get the string as a sort option.
          #   "field ASC".__sort_option__
          #
          # @return [ Hash ] The string as a sort option hash.
          #
          # @since 1.0.0
          def __sort_option__
            split(/,/).inject({}) do |hash, spec|
              hash.tap do |_hash|
                field, direction = spec.strip.split(/\s/)
                _hash[field.to_sym] = direction.to_direction
              end
            end
          end

          # Get the string as a specification.
          #
          # @example Get the string as a criteria.
          #   "field".__expr_part__(value)
          #
          # @param [ Object ] value The value of the criteria.
          # @param [ true, false ] negating If the selection should be negated.
          #
          # @return [ Hash ] The selection.
          #
          # @since 1.0.0
          def __expr_part__(value, negating = false)
            ::String.__expr_part__(self, value, negating)
          end

          # Get the string as a sort direction.
          #
          # @example Get the string as a sort direction.
          #   "1".to_direction
          #
          # @return [ Integer ] The direction.
          #
          # @since 1.0.0
          def to_direction
            self =~ /desc/i ? -1 : 1
          end

          module ClassMethods

            # Get the value as a expression.
            #
            # @example Get the value as an expression.
            #   String.__expr_part__("field", value)
            #
            # @param [ String, Symbol ] key The field key.
            # @param [ Object ] value The value of the criteria.
            # @param [ true, false ] negating If the selection should be negated.
            #
            # @return [ Hash ] The selection.
            #
            # @since 2.0.0
            def __expr_part__(key, value, negating = false)
              if negating
                { key => { "$#{value.regexp? ? "not" : "ne"}" => value }}
              else
                { key => value }
              end
            end

            # Evolves the string into a MongoDB friendly value - in this case
            # a string.
            #
            # @example Evolve the string
            #   String.evolve(1)
            #
            # @param [ Object ] object The object to convert.
            #
            # @return [ String ] The value as a string.
            #
            # @since 1.0.0
            def evolve(object)
              __evolve__(object) do |obj|
                obj.regexp? ? obj : obj.to_s
              end
            end
          end
        end
      end
    end
  end
end

::String.__send__(:include, Mongoid::Criteria::Queryable::Extensions::String)
::String.__send__(:extend, Mongoid::Criteria::Queryable::Extensions::String::ClassMethods)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Sturm, Deutschl. Fl. , 3 Abt. (Pilze Deutschl. ) 3(13): 91 (1833)

#### Original name
Memnonium effusum Corda

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package com.opengamma.financial.view.rest;

import java.net.URI;

import javax.ws.rs.core.UriBuilder;

import org.threeten.bp.Instant;

import com.opengamma.id.UniqueId;

/**
 * RESTful URIs for accessing available outputs from a portfolio.
 */
public class DataAvailablePortfolioOutputsUris {

  /**
   * Builds a URI.
   *
   * @param baseUri
   *          the base URI, not null
   * @param instant
   *          the instant, may be null
   * @param maxNodes
   *          the maximum nodes, may be null
   * @param maxPositions
   *          the maximum positions, may be null
   * @param portfolioId
   *          the portfolio identifier, may be null
   * @return the URI, not null
   */
  public static URI uri(final URI baseUri, final Instant instant, final Integer maxNodes, final Integer maxPositions, final UniqueId portfolioId) {
    final UriBuilder bld = UriBuilder.fromUri(DataAvailableOutputsProviderUris.uriPortfolio(baseUri));
    bld.path(instant != null ? instant.toString() : "now");
    if (maxNodes != null && maxNodes > 0) {
      bld.path("nodes").path(Integer.toString(maxNodes));
    }
    if (maxPositions != null && maxPositions > 0) {
      bld.path("positions").path(Integer.toString(maxPositions));
    }
    if (portfolioId != null) {
      bld.path(portfolioId.toString());
    }
    return bld.build();
  }

}


text:
package io.leopard.security.admin;

public class AdminNotFoundException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	public AdminNotFoundException(String message) {
		super(message);
	}

}


text:
param(
    [string]$Product,
    [string]$Target,
    [boolean]$Clean = $True,
    [string]$BuildArgs = "",
    [string]$ProjectPath = "src\$Product.$Target\$Product.$Target.wixproj"
)

[string] $RepoRoot = Resolve-Path "$PSScriptRoot\.."

[string] $OutputRoot = "bld"
[string] $TargetOutputDirectory = "$Product.$Target"

$StartingLocation = Get-Location
Set-Location -Path $RepoRoot

if ($Clean -and (Test-Path "$OutputRoot\$TargetOutputDirectory")) {
    Write-Host "Clean output folder..."
    Remove-Item "$OutputRoot\$TargetOutputDirectory" -Recurse
}

Write-Host "Build setup..."
try
{
    New-Item -Path "$OutputRoot\$TargetOutputDirectory" -ItemType "directory"
    msbuild $BuildArgs.Split() -restore -p:Configuration=Release -p:OutputPath="$RepoRoot\$OutputRoot\$TargetOutputDirectory" "$ProjectPath"
    if (!$?) {
    	throw 'Build failed!'
    }
}
finally
{
    Set-Location -Path "$StartingLocation"
}


text: I am a node wrapping a KomitDefinition


text:
using System;
using System.Runtime.InteropServices;

namespace Vanara.PInvoke
{
	public static partial class Ole32
	{
		///
		/// Obtains information about the categories implemented or required by a certain class, as well as information about the categories
		/// registered on the specified computer.
		///
		// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nn-comcat-icatinformation
		[PInvokeData("comcat.h", MSDNShortId = "NN:comcat.ICatInformation")]
		[ComImport, Guid("0002E013-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
		public interface ICatInformation
		{
			/// Retrieves an enumerator for the component categories registered on the system.
			/// <param name="lcid">
			/// The requested locale for any return szDescription of the enumerated categories. Typically, the caller specifies the value
			/// returned from the GetUserDefaultLCID function.
			/// </param>
			/// <returns>
			/// A pointer to a pointer to an IEnumCATEGORYINFO interface. This can be used to enumerate the CATIDs and localized description
			/// strings of the component categories registered with the system.
			/// </returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatinformation-enumcategories HRESULT EnumCategories(
			// LCID lcid, IEnumCATEGORYINFO **ppenumCategoryInfo );
			IEnumCATEGORYINFO EnumCategories(LCID lcid);

			/// Retrieves the localized description string for a specific category ID.
			/// <param name="rcatid">The category identifier.</param>
			/// <param name="lcid">The locale.</param>
			/// <param name="pszDesc">
			/// A pointer to the string pointer for the description. This string must be released by the caller using the CoTaskMemFree function.
			/// </param>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatinformation-getcategorydesc HRESULT GetCategoryDesc(
			// REFCATID rcatid, LCID lcid, LPWSTR *pszDesc );
			void GetCategoryDesc(in Guid rcatid, LCID lcid, [MarshalAs(UnmanagedType.LPWStr)] out string pszDesc);

			/// Retrieves an enumerator for the classes that implement one or more specified category identifiers.
			/// <param name="cImplemented">
			/// The number of category IDs in the rgcatidImpl array. This value cannot be zero. If this value is -1, classes are included in
			/// the enumeration, regardless of the categories they implement.
			/// </param>
			/// <param name="rgcatidImpl">
			/// <para>An array of category identifiers.</para>
			/// <para>If a class requires a category identifier that is not specified, it is not included in the enumeration.</para>
			/// </param>
			/// <param name="cRequired">
			/// The number of category IDs in the rgcatidReq array. This value can be zero. If this value is -1, classes are included in the
			/// enumeration, regardless of the categories they require.
			/// </param>
			/// <param name="rgcatidReq">An array of category identifiers.</param>
			/// <returns>
			/// A pointer to an IEnumCLSID interface pointer that can be used to enumerate the CLSIDs of the classes that implement the
			/// specified category.
			/// </returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatinformation-enumclassesofcategories HRESULT
			// EnumClassesOfCategories( ULONG cImplemented, const CATID [] rgcatidImpl, ULONG cRequired, const CATID [] rgcatidReq,
			// IEnumGUID **ppenumClsid );
			IEnumGUID EnumClassesOfCategories(uint cImplemented, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] rgcatidImpl, uint cRequired, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] Guid[] rgcatidReq);

			/// Determines whether a class implements one or more categories.
			/// <param name="rclsid">The class identifier.</param>
			/// <param name="cImplemented">
			/// The number of category IDs in the rgcatidImpl array. This value cannot be zero. If this value is -1, the implemented
			/// categories are not tested.
			/// </param>
			/// <param name="rgcatidImpl">
			/// <para>An array of category identifiers.</para>
			/// <para>If the class requires a category not listed in rgcatidReq, it is not included in the enumeration.</para>
			/// </param>
			/// <param name="cRequired">
			/// The number of category IDs in the rgcatidReq array. This value can be zero. If this value is -1, the required categories are
			/// not tested.
			/// </param>
			/// <param name="rgcatidReq">An array of category identifiers.</param>
			/// <returns>If the class ID is of one of the specified categories, the return value is S_OK. Otherwise, is it S_FALSE.</returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatinformation-isclassofcategories HRESULT
			// IsClassOfCategories( REFCLSID rclsid, ULONG cImplemented, const CATID [] rgcatidImpl, ULONG cRequired, const CATID []
			// rgcatidReq );
			[PreserveSig]
			HRESULT IsClassOfCategories(in Guid rclsid, uint cImplemented, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Guid[] rgcatidImpl, uint cRequired, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] Guid[] rgcatidReq);

			/// Retrieves an enumerator for the CATIDs implemented by the specified class.
			/// <param name="rclsid">The class ID.</param>
			/// <returns>
			/// A pointer to an IEnumCATID interface pointer. This can be used to enumerate the CATIDs that are implemented by rclsid.
			/// </returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatinformation-enumimplcategoriesofclass HRESULT
			// EnumImplCategoriesOfClass( REFCLSID rclsid, IEnumGUID **ppenumCatid );
			IEnumGUID EnumImplCategoriesOfClass(in Guid rclsid);

			/// Retrieves an enumerator for the CATIDs required by the specified class.
			/// <param name="rclsid">The class identifier.</param>
			/// <returns>
			/// A pointer to an IEnumCATID interface pointer. This can be used to enumerate the CATIDs that are required by rclsid.
			/// </returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatinformation-enumreqcategoriesofclass HRESULT
			// EnumReqCategoriesOfClass( REFCLSID rclsid, IEnumGUID **ppenumCatid );
			IEnumGUID EnumReqCategoriesOfClass(in Guid rclsid);
		}

		///
		/// Provides methods for registering and unregistering component category information in the registry. This includes both the
		/// human-readable names of categories and the categories implemented/required by a given component or class.
		///
		// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nn-comcat-icatregister
		[ComImport, Guid("0002E012-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
		public interface ICatRegister
		{
			///
			/// Registers one or more component categories. Each component category consists of a CATID and a list of locale-dependent
			/// description strings.
			///
			/// <param name="cCategories">The number of component categories to be registered.</param>
			/// <param name="rgCategoryInfo">
			/// An array of CATEGORYINFO structures, one for each category to be registered. By providing the same CATID for multiple
			/// <c>CATEGORYINFO</c> structures, multiple locales can be registered for the same component category.
			/// </param>
			/// <remarks>
			/// This method can only be called by the owner of a category, usually as part of the installation or de-installation of the
			/// operating system or application.
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatregister-registercategories HRESULT
			// RegisterCategories( ULONG cCategories, CATEGORYINFO [] rgCategoryInfo );
			void RegisterCategories(uint cCategories, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] CATEGORYINFO[] rgCategoryInfo);

			///
			/// Removes the registration of one or more component categories. Each component category consists of a CATID and a list of
			/// locale-dependent description strings.
			///
			/// <param name="cCategories">The number of categories to be removed.</param>
			/// <param name="rgcatid">The CATIDs of the categories to be removed.</param>
			/// <remarks>
			/// <para>
			/// This method will be successful even if one or more of the category IDs specified are not registered. This method can only be
			/// called by the owner of a category, usually as part of the installation or de-installation of the operating system or application.
			/// </para>
			/// <para>
			/// This method does not remove the component category tags from individual classes. To do this, use the
			/// ICatRegister::UnRegisterClassReqCategories method.
			/// </para>
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatregister-unregistercategories HRESULT
			// UnRegisterCategories( ULONG cCategories, CATID [] rgcatid );
			void UnRegisterCategories(uint cCategories, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] rgcatid);

			/// Registers the class as implementing one or more component categories.
			/// <param name="rclsid">The class identifier.</param>
			/// <param name="cCategories">The number of categories to be associated as category identifiers for the class.</param>
			/// <param name="rgcatid">An array of CATIDs to associate as category identifiers for the class.</param>
			/// <remarks>
			/// In case of an error, this method does not ensure that the registry is restored to the state prior to the call. This method
			/// can only be called by the owner of a class, usually as part of the installation of the component.
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatregister-registerclassimplcategories HRESULT
			// RegisterClassImplCategories( REFCLSID rclsid, ULONG cCategories, CATID [] rgcatid );
			void RegisterClassImplCategories(in Guid rclsid, uint cCategories, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Guid[] rgcatid);

			/// Removes one or more implemented category identifiers from a class.
			/// <param name="rclsid">The class identifier.</param>
			/// <param name="cCategories">The number of category CATIDs to be removed.</param>
			/// <param name="rgcatid">An array of CATIDs that are to be removed. Only the category IDs specified in this array are removed.</param>
			/// <remarks>
			/// In case of an error, this method does not ensure that the registry is restored to the state prior to the call. This method
			/// will be successful even if one or more of the category IDs specified are not registered for the class. This method can only
			/// be called by the owner of a class, usually as part of the de-installation of the component.
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatregister-unregisterclassimplcategories HRESULT
			// UnRegisterClassImplCategories( REFCLSID rclsid, ULONG cCategories, CATID [] rgcatid );
			void UnRegisterClassImplCategories(in Guid rclsid, uint cCategories, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Guid[] rgcatid);

			/// Registers the class as requiring one or more component categories.
			/// <param name="rclsid">The class identifier.</param>
			/// <param name="cCategories">The number of category CATIDs to be associated as category identifiers for the class.</param>
			/// <param name="rgcatid">An array of CATIDs to be associated as category identifiers for the class.</param>
			/// <remarks>
			/// In case of an error, this method does not ensure that the registry is restored to the state prior to the call. This method
			/// can only be called by the owner of a class, usually as part of the installation of the component.
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatregister-registerclassreqcategories HRESULT
			// RegisterClassReqCategories( REFCLSID rclsid, ULONG cCategories, CATID [] rgcatid );
			void RegisterClassReqCategories(in Guid rclsid, uint cCategories, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Guid[] rgcatid);

			/// Removes one or more required category identifiers from a class.
			/// <param name="rclsid">The class identifier.</param>
			/// <param name="cCategories">The number of category CATIDs to be removed.</param>
			/// <param name="rgcatid">An array of CATIDs that are to be removed. Only the category IDs specified in this array are removed.</param>
			/// <remarks>
			/// In case of an error, this method does not ensure that the registry is restored to the state prior to the call. This method
			/// will be successful even if one or more of the category IDs specified are not registered for the class.
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-icatregister-unregisterclassreqcategories HRESULT
			// UnRegisterClassReqCategories( REFCLSID rclsid, ULONG cCategories, CATID [] rgcatid );
			void UnRegisterClassReqCategories(in Guid rclsid, uint cCategories, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] Guid[] rgcatid);
		}

		/// Enumerates component categories registered in the system.
		// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nn-comcat-ienumcategoryinfo
		[ComImport, Guid("0002E011-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
		public interface IEnumCATEGORYINFO : Vanara.Collections.ICOMEnum<CATEGORYINFO>
		{
			/// Retrieves the specified number of items in the enumeration sequence.
			/// <param name="celt">
			/// The number of items to be retrieved. If there are fewer than the requested number of items left in the sequence, this method
			/// retrieves the remaining elements.
			/// </param>
			/// <param name="rgelt">
			/// <para>An array of enumerated items.</para>
			/// <para>
			/// The enumerator is responsible for allocating any memory, and the caller is responsible for freeing it. If celt is greater
			/// than 1, the caller must also pass a non-NULL pointer passed to pceltFetched to know how many pointers to release.
			/// </para>
			/// </param>
			/// <param name="pceltFetched">
			/// The number of items that were retrieved. This parameter is always less than or equal to the number of items requested.
			/// </param>
			/// <returns>If the method retrieves the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.</returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumcategoryinfo-next HRESULT Next( ULONG celt,
			// CATEGORYINFO *rgelt, ULONG *pceltFetched );
			[PreserveSig]
			HRESULT Next(uint celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] CATEGORYINFO[] rgelt, out uint pceltFetched);

			/// Skips over the specified number of items in the enumeration sequence.
			/// <param name="celt">The number of items to be skipped.</param>
			/// <returns>If the method skips the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.</returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumcategoryinfo-skip HRESULT Skip( ULONG celt );
			[PreserveSig]
			HRESULT Skip(uint celt);

			/// Resets the enumeration sequence to the beginning.
			/// <remarks>
			/// There is no guarantee that the same set of objects will be enumerated after the reset operation has completed. A static
			/// collection is reset to the beginning, but it can be too expensive for some collections, such as files in a directory, to
			/// guarantee this condition.
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumcategoryinfo-reset HRESULT Reset();
			void Reset();

			///
			/// <para>Creates a new enumerator that contains the same enumeration state as the current one.</para>
			/// <para>
			/// This method makes it possible to record a point in the enumeration sequence in order to return to that point at a later
			/// time. The caller must release this new enumerator separately from the first enumerator.
			/// </para>
			///
			/// <returns>A pointer to the cloned enumerator object.</returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumcategoryinfo-clone HRESULT Clone( IEnumCATEGORYINFO
			// **ppenum );
			IEnumCATEGORYINFO Clone();
		}

		/// Enables clients to enumerate through a collection of class IDs for COM classes.
		/// <remarks>Alternate names for this interface are IEnumCLSID and IEnumCATID.</remarks>
		// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nn-comcat-ienumguid
		[PInvokeData("comcat.h", MSDNShortId = "NN:comcat.IEnumGUID")]
		[ComImport, Guid("0002E000-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
		public interface IEnumGUID : Vanara.Collections.ICOMEnum<Guid>
		{
			/// Retrieves the specified number of items in the enumeration sequence.
			/// <param name="celt">
			/// The number of items to be retrieved. If there are fewer than the requested number of items left in the sequence, this method
			/// retrieves the remaining elements.
			/// </param>
			/// <param name="rgelt">
			/// <para>An array of enumerated items.</para>
			/// <para>
			/// The enumerator is responsible for allocating any memory, and the caller is responsible for freeing it. If celt is greater
			/// than 1, the caller must also pass a non-NULL pointer passed to pceltFetched to know how many pointers to release.
			/// </para>
			/// </param>
			/// <param name="pceltFetched">
			/// The number of items that were retrieved. This parameter is always less than or equal to the number of items requested.
			/// </param>
			/// <returns>If the method retrieves the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.</returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumguid-next HRESULT Next( ULONG celt, GUID *rgelt,
			// ULONG *pceltFetched );
			[PreserveSig]
			HRESULT Next(uint celt, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] rgelt, out uint pceltFetched);

			/// Skips over the specified number of items in the enumeration sequence.
			/// <param name="celt">The number of items to be skipped.</param>
			/// <returns>If the method skips the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.</returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumguid-skip HRESULT Skip( ULONG celt );
			[PreserveSig]
			HRESULT Skip(uint celt);

			/// Resets the enumeration sequence to the beginning.
			/// <remarks>
			/// There is no guarantee that the same set of objects will be enumerated after the reset operation has completed. A static
			/// collection is reset to the beginning, but it can be too expensive for some collections, such as files in a directory, to
			/// guarantee this condition.
			/// </remarks>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumguid-reset HRESULT Reset();
			void Reset();

			///
			/// <para>Creates a new enumerator that contains the same enumeration state as the current one.</para>
			/// <para>
			/// This method makes it possible to record a point in the enumeration sequence in order to return to that point at a later
			/// time. The caller must release this new enumerator separately from the first enumerator.
			/// </para>
			///
			/// <returns>A pointer to the cloned enumerator object.</returns>
			// https://docs.microsoft.com/en-us/windows/win32/api/comcat/nf-comcat-ienumguid-clone HRESULT Clone( IEnumGUID **ppenum );
			IEnumGUID Clone();
		}

		/// Describes a component category.
		// https://docs.microsoft.com/en-us/windows/win32/api/comcat/ns-comcat-categoryinfo typedef struct tagCATEGORYINFO { Guid catid;
		// LCID lcid; OLECHAR szDescription[128]; } CATEGORYINFO, *LPCATEGORYINFO;
		[PInvokeData("comcat.h", MSDNShortId = "NS:comcat.tagCATEGORYINFO")]
		[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
		public struct CATEGORYINFO
		{
			/// The category identifier for the component.
			public Guid catid;

			/// The locale identifier. See Language Identifier Constants and Strings.
			public LCID lcid;

			/// The description of the category (cannot exceed 128 characters).
			[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
			public string szDescription;
		}
	}
}


text:
import store from "../store/get-store.js";
import broadcaster from "../broadcaster.js";
import { multiStream2 } from "../multi-stream.js";
import { metricPoll } from "../metrics/metric-polling.js";

export const dashboardFsB = async () => {
  return broadcaster(
    multiStream2([store.select("fileSystems").map(Object.values), await metricPoll()]).map(([filesystems, metrics]) => {
      return filesystems.map(fs => {
        if (metrics[fs.id] != null)
          return {
            ...fs,
            ...metrics[fs.id],
            client_count: metrics[fs.id].client_count / fs.mdts.length
          };
        else return fs;
      });
    })
  );
};

export const dashboardHostB = () => {
  return broadcaster(store.select("server").map(Object.values));
};

export const dashboardTargetB = () => {
  return broadcaster(store.select("targets"));
};


text:
'use strict';

/**
 * @ngdoc function
 * @name startupApp.controller:AboutCtrl
 * @description
 * # AboutCtrl
 * Controller of the startupApp
 */
angular.module('startupApp')
  .controller('AboutCtrl', function () {
    this.awesomeThings = [
      'HTML5 Boilerplate',
      'AngularJS',
      'Karma'
    ];
  });


text:
 * Fix message body encoding is observed correctly in QP CTE. (thanks [Mark Dodwell](https://github.com/mkdynamic))

## 1.2.0 ##

  * Fix auto_link() which in some cases would return an empty <a> tag for plain text messages. (thanks [Kevin McPhillips](https://github.com/kmcphillips))
  * Update styles. (thanks [Adam Doppelt](https://github.com/gurgeous))

## 1.1.2 ##

  * Show formatted display names in html template (thanks [ClaireMcGinty](https://github.com/ClaireMcGinty))
  * Use `file:///` uri scheme to fix Launchy on Windows.

## 1.1.1 ##

  * Handle cc and bcc as array of emails. (thanks [jordandcarter](https://github.com/jordandcarter))
  * Use `file://` uri scheme since Launcy can't open escaped URL without it. (thanks [Adrian2112](https://github.com/Adrian2112))
  * Update Launchy dependency to `~> 2.2` (thanks [JeanMertz](https://github.com/JeanMertz))
  * Change all nonword chars in filename of attachment to underscore so
    it can be saved on all platforms. (thanks [phallstrom](https://github.com/phallstrom))

## 1.1.0 ##

  * Update Launchy dependency to `~> 2.2.0` (thanks [webdevotion](https://github.com/webdevotion))
  * Handle `sender` field (thanks [sjtipton](https://github.com/sjtipton))
  * Show subject only if it's present (thanks [jadehyper](https://github.com/jadehyper))
  * Show subject as title of web page (thanks [statique](https://github.com/statique))

## 1.0.0 ##

  * Attachment Support (thanks [David Cornu](https://github.com/davidcornu))
  * Escape HTML in subject and other fields
  * Raise an exception if the :location option is not present instead of using a default
  * Open rich version by default (thanks [Damir](https://github.com/sidonath))
  * Override margin on dt and dd elements in CSS (thanks [Edgars Beigarts](https://github.com/ebeigarts))
  * Autolink URLs in plain version (thanks [Matt Burke](https://github.com/spraints))

## 0.1.0 ##

  * From and To show name and Email when specified
  * Fix bug when letter_opener couldn't open email in Windows
  * Handle spaces in the application path (thanks [Mike Boone](https://github.com/boone))
  * As letter_opener doesn't work with Launchy < 2.0.4 let's depend on >= 2.0.4 (thanks [Samnang Chhun](https://github.com/samnang))
  * Handle `reply_to` field (thanks [Wes Gibbs](https://github.com/wgibbs))
  * Set the charset in email preview (thanks [Bruno Michel](https://github.com/nono))

## 0.0.2 ##

  * Fixing launchy requirement (thanks [Bruno Michel](https://github.com/nono))

## 0.0.1 ##

  * Initial relase


text:
DELIMITER //

CREATE PROCEDURE GetUserById
(
    userId int
)
BEGIN
    SELECT
        Id,
        Email,
        Password,
        FirstName,
        LastName,
        RegistrationDate,
        LastUpdateDate
    FROM
        User
    WHERE Id = userId;
END//

DELIMITER ;


text:
AliAnalysisTask *AddTaskJFlowBaseTask(TString taskName,Bool_t isMC){
	// Load Custom Configuration and parameters
	// override values with parameters

	AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();

	//==== Set up di-hadron correlation jT task ====
	AliJFlowBaseTask *flowTask = new AliJFlowBaseTask(taskName.Data(),"AOD");
	flowTask->SetDebugLevel(5);
  	flowTask->SetJCatalystTaskName("JCatalystTaskEP");  // AliJCatalystTask has this name hard coded
	flowTask->SetIsMC(isMC);
	cout << flowTask->GetName() << endl;

	mgr->AddTask((AliAnalysisTask*) flowTask);

	// Create containers for input/output
	AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();

	// Connect input/output
	mgr->ConnectInput(flowTask, 0, cinput);
	AliAnalysisDataContainer *jHist = mgr->CreateContainer(Form("%scontainer",flowTask->GetName()),  TDirectory::Class(), AliAnalysisManager::kOutputContainer, Form("%s:%s",AliAnalysisManager::GetCommonFileName(), flowTask->GetName()));
	mgr->ConnectOutput(flowTask, 1, jHist );

	return flowTask;
}


text:
<?php namespace Exchange\EWSType; use Exchange\EWSType;
/**
 * Contains EWSType_BaseGroupByType.
 */

/**
 * Base class for item ordering.
 *
 * @package php-ews\Types
 */
class EWSType_BaseGroupByType extends EWSType
{
    /**
     * Determines the order of the groups in the grouped item array that is
     * returned in the response.
     *
     * @since Exchange 2007
     *
     * @var EWSType_SortDirectionType
     */
    public $Order;
}


text:
package ExamPreparationI.viceCity.common;

public enum  Command {
    AddPlayer,
    AddGun,
    AddGunToPlayer,
    Fight,
    Exit,
}


text:
module ClassOptionsHelper
end


text:
package org.elasticsearch.index.mapper.internal;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexOptions;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.Query;
import org.elasticsearch.Version;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.lucene.all.AllField;
import org.elasticsearch.common.lucene.all.AllTermQuery;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.fielddata.FieldDataType;
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.index.mapper.MapperParsingException;
import org.elasticsearch.index.mapper.MetadataFieldMapper;
import org.elasticsearch.index.mapper.ParseContext;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.index.similarity.SimilarityService;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeBooleanValue;
import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeMapValue;
import static org.elasticsearch.index.mapper.core.TypeParsers.parseTextField;

/**
 *
 */
public class AllFieldMapper extends MetadataFieldMapper {

    public interface IncludeInAll {

        /**
         * If {@code includeInAll} is not null then return a copy of this mapper
         * that will include values in the _all field according to {@code includeInAll}.
         */
        Mapper includeInAll(Boolean includeInAll);

        /**
         * If {@code includeInAll} is not null and not set on this mapper yet, then
         * return a copy of this mapper that will include values in the _all field
         * according to {@code includeInAll}.
         */
        Mapper includeInAllIfNotSet(Boolean includeInAll);

        /**
         * If {@code includeInAll} was already set on this mapper then return a copy
         * of this mapper that has {@code includeInAll} not set.
         */
        Mapper unsetIncludeInAll();
    }

    public static final String NAME = "_all";

    public static final String CONTENT_TYPE = "_all";

    public static class Defaults {
        public static final String NAME = AllFieldMapper.NAME;
        public static final String INDEX_NAME = AllFieldMapper.NAME;
        public static final EnabledAttributeMapper ENABLED = EnabledAttributeMapper.UNSET_ENABLED;

        public static final MappedFieldType FIELD_TYPE = new AllFieldType();

        static {
            FIELD_TYPE.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
            FIELD_TYPE.setTokenized(true);
            FIELD_TYPE.setName(NAME);
            FIELD_TYPE.freeze();
        }
    }

    public static class Builder extends MetadataFieldMapper.Builder<Builder, AllFieldMapper> {

        private EnabledAttributeMapper enabled = Defaults.ENABLED;

        public Builder(MappedFieldType existing) {
            super(Defaults.NAME, existing == null ? Defaults.FIELD_TYPE : existing, Defaults.FIELD_TYPE);
            builder = this;
            indexName = Defaults.INDEX_NAME;
        }

        public Builder enabled(EnabledAttributeMapper enabled) {
            this.enabled = enabled;
            return this;
        }

        @Override
        public AllFieldMapper build(BuilderContext context) {
            // In case the mapping overrides these
            // TODO: this should be an exception! it doesnt make sense to not index this field
            if (fieldType.indexOptions() == IndexOptions.NONE) {
                fieldType.setIndexOptions(Defaults.FIELD_TYPE.indexOptions());
            }
            fieldType.setTokenized(true);

            return new AllFieldMapper(fieldType, enabled, context.indexSettings());
        }
    }

    public static class TypeParser implements MetadataFieldMapper.TypeParser {
        @Override
        public MetadataFieldMapper.Builder parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
            Builder builder = new Builder(parserContext.mapperService().fullName(NAME));

            // parseField below will happily parse the doc_values setting, but it is then never passed to
            // the AllFieldMapper ctor in the builder since it is not valid. Here we validate
            // the doc values settings (old and new) are rejected
            Object docValues = node.get("doc_values");
            if (docValues != null && nodeBooleanValue(docValues)) {
                throw new MapperParsingException("Field [" + name + "] is always tokenized and cannot have doc values");
            }
            // convoluted way of specifying doc values
            Object fielddata = node.get("fielddata");
            if (fielddata != null) {
                Map<String, Object> fielddataMap = nodeMapValue(fielddata, "fielddata");
                Object format = fielddataMap.get("format");
                if ("doc_values".equals(format)) {
                    throw new MapperParsingException("Field [" + name + "] is always tokenized and cannot have doc values");
                }
            }

            parseTextField(builder, builder.name, node, parserContext);
            for (Iterator<Map.Entry<String, Object>> iterator = node.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry<String, Object> entry = iterator.next();
                String fieldName = Strings.toUnderscoreCase(entry.getKey());
                Object fieldNode = entry.getValue();
                if (fieldName.equals("enabled")) {
                    builder.enabled(nodeBooleanValue(fieldNode) ? EnabledAttributeMapper.ENABLED : EnabledAttributeMapper.DISABLED);
                    iterator.remove();
                } else if (fieldName.equals("auto_boost") && parserContext.indexVersionCreated().before(Version.V_2_0_0_beta1)) {
                    // Old 1.x setting which is now ignored
                    iterator.remove();
                }
            }
            return builder;
        }

        @Override
        public MetadataFieldMapper getDefault(Settings indexSettings, MappedFieldType fieldType, String typeName) {
            return new AllFieldMapper(indexSettings, fieldType);
        }
    }

    static final class AllFieldType extends MappedFieldType {

        public AllFieldType() {
            setFieldDataType(new FieldDataType("string"));
        }

        protected AllFieldType(AllFieldType ref) {
            super(ref);
        }

        @Override
        public MappedFieldType clone() {
            return new AllFieldType(this);
        }

        @Override
        public String typeName() {
            return CONTENT_TYPE;
        }

        @Override
        public String value(Object value) {
            if (value == null) {
                return null;
            }
            return value.toString();
        }

        @Override
        public Query queryStringTermQuery(Term term) {
            return new AllTermQuery(term);
        }

        @Override
        public Query termQuery(Object value, QueryShardContext context) {
            return queryStringTermQuery(createTerm(value));
        }
    }

    private EnabledAttributeMapper enabledState;

    private AllFieldMapper(Settings indexSettings, MappedFieldType existing) {
        this(existing == null ? Defaults.FIELD_TYPE.clone() : existing.clone(), Defaults.ENABLED, indexSettings);
    }

    private AllFieldMapper(MappedFieldType fieldType, EnabledAttributeMapper enabled, Settings indexSettings) {
        super(NAME, fieldType, Defaults.FIELD_TYPE, indexSettings);
        this.enabledState = enabled;

    }

    public boolean enabled() {
        return this.enabledState.enabled;
    }

    @Override
    public void preParse(ParseContext context) throws IOException {
    }

    @Override
    public void postParse(ParseContext context) throws IOException {
        super.parse(context);
    }

    @Override
    public Mapper parse(ParseContext context) throws IOException {
        // we parse in post parse
        return null;
    }

    @Override
    protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException {
        if (!enabledState.enabled) {
            return;
        }
        // reset the entries
        context.allEntries().reset();
        Analyzer analyzer = findAnalyzer(context);
        fields.add(new AllField(fieldType().name(), context.allEntries(), analyzer, fieldType()));
    }

    private Analyzer findAnalyzer(ParseContext context) {
        Analyzer analyzer = fieldType().indexAnalyzer();
        if (analyzer == null) {
            analyzer = context.docMapper().mappers().indexAnalyzer();
            if (analyzer == null) {
                // This should not happen, should we log warn it?
                analyzer = Lucene.STANDARD_ANALYZER;
            }
        }
        return analyzer;
    }

    @Override
    protected String contentType() {
        return CONTENT_TYPE;
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        boolean includeDefaults = params.paramAsBoolean("include_defaults", false);
        if (!includeDefaults) {
            // simulate the generation to make sure we don't add unnecessary content if all is default
            // if all are defaults, no need to write it at all - generating is twice is ok though
            BytesStreamOutput bytesStreamOutput = new BytesStreamOutput(0);
            XContentBuilder b =  new XContentBuilder(builder.contentType().xContent(), bytesStreamOutput);
            b.startObject().flush();
            long pos = bytesStreamOutput.position();
            innerToXContent(b, false);
            b.flush();
            if (pos == bytesStreamOutput.position()) {
                return builder;
            }
        }
        builder.startObject(CONTENT_TYPE);
        innerToXContent(builder, includeDefaults);
        builder.endObject();
        return builder;
    }

    private void innerToXContent(XContentBuilder builder, boolean includeDefaults) throws IOException {
        if (includeDefaults || enabledState != Defaults.ENABLED) {
            builder.field("enabled", enabledState.enabled);
        }
        if (includeDefaults || fieldType().stored() != Defaults.FIELD_TYPE.stored()) {
            builder.field("store", fieldType().stored());
        }
        if (includeDefaults || fieldType().storeTermVectors() != Defaults.FIELD_TYPE.storeTermVectors()) {
            builder.field("store_term_vectors", fieldType().storeTermVectors());
        }
        if (includeDefaults || fieldType().storeTermVectorOffsets() != Defaults.FIELD_TYPE.storeTermVectorOffsets()) {
            builder.field("store_term_vector_offsets", fieldType().storeTermVectorOffsets());
        }
        if (includeDefaults || fieldType().storeTermVectorPositions() != Defaults.FIELD_TYPE.storeTermVectorPositions()) {
            builder.field("store_term_vector_positions", fieldType().storeTermVectorPositions());
        }
        if (includeDefaults || fieldType().storeTermVectorPayloads() != Defaults.FIELD_TYPE.storeTermVectorPayloads()) {
            builder.field("store_term_vector_payloads", fieldType().storeTermVectorPayloads());
        }
        if (includeDefaults || fieldType().omitNorms() != Defaults.FIELD_TYPE.omitNorms()) {
            builder.field("omit_norms", fieldType().omitNorms());
        }

        doXContentAnalyzers(builder, includeDefaults);

        if (fieldType().similarity() != null) {
            builder.field("similarity", fieldType().similarity().name());
        } else if (includeDefaults) {
            builder.field("similarity", SimilarityService.DEFAULT_SIMILARITY);
        }
    }

    @Override
    protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {
        if (((AllFieldMapper)mergeWith).enabled() != this.enabled() && ((AllFieldMapper)mergeWith).enabledState != Defaults.ENABLED) {
            throw new IllegalArgumentException("mapper [" + fieldType().name() + "] enabled is " + this.enabled() + " now encountering "+ ((AllFieldMapper)mergeWith).enabled());
        }
        super.doMerge(mergeWith, updateAllTypes);
    }

    @Override
    public boolean isGenerated() {
        return true;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: 20799 -->
<!-- Reviewed: no -->
<sect1 id="zend.translate.introduction">
    <title>Introduction</title>

    <para>
        <classname>Zend_Translate</classname> est la solution de Zend Framework pour des
        applications multilingues.
    </para>

    <para>
        Dans des applications multilingues, le contenu doit être traduit en plusieurs langues
        et l'affichage du contenu dépend de la langue de l'utilisateur. <acronym>PHP</acronym> offre déjà plusieurs
        manières de manipuler de tels problèmes, toutefois la solution <acronym>PHP</acronym> a quelques problèmes
        :
    </para>

    <itemizedlist>
        <listitem>
            <para>
                <emphasis>API contradictoire :</emphasis> Il n'y a pas d'API unique pour les
                différents formats de source. L'utilisation du gettext par exemple est très
                compliquée.
            </para>
        </listitem>

        <listitem>
            <para>
                <emphasis>PHP supporte seulement gettext et les tableaux natifs :</emphasis>
                <acronym>PHP</acronym> lui-même offre seulement le support des tableaux ou du gettext. Tous autres
                formats de source doivent être codés manuellement, parce qu'il n'y a aucun support
                native.
            </para>
        </listitem>

        <listitem>
            <para>
                <emphasis>Pas de détection de la langue par défaut :</emphasis> La langue par
                défaut de l'utilisateur ne peut pas être détectée sans une connaissance plus
                approfondie des différents navigateurs Web.
            </para>
        </listitem>

        <listitem>
            <para>
                <emphasis>Gettext n'est pas "thread-safe" :</emphasis> La bibliothèque gettext
                de <acronym>PHP</acronym> n'est pas "thread safe", et elle ne devrait pas être employée dans un
                environnement multi-threading. C'est dû à des problèmes de gettext lui-même, pas de
                <acronym>PHP</acronym>, mais c'est un problème existant.
            </para>
        </listitem>
    </itemizedlist>

    <para>
        <classname>Zend_Translate</classname> n'a pas les problèmes ci-dessus. C'est pourquoi
        nous recommandons d'employer <classname>Zend_Translate</classname> au lieu des fonctions
        natives de <acronym>PHP</acronym>. Les avantages de <classname>Zend_Translate</classname> sont :
    </para>

    <itemizedlist>
        <listitem>
            <para>
                <emphasis>Support des formats multiples de source :</emphasis>
                <classname>Zend_Translate</classname> supporte plusieurs formats de source, y
                compris ceux supportés par <acronym>PHP</acronym>, et d'autres formats comprenant les fichiers de type
                TMX et CSV.
            </para>
        </listitem>

        <listitem>
            <para>
                <emphasis>Thread-safe gettext :</emphasis> Le lecteur de gettext de
                <classname>Zend_Translate</classname> est "thread-safe". Il n'y a aucun problème en
                utilisant le dans les environnements multi-threadés.
            </para>
        </listitem>

        <listitem>
            <para>
                <emphasis>API générique et facile :</emphasis> L'API de
                <classname>Zend_Translate</classname> est très simple et exige seulement une poignée
                de fonctions. Ainsi il est facile d'apprendre et facile à maintenir. Tous les
                formats de source sont manipulés la même manière, ainsi si le format de vos fichiers
                source changent de Gettext en TMX, vous devez seulement changer une ligne de code
                pour indiquer l'adaptateur de stockage.
            </para>
        </listitem>

        <listitem>
            <para>
                <emphasis>Détection de la langue de l'utilisateur :</emphasis>
                <classname>Zend_Translate</classname> peut détecter et se servir de la langue
                préférée de l'utilisateur accédant à l'application.
            </para>
        </listitem>

        <listitem>
            <para>
                <emphasis>Détection automatique de la source :</emphasis>
                <classname>Zend_Translate</classname> est capable de détecter et d'intégrer des
                fichiers source multiples et de détecter de plus la localisation à utiliser selon
                les répertoires ou les noms de fichier.
            </para>
        </listitem>
    </itemizedlist>

    <sect2 id="zend.translate.introduction.adapters">
        <title>Démarrer avec le multi-linguisme</title>

        <para>
            Ce que nous voulons faire c'est traduire les chaînes de caractère générées afin
            que la vue produise un contenu traduit. Autrement nous devrions écrire une vue pour
            chaque langue, et personne ne voudraient faire ceci. Généralement, les sites
            multilingues sont très simples dans leur conception. Il y a seulement quatre étapes que
            vous devrez faire :
        </para>

        <orderedlist numeration="arabic">
            <listitem>
                <para>Décider quel adaptateur vous voulez utiliser</para>
            </listitem>

            <listitem>
                <para>
                    Créer votre vue et intégrer <classname>Zend_Translate</classname> à votre
                    code
                </para>
            </listitem>

            <listitem>
                <para>Créer le fichier source de votre code</para>
            </listitem>

            <listitem>
                <para>Traduire votre fichier source dans les langues désirées.</para>
            </listitem>
        </orderedlist>

        <para>
            Les sections suivantes vous guident par chacune des quatre étapes. Lisez les pages
            suivantes pour créer votre propre application Web multilingue.
        </para>
    </sect2>
</sect1>


text:
<?php

namespace Dan\UserBundle\Controller;

use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpFoundation\Response;
use FOS\UserBundle\Model\UserInterface;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\FOSUserEvents;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

use Dan\CommonBundle\Controller\Controller;

/**
 * @Route("/profile")
 */
class ProfileController extends Controller
{

    /**
     * @Route("/redirect", name="fos_user_profile_show")
     */
    public function fosShowAction()
    {
        return $this->redirect($this->generateUrl('sonata_user_profile_show'));
    }

    public function showAction()
    {
        if ($user = $this->get('user')) {
            return $this->redirect($this->generateUrl('sonata_user_profile_edit'));
        }

        return parent::showAction();
    }

    /**
     * @return Response
     *
     * @throws AccessDeniedException
     */
    public function editProfileAction()
    {
        $user = $this->container->get('security.context')->getToken()->getUser();
        $userManager = $this->container->get('model.manager.user');

        if (!is_object($user) || !$user instanceof UserInterface) {
            throw new AccessDeniedException('This user does not have access to this section.');
        }

        $user = $userManager->findUserBy(array('id' => $user->getId()));

        $accountForm = $this->getAccountForm($user);
        $passwordChangeForm = $this->getPasswordChangeForm($user);

        return $this->render('DanUserBundle:Profile:edit.html.twig', array(
            'user' => $user,
            'accountForm' => $accountForm->createView(),
            'changePasswordForm' => $passwordChangeForm->createView(),
        ));
    }

    /**
     * @param string $action
     * @param string $value
     */
    protected function setFlash($action, $value)
    {
        $this->container->get('session')->setFlash($action, $value);
    }

    protected function getRequestDataFormName()
    {
        $request = $this->getRequest();
        $data = $request->request->all();
        if (count($data)) {
            $typeName = array_keys($data);
            return $typeName[0];
        }
        return null;
    }

    protected function getAccountForm($user)
    {
        $confirmationEnabled = $this->container->getParameter('fos_user.registration.confirmation.enabled');

        $form = $this->get('sonata_user_authentication_form');
        $form->setData($user);
        $formHandler = $this->get('sonata_user_authentication_form_handler');

        if ($this->getRequestDataFormName()==$form->getName()) {
            $process = $formHandler->process($user, $confirmationEnabled);

            if ($process) {
                $this->get('session')->getFlashBag()->add('info','profile.flash.updated');
            }
        }
        return $form;
    }

    protected function getPasswordChangeForm($user)
    {
        $form = $this->get('fos_user.change_password.form');
        $formHandler = $this->get('fos_user.change_password.form.handler');

        if ($this->getRequestDataFormName()==$form->getName()) {
            $process = $formHandler->process($user);
            if ($process) {
                $this->get('session')->getFlashBag()->add('info', 'change_password.flash.success');
            }
        }

        return $form;
    }
}


text:
'use strict';
module.exports = (FirmService, promiseHandler) => {
    const BaseController = require('./base');

    Object.setPrototypeOf(FirmController.prototype, BaseController.prototype);

    function FirmController(FirmService, promiseHandler) {
        BaseController.call(this, FirmService, promiseHandler);

        this.routes['/'] = [{method: 'get', cb: readAll},
            {method: 'post', cb: create},
            {method: 'put', cb: update},
            {method: 'delete', cb: deleteFirm}];

        this.registerRoutes();
        return this.router;

        function update(req, res) {

            FirmService.update(req).then((result) => {
                res.json(result)
            }).catch((err) => res.send({error: err.message}));
        }

        function deleteFirm(req, res) {
            let keys = Object.keys(req.query.data);
            let key = Number.parseInt(keys[0]);
            promiseHandler(res,
                FirmService.delete(req.query.data[key].id)
            );
        }

        function create(req, res) {

            FirmService.create(req.body).then((result) => {
                res.status(201).json(result)
            }).catch((err) => res.send({error: err.message}));
        }

        function readAll(req, res) {
            FirmService.readChunk(req.query)
                .then((result) => {
                    res.json(result);
                })
                .catch((err) => res.send({error: err.message}));
        }
    }

    return new FirmController(FirmService, promiseHandler);
};


text:
<?php

namespace Stack\DI;

use stdClass;

/**
 * Test class for Container.
 */
class ContainerGetTest extends \PHPUnit_Framework_TestCase
{
    public function testSetGet()
    {
        $container = ContainerBuilder::buildDevContainer();
        $dummy     = new stdClass();
        $container->set('key', $dummy);
        $this->assertSame($dummy, $container->get('key'));
    }

    public function testGetWithClassName()
    {
        $container = ContainerBuilder::buildDevContainer();
        $this->assertInstanceOf('stdClass', $container->get('stdClass'));
    }

    /**
     * Tests a class can be initialized with a parameter passed by reference.
     */
    public function testPassByReferenceParameter()
    {
        if (version_compare(phpversion(), '7.0.0', '<')) {
            $container = ContainerBuilder::buildDevContainer();
            $object    = $container->get('Stack\DI\Fixtures\PassByReferenceDependency');
            $this->assertInstanceOf('Stack\DI\Fixtures\PassByReferenceDependency', $object);
        }
    }
}


text:
<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>

    <groupId>fallk</groupId>
    <artifactId>jfunktion</artifactId>
    <!-- Maven 3.x and above should treat revXX properly -->
    <version>rev-SNAPSHOT</version> <!-- Automatically changed during appveyor build -->
    <packaging>jar</packaging>

    <name>jfunktion</name>
    <url>https://github.com/uwx/JFunktion</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <distributionManagement>
        <repository>
            <id>internal.repo</id>
            <name>Temporary Staging Repository</name>
            <url>file://${project.build.directory}/mvn-repo</url>
        </repository>
    </distributionManagement>

    <dependencies>
        <!-- <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.12</version>
        </dependency> -->
        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>20020829</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>java8-doclint-disabled</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
        </profile>
    </profiles>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <reportSets>
                    <reportSet><!-- by default, id = "default" -->
                        <reports><!-- select non-aggregate reports -->
                            <report>javadoc-no-fork</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                    <additionalparam>${javadoc.opts}</additionalparam>
                    <quiet>true</quiet>
                </configuration>
                <!--<executions>-->
                    <!--<execution>-->
                        <!--<id>attach-javadocs</id>-->
                        <!--<goals>-->
                            <!--<goal>jar</goal>-->
                        <!--</goals>-->
                        <!--<configuration>-->
                            <!--<additionalparam>${javadoc.opts}</additionalparam>-->
                            <!--<quiet>true</quiet>-->
                        <!--</configuration>-->
                    <!--</execution>-->
                <!--</executions>-->
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.9</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependencies</report>
                            <report>project-team</report>
                            <report>issue-tracking</report>
                            <report>license</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.1</version>
                <configuration>
                    <altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalparam>${javadoc.opts}</additionalparam>
                            <quiet>true</quiet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.6</version>
                <configuration>
                    <!--<reportPlugins>-->
                        <!--<plugin>-->
                            <!--<groupId>org.apache.maven.plugins</groupId>-->
                            <!--<artifactId>maven-javadoc-plugin</artifactId>-->
                            <!--<version>2.9</version>-->
                            <!--<configuration>-->
                                <!--<additionalparam>${javadoc.opts}</additionalparam>-->
                                <!--<quiet>true</quiet>-->
                            <!--</configuration>-->
                        <!--</plugin>-->

                        <!--<plugin>-->
                            <!--<groupId>org.apache.maven.plugins</groupId>-->
                            <!--<artifactId>maven-project-info-reports-plugin</artifactId>-->
                            <!--<version>2.2</version>-->
                            <!--<configuration>-->
                                <!--<dependencyDetailsEnabled>true</dependencyDetailsEnabled>-->
                                <!--<dependencyLocationsEnabled>true</dependencyLocationsEnabled>-->
                            <!--</configuration>-->
                        <!--</plugin>-->
                        <!--<plugin>-->
                            <!--<groupId>org.apache.maven.plugins</groupId>-->
                            <!--<artifactId>maven-surefire-report-plugin</artifactId>-->
                            <!--<version>2.6</version>-->
                        <!--</plugin>-->
                        <!--<plugin>-->
                            <!--<groupId>org.apache.maven.plugins</groupId>-->
                            <!--<artifactId>maven-checkstyle-plugin</artifactId>-->
                            <!--<version>2.6</version>-->
                        <!--</plugin>-->
                    <!--</reportPlugins>-->
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <configuration>
                            <target name="building">
                                <echo>
                                    ISNTALL NODEJS
                                </echo>

                                <!--<exec executable="bash" dir="${project.basedir}"
                                osfamily="unix" failonerror="true">
                                    <arg line="install_node.sh"/>
                                </exec>-->

                                <!--<if>
                                  <equals arg1="${project.basedir}" arg2="/home/jitpack/build" />
                                  <then>
                                    <exec executable="bash" dir="${project.basedir}"
                                    osfamily="unix" failonerror="true">
                                        <arg line="install_node.sh"/>
                                    </exec>
                                  </then>
                                  <else>
                                    <echo message="Not JitPack build" />
                                  </else>
                                </if>-->

                                <echo>
                                    NPM CONFIG SET COLOR FALSE
                                </echo>
                                <exec executable="cmd" dir="${project.basedir}"
                                      osfamily="windows" failonerror="true">
                                    <arg line="/c npm config set color false"/>
                                </exec>
                                <exec executable="bash" dir="${project.basedir}"
                                      osfamily="unix" failonerror="true">
                                    <arg line="npm config set color false"/>
                                </exec>
                                <echo>
                                    NPM INSTALL
                                </echo>
                                <exec executable="cmd" dir="${project.basedir}"
                                      osfamily="windows" failonerror="true">
                                    <arg line="/c npm install"/>
                                </exec>
                                <exec executable="bash" dir="${project.basedir}"
                                      osfamily="unix" failonerror="true">
                                    <arg line="npm install"/>
                                </exec>
                                <echo>
                                    RUN NODE
                                </echo>

                                <exec executable="cmd" dir="${project.basedir}"
                                      osfamily="windows" failonerror="true">
                                    <arg line="/c node generator"/>
                                </exec>
                                <exec executable="bash" dir="${project.basedir}"
                                      osfamily="unix" failonerror="true">
                                    <arg line="node generator"/>
                                </exec>

                                <exec executable="cmd" dir="${project.basedir}"
                                      osfamily="windows" failonerror="true">
                                    <arg line="/c node newgen"/>
                                </exec>
                                <exec executable="bash" dir="${project.basedir}"
                                      osfamily="unix" failonerror="true">
                                    <arg line="node newgen"/>
                                </exec>

                                <!--<condition property="cmdsuccess">
                                    <equals arg1="${cmdresult}" arg2="0"/>
                                </condition>
                                <fail unless="cmdsuccess"/>-->
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>


text:
<?php

final class PhabricatorPolicyExplainController
  extends PhabricatorPolicyController {

  public function shouldAllowPublic() {
    return true;
  }

  public function handleRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();

    $phid = $request->getURIData('phid');
    $capability = $request->getURIData('capability');

    $object = id(new PhabricatorObjectQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($phid))
      ->executeOne();
    if (!$object) {
      return new Aphront404Response();
    }

    $policies = PhabricatorPolicyQuery::loadPolicies(
      $viewer,
      $object);

    $policy = idx($policies, $capability);
    if (!$policy) {
      return new Aphront404Response();
    }

    $handle = id(new PhabricatorHandleQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($phid))
      ->executeOne();

    $object_name = $handle->getName();
    $object_uri = nonempty($handle->getURI(), '/');

    $dialog = id(new AphrontDialogView())
      ->setUser($viewer)
      ->setClass('aphront-access-dialog aphront-policy-explain-dialog')
      ->setTitle(pht('Policy Details: %s', $object_name))
      ->addCancelButton($object_uri, pht('Done'));

    $space_section = $this->buildSpaceSection(
      $object,
      $policy,
      $capability);

    $extended_section = $this->buildExtendedSection(
      $object,
      $capability);

    $exceptions_section = $this->buildExceptionsSection(
      $object,
      $capability);

    $object_section = $this->buildObjectSection(
      $object,
      $policy,
      $capability,
      $handle);

    $dialog->appendChild(
      array(
        $space_section,
        $extended_section,
        $exceptions_section,
        $object_section,
      ));

    return $dialog;
  }

  private function buildSpaceSection(
    PhabricatorPolicyInterface $object,
    PhabricatorPolicy $policy,
    $capability) {
    $viewer = $this->getViewer();

    if (!($object instanceof PhabricatorSpacesInterface)) {
      return null;
    }

    if (!PhabricatorSpacesNamespaceQuery::getSpacesExist()) {
      return null;
    }

    $space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID(
      $object);

    $spaces = PhabricatorSpacesNamespaceQuery::getViewerSpaces($viewer);
    $space = idx($spaces, $space_phid);
    if (!$space) {
      return null;
    }

    $space_policies = PhabricatorPolicyQuery::loadPolicies($viewer, $space);
    $space_policy = idx($space_policies, PhabricatorPolicyCapability::CAN_VIEW);
    if (!$space_policy) {
      return null;
    }

    $doc_href = PhabricatorEnv::getDoclink('Spaces User Guide');
    $capability_name = $this->getCapabilityName($capability);

    $space_section = id(new PHUIPolicySectionView())
      ->setViewer($viewer)
      ->setIcon('fa-th-large bluegrey')
      ->setHeader(pht('Space'))
      ->setDocumentationLink(pht('Spaces Documentation'), $doc_href)
      ->appendList(
        array(
          array(
            phutil_tag('strong', array(), pht('Space:')),
            ' ',
            $viewer->renderHandle($space_phid)->setAsTag(true),
          ),
          array(
            phutil_tag('strong', array(), pht('%s:', $capability_name)),
            ' ',
            $space_policy->getShortName(),
          ),
        ))
      ->appendParagraph(
        pht(
          'This object is in %s and can only be seen or edited by users '.
          'with access to view objects in the space.',
          $viewer->renderHandle($space_phid)));

    $space_explanation = PhabricatorPolicy::getPolicyExplanation(
      $viewer,
      $space_policy->getPHID());
    $items = array();
    $items[] = $space_explanation;

    $space_section
      ->appendParagraph(pht('Users who can see objects in this space:'))
      ->appendList($items);

    $view_capability = PhabricatorPolicyCapability::CAN_VIEW;
    if ($capability == $view_capability) {
      $stronger = $space_policy->isStrongerThan($policy);
      if ($stronger) {
        $space_section->appendHint(
          pht(
            'The space this object is in has a more restrictive view '.
            'policy ("%s") than the object does ("%s"), so the space\'s '.
            'view policy is shown as a hint instead of the object policy.',
            $space_policy->getShortName(),
            $policy->getShortName()));
      }
    }

    $space_section->appendHint(
      pht(
        'After a user passes space policy checks, they must still pass '.
        'object policy checks.'));

    return $space_section;
  }

  private function getStrengthInformation(
    PhabricatorPolicyInterface $object,
    PhabricatorPolicy $policy,
    $capability) {
    $viewer = $this->getViewer();

    $strength = null;
    if ($object instanceof PhabricatorPolicyCodexInterface) {
      $codex = id(PhabricatorPolicyCodex::newFromObject($object, $viewer))
        ->setCapability($capability);
      $strength = $codex->compareToDefaultPolicy($policy);
      $default_policy = $codex->getDefaultPolicy();
    } else {
      $default_policy = PhabricatorPolicyQuery::getDefaultPolicyForObject(
        $viewer,
        $object,
        $capability);

      if ($default_policy) {
        if ($default_policy->getPHID() == $policy->getPHID()) {
          return;
        }

        if ($default_policy->getPHID() != $policy->getPHID()) {
          if ($default_policy->isStrongerThan($policy)) {
            $strength = PhabricatorPolicyStrengthConstants::WEAKER;
          } else if ($policy->isStrongerThan($default_policy)) {
            $strength = PhabricatorPolicyStrengthConstants::STRONGER;
          } else {
            $strength = PhabricatorPolicyStrengthConstants::ADJUSTED;
          }
        }
      }
    }

    if (!$strength) {
      return;
    }

    if ($strength == PhabricatorPolicyStrengthConstants::WEAKER) {
      $info = pht(
        'This object has a less restrictive policy ("%s") than the default '.
        'policy for similar objects (which is "%s").',
        $policy->getShortName(),
        $default_policy->getShortName());
    } else if ($strength == PhabricatorPolicyStrengthConstants::STRONGER) {
      $info = pht(
        'This object has a more restrictive policy ("%s") than the default '.
        'policy for similar objects (which is "%s").',
        $policy->getShortName(),
        $default_policy->getShortName());
    } else {
      $info = pht(
        'This object has a different policy ("%s") than the default policy '.
        'for similar objects (which is "%s").',
        $policy->getShortName(),
        $default_policy->getShortName());
    }

    return $info;
  }

  private function getCapabilityName($capability) {
    $capability_name = $capability;
    $capobj = PhabricatorPolicyCapability::getCapabilityByKey($capability);
    if ($capobj) {
      $capability_name = $capobj->getCapabilityName();
    }

    return $capability_name;
  }

  private function buildExtendedSection(
    PhabricatorPolicyInterface $object,
    $capability) {
    $viewer = $this->getViewer();

    if (!($object instanceof PhabricatorExtendedPolicyInterface)) {
      return null;
    }

    $extended_rules = $object->getExtendedPolicy($capability, $viewer);
    if (!$extended_rules) {
      return null;
    }

    $items = array();
    foreach ($extended_rules as $extended_rule) {
      $extended_target = $extended_rule[0];
      $extended_capabilities = (array)$extended_rule[1];
      if (is_object($extended_target)) {
        $extended_target = $extended_target->getPHID();
      }

      foreach ($extended_capabilities as $extended_capability) {
        $ex_name = $this->getCapabilityName($extended_capability);
        $items[] = array(
          phutil_tag('strong', array(), pht('%s:', $ex_name)),
          ' ',
          $viewer->renderHandle($extended_target)->setAsTag(true),
        );
      }
    }

    return id(new PHUIPolicySectionView())
      ->setViewer($viewer)
      ->setIcon('fa-link')
      ->setHeader(pht('Required Capabilities on Other Objects'))
      ->appendParagraph(
        pht(
          'To access this object, users must have first have access '.
          'capabilities on these other objects:'))
      ->appendList($items);
  }

  private function buildExceptionsSection(
    PhabricatorPolicyInterface $object,
    $capability) {
    $viewer = $this->getViewer();

    $exceptions = PhabricatorPolicy::getSpecialRules(
      $object,
      $viewer,
      $capability,
      false);

    if (!$exceptions) {
      return null;
    }

    return id(new PHUIPolicySectionView())
      ->setViewer($viewer)
      ->setIcon('fa-unlock-alt red')
      ->setHeader(pht('Special Rules'))
      ->appendParagraph(
        pht(
          'This object has special rules which override normal object '.
          'policy rules:'))
      ->appendList($exceptions);
  }

  private function buildObjectSection(
    PhabricatorPolicyInterface $object,
    PhabricatorPolicy $policy,
    $capability,
    PhabricatorObjectHandle $handle) {

    $viewer = $this->getViewer();
    $capability_name = $this->getCapabilityName($capability);

    $object_section = id(new PHUIPolicySectionView())
      ->setViewer($viewer)
      ->setIcon($handle->getIcon().' bluegrey')
      ->setHeader(pht('Object Policy'))
      ->appendParagraph(
        array(
          array(
            phutil_tag('strong', array(), pht('%s:', $capability_name)),
            ' ',
            $policy->getShortName(),
          ),
        ))
      ->appendParagraph(
        pht(
          'In detail, this means that these users can take this action, '.
          'provided they pass all of the checks described above first:'))
      ->appendList(
        array(
          PhabricatorPolicy::getPolicyExplanation(
            $viewer,
            $policy->getPHID()),
        ));

    if ($policy->isCustomPolicy()) {
      $rules_view = id(new PhabricatorPolicyRulesView())
        ->setViewer($viewer)
        ->setPolicy($policy);
      $object_section->appendRulesView($rules_view);
    }

    $strength = $this->getStrengthInformation($object, $policy, $capability);
    if ($strength) {
      $object_section->appendHint($strength);
    }

    return $object_section;
  }

}


text:
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="iron-flex-layout-demo">
  <template>
    <style>
      x-app {
        height: 100%;
      }
    </style>
    <style include="demo-elements"></style>

    <x-app></x-app>

  </template>
</dom-module>


text:
ref_fasta_file=../reseq_data/reference/dmel-all-chromosome-r5.41.fasta
ref_fasta_index_file=../reseq_data/reference/dmel-all-chromosome-r5.41.fasta.fai
fastq_file_1=../reseq_data/bc/BC_long_1.fastq
fastq_file_2=../reseq_data/bc/BC_long_2.fastq
sai_file_1=../temp_alignment_data/bc_long_1.sai
sai_file_2=../temp_alignment_data/bc_long_2.sai
sam_file=../temp_alignment_data/bc_long.sam
unsorted_bam_file=../temp_alignment_data/bc_long_unsorted.bam
sorted_bam_file_no_ext=../bam_alignments/bc_long
sorted_bam_file=../bam_alignments/bc_long.bam

#Change the working directory
cd $PBS_O_WORKDIR

#Align the forward and reverse strands to the reference
bwa aln -n 4 $ref_fasta_file $fastq_file_1 > $sai_file_1
bwa aln -n 4 $ref_fasta_file $fastq_file_2 > $sai_file_2

#Generate a SAM file from the bwa alignments
bwa sampe $ref_fasta_file $sai_file_1 $sai_file_2 $fastq_file_1 $fastq_file_2 > $sam_file

#Convert the SAM file to a BAM file
samtools import $ref_fasta_index_file $sam_file $unsorted_bam_file

#Sort the BAM file
samtools sort $unsorted_bam_file $sorted_bam_file_no_ext

#Index the BAM file
samtools index $sorted_bam_file


text:
using System;
using FluentValidation.TestHelper;
using Moq;
using NUnit.Framework;
using Weapsy.Domain.Sites.Commands;
using Weapsy.Domain.Sites.Validators;
using Weapsy.Domain.Sites.Rules;
using FluentValidation;
using Weapsy.Domain.Languages.Rules;
using System.Collections.Generic;
using Weapsy.Domain.Pages.Rules;
using Weapsy.Domain.Sites;

namespace Weapsy.Domain.Tests.Sites.Validators
{
    [TestFixture]
    public class UpdateSiteDetailsValidatorTests
    {
        [Test]
        public void Should_have_error_when_home_page_does_not_exist()
        {
            var siteId = Guid.NewGuid();
            var homePageId = Guid.NewGuid();

            var siteRulesMock = new Mock<ISiteRules>();
            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            pageRulesMock.Setup(x => x.DoesPageExist(siteId, homePageId)).Returns(false);
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            validator.ShouldHaveValidationErrorFor(x => x.HomePageId, new UpdateSiteDetails
            {
                SiteId = siteId,
                HomePageId = homePageId
            });
        }

        [Test]
        [Ignore("Feature not implemented yet.")]
        public void Should_have_error_when_site_url_is_empty()
        {
            var siteRulesMock = new Mock<ISiteRules>();
            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            validator.ShouldHaveValidationErrorFor(x => x.Url, new UpdateSiteDetails
            {
                SiteId = Guid.NewGuid(),
                Url = string.Empty,
                Title = "Title",
                MetaDescription = "Meta Description",
                MetaKeywords = "Meta Keywords"
            });
        }

        [Test]
        [Ignore("Feature not implemented yet.")]
        public void Should_have_error_when_site_url_is_too_long()
        {
            var siteRulesMock = new Mock<ISiteRules>();
            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            var url = "";
            for (int i = 0; i < 51; i++) url += i;

            validator.ShouldHaveValidationErrorFor(x => x.Url, new UpdateSiteDetails
            {
                SiteId = Guid.NewGuid(),
                Url = url,
                Title = "Title",
                MetaDescription = "Meta Description",
                MetaKeywords = "Meta Keywords"
            });
        }

        [Test]
        [Ignore("Feature not implemented yet.")]
        public void Should_have_error_when_site_url_is_not_valid()
        {
            Guid siteId = Guid.NewGuid();
            const string url = "My@Url";

            var siteRulesMock = new Mock<ISiteRules>();
            siteRulesMock.Setup(x => x.IsSiteUrlValid(url)).Returns(false);

            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            validator.ShouldHaveValidationErrorFor(x => x.Url, new UpdateSiteDetails
            {
                SiteId = siteId,
                Url = url,
                Title = "Title",
                MetaDescription = "Meta Description",
                MetaKeywords = "Meta Keywords"
            });
        }

        [Test]
        [Ignore("Feature not implemented yet.")]
        public void Should_have_error_when_site_url_already_exists()
        {
            Guid siteId = Guid.NewGuid();
            const string url = "my-url";

            var siteRulesMock = new Mock<ISiteRules>();
            siteRulesMock.Setup(x => x.IsSiteUrlUnique(url, siteId)).Returns(false);

            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            validator.ShouldHaveValidationErrorFor(x => x.Url, new UpdateSiteDetails
            {
                SiteId = siteId,
                Url = url,
                Title = "Title",
                MetaDescription = "Meta Description",
                MetaKeywords = "Meta Keywords"
            });
        }

        [Test]
        public void Should_have_error_when_site_title_is_too_long()
        {
            var siteRulesMock = new Mock<ISiteRules>();
            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            var title = "";
            for (int i = 0; i < 251; i++) title += i;

            validator.ShouldHaveValidationErrorFor(x => x.Title, new UpdateSiteDetails
            {
                SiteId = Guid.NewGuid(),
                Url = "url",
                Title = title,
                MetaDescription = string.Empty,
                MetaKeywords = string.Empty
            });
        }

        [Test]
        public void Should_have_error_when_site_meta_description_is_too_long()
        {
            var siteRulesMock = new Mock<ISiteRules>();
            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            var metaDescription = "";
            for (int i = 0; i < 501; i++) metaDescription += i;

            validator.ShouldHaveValidationErrorFor(x => x.MetaDescription, new UpdateSiteDetails
            {
                SiteId = Guid.NewGuid(),
                Url = "url",
                Title = string.Empty,
                MetaDescription = metaDescription,
                MetaKeywords = string.Empty
            });
        }

        [Test]
        public void Should_have_error_when_site_meta_keywords_is_too_long()
        {
            var siteRulesMock = new Mock<ISiteRules>();
            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            var metaKeywords = "";
            for (int i = 0; i < 501; i++) metaKeywords += i;

            validator.ShouldHaveValidationErrorFor(x => x.MetaKeywords, new UpdateSiteDetails
            {
                SiteId = Guid.NewGuid(),
                Url = "url",
                Title = string.Empty,
                MetaDescription = string.Empty,
                MetaKeywords = metaKeywords
            });
        }

        [Test]
        public void Should_have_error_when_localisations_are_missing()
        {
            var siteRulesMock = new Mock<ISiteRules>();
            var languageRulesMock = new Mock<ILanguageRules>();
            var pageRulesMock = new Mock<IPageRules>();
            var localisationValidatorMock = new Mock<IValidator<SiteLocalisation>>();
            languageRulesMock.Setup(x => x.AreAllSupportedLanguagesIncluded(It.IsAny<Guid>(), It.IsAny<IEnumerable<Guid>>())).Returns(false);
            var validator = new UpdateSiteDetailsValidator(siteRulesMock.Object,
                languageRulesMock.Object,
                pageRulesMock.Object,
                localisationValidatorMock.Object);

            validator.ShouldHaveValidationErrorFor(x => x.SiteLocalisations, new UpdateSiteDetails
            {
                SiteId = Guid.NewGuid(),
                Title = "Title",
                Url = "Url"
            });
        }
    }
}


text:
package org.eclipse.collections.impl.map.immutable;

import org.eclipse.collections.impl.test.Verify;
import org.junit.Test;

public class ImmutableSingletonMapSerializationTest
{
    @Test
    public void serializedForm()
    {
        Verify.assertSerializedForm(
                1L,
                "rO0ABXNyAElvcmcuZWNsaXBzZS5jb2xsZWN0aW9ucy5pbXBsLm1hcC5pbW11dGFibGUuSW1tdXRh\n"
                        + "YmxlTWFwU2VyaWFsaXphdGlvblByb3h5AAAAAAAAAAEMAAB4cHcEAAAAAXBweA==",
                new ImmutableSingletonMap<>(null, null));
    }
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>Feed a deer</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link rel="stylesheet" href="css/bootstrap.css" />
        <link rel="stylesheet" href="css/components.css" />

Menu

                Score:
                0

                Lives:
                3


text:
Error:

{{alertDanger}}

Warning:

{{alertWarning}}

Info:

{{alertInfo}}

Success:

{{alertSuccess}}

{{alertMessage.header}}

{{alertMessage.message}}


text:
/**
 * Pattern module.
 */
/**
 * ============================================================================
 * IMPORTS
 * ============================================================================
 * @hidden
 */
import { BaseObject } from "../../Base";
import { Group } from "../Group";
import { AMElement } from "../AMElement";
import { Paper } from "../Paper";
import { ShapeRendering } from "../../defs/ShapeRendering";
import { List } from "../../utils/List";
import { Animation, IAnimatable, IAnimationOptions } from "../../utils/Animation";
import { Color } from "../../utils/Color";
import * as $type from "../../utils/Type";
/**
 * ============================================================================
 * REQUISITES
 * ============================================================================
 * @hidden
 */
/**
 * Defines available units to measure patterns.
 */
export declare type PatternUnits = "userSpaceOnUse" | "objectBoundingBox";
/**
 * Defines properties for [[Pattern]].
 */
export interface PatternProperties {
    x: number;
    y: number;
    width: number;
    height: number;
    backgroundOpacity: number;
    backgroundFill: Color;
    fillOpacity: number;
    fill: Color;
    stroke: Color;
    strokeOpacity: number;
    strokeWidth: number;
    shapeRendering: ShapeRendering;
    rotation: number;
    rotationX: number;
    rotationY: number;
    patternUnits: PatternUnits;
    strokeDashArray: string;
}
/**
 * ============================================================================
 * MAIN CLASS
 * ============================================================================
 * @hidden
 */
/**
 * Base class to define patterns.
 */
export declare class Pattern extends BaseObject implements IAnimatable {
    /**
     * List of available animations currently running on a pattern.
     */
    protected _animations: $type.Optional<Array<Animation>>;
    /**
     * An SVG `<group>` element to put sub-elements into.
     */
    element: Group;
    /**
     * Reference to [[Paper]] instance.
     */
    protected _paper: $type.Optional<Paper>;
    /**
     * List of elements the pattern consists of.
     */
    protected _elements: List<AMElement>;
    /**
     * Defines property types.
     */
    _properties: PatternProperties;
    /**
     * A storage for Filter property/value pairs.
     *
     * @ignore Exclude from docs
     * @see {@link PatternProperties}
     */
    properties: this["_properties"];
    /**
     * Constructor
     */
    constructor();
    /**
     * Draws the pattern.
     */
    protected draw(): void;
    /**
     * Animate pattern properties.
     *
     * @see {@link Animation}
     * @param animationOptions  Animation options
     * @param duration          Duration (ms)
     * @param easing            Easing function
     * @return Animation instance
     */
    animate(animationOptions: IAnimationOptions[] | IAnimationOptions, duration: number, easing?: (value: number) => number): Animation;
    /**
     * Adds an element to the pattern.
     *
     * @param element  Element
     */
    addElement(element: AMElement): void;
    /**
     * Remove an element from the pattern.
     *
     * @param element  Element
     */
    removeElement(element: AMElement): void;
    /**
     * Returns the list of SVG elements comprising the pattern.
     *
     * @return Pattern elements
     */
    readonly elements: List<AMElement>;
    /**
     * Pattern fill opacity. (0-1)
     *
     * @param value  Opacity (0-1)
     */
    /**
    * @return Opacity (0-1)
    */
    fillOpacity: number;
    /**
     * Fill color of the pattern.
     *
     * @param value  Fill color
     */
    /**
    * @return Fill color
    */
    fill: Color;
    /**
     * Pattern background fill color.
     *
     * @param value  Background color
     */
    /**
    * @return Background color
    */
    backgroundFill: Color;
    /**
     * Pattern backgorund opacity. (0-1)
     *
     * @param value  Background opacity (0-1)
     */
    /**
    * @return Background opacity (0-1)
    */
    backgroundOpacity: number;
    /**
     * Pattern stroke (border) color.
     *
     * @param value  Color
     */
    /**
    * @return Color
    */
    stroke: Color;
    /**
     * Pattern stroke opacity. (0-1)
     *
     * @param value  Opacity (0-1)
     */
    /**
    * @return Opacity (0-1)
    */
    strokeOpacity: number;
    /**
     * Pattern stroke thickness in pixels.
     *
     * @param value  Stroke thickness (px)
     */
    /**
    * @return Stroke thickness (px)
    */
    strokeWidth: number;
    /**
     * Shape rendering
     * @param value [description]
     */
    shapeRendering: ShapeRendering;
    /**
     * Pattern rotation in degrees.
     *
     * @param value  Rotation
     */
    /**
    * @return Rotation
    */
    rotation: number;
    /**
     * Pattern measuring units.
     *
     * Available options: "userSpaceOnUse" | "objectBoundingBox".
     *
     * @param value  Units
     */
    /**
    * @return Units
    */
    patternUnits: "userSpaceOnUse" | "objectBoundingBox";
    /**
     * Pattern width in pixels.
     *
     * @param value  Width (px)
     */
    /**
    * @return Width (px)
    */
    width: number;
    /**
     * Pattern height in pixels.
     *
     * @param value Height (px)
     */
    /**
    * @return Height (px)
    */
    height: number;
    /**
     * X position. (pixels)
     *
     * @param value X (px)
     */
    /**
    * @return X (px)
    */
    x: number;
    /**
     * Y position (px).
     *
     * @param value Y (px)
     */
    /**
    * @return Y (px)
    */
    y: number;
    /**
     * [[Paper]] instance to draw pattern in.
     *
     * @ignore Exclude from docs
     * @param paper  Paper
     */
    /**
    * @ignore Exclude from docs
    * @return Paper
    */
    paper: Paper;
    /**
     * Copies properties from another Pattern instance.
     *
     * @param source  Source pattern
     */
    copyFrom(source: this): void;
    /**
     * A list of animations currently running on the patter.
     *
     * @ignore Exclude from docs
     * @return Animation list
     */
    readonly animations: Array<Animation>;
    /**
     * A `stroke-dasharray` for the stroke (outline).
     *
     * "Dasharray" allows setting rules to make lines dashed, dotted, etc.
     *
     * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`
     * @param value  `stroke-dasharray`
     */
    /**
    * @return `stroke-dasharray`
    */
    strokeDasharray: string;
    /**
     * Processes JSON-based config before it is applied to the object.
     *
     * @ignore Exclude from docs
     * @param config  Config
     */
    processConfig(config?: {
        [index: string]: any;
    }): void;
}