text:
.. _nuoverlaymirrordestinationtemplate:

nuoverlaymirrordestinationtemplate
===========================================

.. class:: nuoverlaymirrordestinationtemplate.NUOverlayMirrorDestinationTemplate(bambou.nurest_object.NUMetaRESTObject,):

Overlay mirror destinations are pointed to by advanced forwarding policies as the destination for redirected traffic. Targets can be of two types, L3 or virtual wire. For L3 targets a virtual IP should be provided as it allows the system to track among which of the end-points belonging to the overlay mirror destination is the active one. For this type of redirect the packet's destination MAC address is changed to match that of the Virtual IP. For virtual-wire redirection targets, the packets are untouched and forwarded directly to the end-point.

Attributes
----------

- ``name`` (**Mandatory**): Name of this overlay mirror destination template

- ``last_updated_by``: ID of the user who last updated the object.

- ``last_updated_date``: Time stamp when this object was last updated.

- ``redundancy_enabled``: Allow/Disallow redundant appliances and VIP

- ``description``: Description of this overlay mirror destination template

- ``destination_type``: Determines the type of destination : redirection target or overlay mirror destination

- ``embedded_metadata``: Metadata objects associated with this entity. This will contain a list of Metadata objects if the API request is made using the special flag to enable the embedded Metadata feature. Only a maximum of Metadata objects is returned based on the value set in the system configuration.

- ``end_point_type`` (**Mandatory**): VPortTagEndPointType is an enum. It defines the type of header rewrite and forwarding performed by VRS when the endpoint is used as a overlay mirror destination. Possible value is VIRTUAL_WIRE.

- ``entity_scope``: Specify if scope of entity is Data center or Enterprise level

- ``creation_date``: Time stamp when this object was created.

- ``trigger_type``: Trigger type, could be NONE/GARP - THIS IS READONLY

- ``owner``: Identifies the user that has created this object.

- ``external_id``: External object ID. Used for integration with third party systems

Children
--------

================================================================================================================================================               ==========================================================================================
**class**                                                                                **fetcher**

:ref:`nupermission.NUPermission<nupermission>`                                                                                ``permissions``
:ref:`numetadata.NUMetadata<numetadata>`                                                                                ``metadatas``
:ref:`nuglobalmetadata.NUGlobalMetadata<nuglobalmetadata>`                                                                                ``global_metadatas``
================================================================================================================================================               ==========================================================================================

Parents
--------

- :ref:`nul2domaintemplate.NUL2DomainTemplate<nul2domaintemplate>`


text:
package com.fis.ra;

import android.os.Bundle;
import android.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class NotificationsFragment extends Fragment {
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		View rootView = inflater.inflate(R.layout.fragment_notifications,
				container, false);

		return rootView;
	}

	public static void setmyText(final String string) {
		Log.d("Prueba de mensajes", string);
		}
}

redpajama_set_name: RedPajamaGithub


text:
import flatbuffers

# /// Stores a double mean and standard deviation.
class meanStddev(object):
    __slots__ = ['_tab']

    # meanStddev
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # meanStddev
    def Mean(self): return self._tab.Get(flatbuffers.number_types.Float64Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
    # meanStddev
    def Stddev(self): return self._tab.Get(flatbuffers.number_types.Float64Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(8))

def CreatemeanStddev(builder, mean, stddev):
    builder.Prep(8, 16)
    builder.PrependFloat64(stddev)
    builder.PrependFloat64(mean)
    return builder.Offset()


text:
namespace D3DX11Effects
{

//////////////////////////////////////////////////////////////////////////
// Effect HLSL late resolve lists (state values)
//////////////////////////////////////////////////////////////////////////

static CONST RValue g_rvNULL[] =
{
    { "NULL",  0 },
    RVALUE_END()
};

static CONST RValue g_rvBOOL[] =
{
    { "FALSE",  0 },
    { "TRUE",   1 },
    RVALUE_END()
};

static CONST RValue g_rvDEPTH_WRITE_MASK[] =
{
    { "ZERO",   D3D10_DEPTH_WRITE_MASK_ZERO     },
    { "ALL",    D3D10_DEPTH_WRITE_MASK_ALL      },
    RVALUE_END()
};

static CONST RValue g_rvFILL[] =
{
    { "WIREFRAME",  D3D10_FILL_WIREFRAME },
    { "SOLID",      D3D10_FILL_SOLID     },
    RVALUE_END()
};

static CONST RValue g_rvFILTER[] =
{
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_MAG_MIP_POINT                           ),
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_MAG_POINT_MIP_LINEAR                    ),
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_POINT_MAG_LINEAR_MIP_POINT              ),
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_POINT_MAG_MIP_LINEAR                    ),
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_LINEAR_MAG_MIP_POINT                    ),
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_LINEAR_MAG_POINT_MIP_LINEAR             ),
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_MAG_LINEAR_MIP_POINT                    ),
    RVALUE_ENTRY(D3D10_FILTER_,     MIN_MAG_MIP_LINEAR                          ),
    RVALUE_ENTRY(D3D10_FILTER_,     ANISOTROPIC                                 ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_MAG_MIP_POINT                ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_MAG_POINT_MIP_LINEAR         ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT   ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_POINT_MAG_MIP_LINEAR         ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_LINEAR_MAG_MIP_POINT         ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR  ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_MAG_LINEAR_MIP_POINT         ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_MIN_MAG_MIP_LINEAR               ),
    RVALUE_ENTRY(D3D10_FILTER_,     COMPARISON_ANISOTROPIC                      ),
    RVALUE_ENTRY(D3D10_FILTER_,     TEXT_1BIT                                   ),
    RVALUE_END()
};

static CONST RValue g_rvBLEND[] =
{
    { "ZERO",               D3D10_BLEND_ZERO            },
    { "ONE",                D3D10_BLEND_ONE             },
    { "SRC_COLOR",          D3D10_BLEND_SRC_COLOR        },
    { "INV_SRC_COLOR",      D3D10_BLEND_INV_SRC_COLOR     },
    { "SRC_ALPHA",          D3D10_BLEND_SRC_ALPHA        },
    { "INV_SRC_ALPHA",      D3D10_BLEND_INV_SRC_ALPHA     },
    { "DEST_ALPHA",         D3D10_BLEND_DEST_ALPHA       },
    { "INV_DEST_ALPHA",     D3D10_BLEND_INV_DEST_ALPHA    },
    { "DEST_COLOR",         D3D10_BLEND_DEST_COLOR       },
    { "INV_DEST_COLOR",     D3D10_BLEND_INV_DEST_COLOR    },
    { "SRC_ALPHA_SAT",      D3D10_BLEND_SRC_ALPHA_SAT     },
    { "BLEND_FACTOR",       D3D10_BLEND_BLEND_FACTOR     },
    { "INV_BLEND_FACTOR",   D3D10_BLEND_INV_BLEND_FACTOR  },
    { "SRC1_COLOR",         D3D10_BLEND_SRC1_COLOR        },
    { "INV_SRC1_COLOR",     D3D10_BLEND_INV_SRC1_COLOR    },
    { "SRC1_ALPHA",         D3D10_BLEND_SRC1_ALPHA       },
    { "INV_SRC1_ALPHA",     D3D10_BLEND_INV_SRC1_ALPHA    },

    RVALUE_END()
};

static CONST RValue g_rvTADDRESS[] =
{
    { "CLAMP",          D3D10_TEXTURE_ADDRESS_CLAMP      },
    { "WRAP",           D3D10_TEXTURE_ADDRESS_WRAP       },
    { "MIRROR",         D3D10_TEXTURE_ADDRESS_MIRROR     },
    { "BORDER",         D3D10_TEXTURE_ADDRESS_BORDER     },
    { "MIRROR_ONCE",    D3D10_TEXTURE_ADDRESS_MIRROR_ONCE },
    RVALUE_END()
};

static CONST RValue g_rvCULL[] =
{
    { "NONE",           D3D10_CULL_NONE     },
    { "FRONT",          D3D10_CULL_FRONT    },
    { "BACK",           D3D10_CULL_BACK     },
    RVALUE_END()
};

static CONST RValue g_rvCMP[] =
{
    { "NEVER",          D3D10_COMPARISON_NEVER        },
    { "LESS",           D3D10_COMPARISON_LESS         },
    { "EQUAL",          D3D10_COMPARISON_EQUAL        },
    { "LESS_EQUAL",     D3D10_COMPARISON_LESS_EQUAL    },
    { "GREATER",        D3D10_COMPARISON_GREATER      },
    { "NOT_EQUAL",      D3D10_COMPARISON_NOT_EQUAL     },
    { "GREATER_EQUAL",  D3D10_COMPARISON_GREATER_EQUAL },
    { "ALWAYS",         D3D10_COMPARISON_ALWAYS       },
    RVALUE_END()
};

static CONST RValue g_rvSTENCILOP[] =
{
    { "KEEP",       D3D10_STENCIL_OP_KEEP    },
    { "ZERO",       D3D10_STENCIL_OP_ZERO    },
    { "REPLACE",    D3D10_STENCIL_OP_REPLACE },
    { "INCR_SAT",   D3D10_STENCIL_OP_INCR_SAT },
    { "DECR_SAT",   D3D10_STENCIL_OP_DECR_SAT },
    { "INVERT",     D3D10_STENCIL_OP_INVERT  },
    { "INCR",       D3D10_STENCIL_OP_INCR    },
    { "DECR",       D3D10_STENCIL_OP_DECR    },
    RVALUE_END()
};

static CONST RValue g_rvBLENDOP[] =
{
    { "ADD",            D3D10_BLEND_OP_ADD         },
    { "SUBTRACT",       D3D10_BLEND_OP_SUBTRACT    },
    { "REV_SUBTRACT",   D3D10_BLEND_OP_REV_SUBTRACT },
    { "MIN",            D3D10_BLEND_OP_MIN         },
    { "MAX",            D3D10_BLEND_OP_MAX         },
    RVALUE_END()
};

//////////////////////////////////////////////////////////////////////////
// Effect HLSL states
//////////////////////////////////////////////////////////////////////////

#define strideof( s, m ) offsetof_fx(s,m[1]) - offsetof_fx(s,m[0])

CONST LValue g_lvGeneral[] =
{
    // RObjects
    { "RasterizerState",            EBT_Pass,           D3D10_SVT_RASTERIZER,         1, 1, FALSE, NULL,                    ELHS_RasterizerBlock,           offsetof_fx(SPassBlock, BackingStore.pRasterizerBlock),                        0 },
    { "DepthStencilState",          EBT_Pass,           D3D10_SVT_DEPTHSTENCIL,       1, 1, FALSE, NULL,                    ELHS_DepthStencilBlock,         offsetof_fx(SPassBlock, BackingStore.pDepthStencilBlock),                      0 },
    { "BlendState",                 EBT_Pass,           D3D10_SVT_BLEND,              1, 1, FALSE, NULL,                    ELHS_BlendBlock,                offsetof_fx(SPassBlock, BackingStore.pBlendBlock),                             0 },
    { "RenderTargetView",           EBT_Pass,           D3D10_SVT_RENDERTARGETVIEW,   1, 8, FALSE, NULL,                    ELHS_RenderTargetView,          offsetof_fx(SPassBlock, BackingStore.pRenderTargetViews),                      0 },
    { "DepthStencilView",           EBT_Pass,           D3D10_SVT_DEPTHSTENCILVIEW,   1, 8, FALSE, NULL,                    ELHS_DepthStencilView,          offsetof_fx(SPassBlock, BackingStore.pDepthStencilView),                       0 },
    { "GenerateMips",               EBT_Pass,           D3D10_SVT_TEXTURE,            1, 1, FALSE, NULL,                    ELHS_GenerateMips,              0,                                                                          0 },
    // Shaders
    { "VertexShader",               EBT_Pass,           D3D10_SVT_VERTEXSHADER,       1, 1, FALSE, g_rvNULL,                ELHS_VertexShaderBlock,         offsetof_fx(SPassBlock, BackingStore.pVertexShaderBlock),                      0 },
    { "PixelShader",                EBT_Pass,           D3D10_SVT_PIXELSHADER,        1, 1, FALSE, g_rvNULL,                ELHS_PixelShaderBlock,          offsetof_fx(SPassBlock, BackingStore.pPixelShaderBlock),                       0 },
    { "GeometryShader",             EBT_Pass,           D3D10_SVT_GEOMETRYSHADER,     1, 1, FALSE, g_rvNULL,                ELHS_GeometryShaderBlock,       offsetof_fx(SPassBlock, BackingStore.pGeometryShaderBlock),                    0 },
    // RObject config assignments
    { "DS_StencilRef",              EBT_Pass,           D3D10_SVT_UINT,               1, 1, FALSE, NULL,                    ELHS_DS_StencilRef,             offsetof_fx(SPassBlock, BackingStore.StencilRef),                              0 },
    { "AB_BlendFactor",             EBT_Pass,           D3D10_SVT_FLOAT,              4, 1, FALSE, NULL,                    ELHS_B_BlendFactor,             offsetof_fx(SPassBlock, BackingStore.BlendFactor),                             0 },
    { "AB_SampleMask",              EBT_Pass,           D3D10_SVT_UINT,               1, 1, FALSE, NULL,                    ELHS_B_SampleMask,              offsetof_fx(SPassBlock, BackingStore.SampleMask),                              0 },

    { "FillMode",                   EBT_Rasterizer,     D3D10_SVT_UINT,               1, 1, FALSE, g_rvFILL,                ELHS_FillMode,                  offsetof_fx(SRasterizerBlock, BackingStore.FillMode),                          0 },
    { "CullMode",                   EBT_Rasterizer,     D3D10_SVT_UINT,               1, 1, FALSE, g_rvCULL,                ELHS_CullMode,                  offsetof_fx(SRasterizerBlock, BackingStore.CullMode),                          0 },
    { "FrontCounterClockwise",      EBT_Rasterizer,     D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_FrontCC,                   offsetof_fx(SRasterizerBlock, BackingStore.FrontCounterClockwise),             0 },
    { "DepthBias",                  EBT_Rasterizer,     D3D10_SVT_UINT,               1, 1, FALSE, NULL,                    ELHS_DepthBias,                 offsetof_fx(SRasterizerBlock, BackingStore.DepthBias),                         0 },
    { "DepthBiasClamp",             EBT_Rasterizer,     D3D10_SVT_FLOAT,              1, 1, FALSE, NULL,                    ELHS_DepthBiasClamp,            offsetof_fx(SRasterizerBlock, BackingStore.DepthBiasClamp),                    0 },
    { "SlopeScaledDepthBias",       EBT_Rasterizer,     D3D10_SVT_FLOAT,              1, 1, FALSE, NULL,                    ELHS_SlopeScaledDepthBias,      offsetof_fx(SRasterizerBlock, BackingStore.SlopeScaledDepthBias),              0 },
    { "DepthClipEnable",            EBT_Rasterizer,     D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_DepthClipEnable,           offsetof_fx(SRasterizerBlock, BackingStore.DepthClipEnable),                   0 },
    { "ScissorEnable",              EBT_Rasterizer,     D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_ScissorEnable,             offsetof_fx(SRasterizerBlock, BackingStore.ScissorEnable),                     0 },
    { "MultisampleEnable",          EBT_Rasterizer,     D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_MultisampleEnable,         offsetof_fx(SRasterizerBlock, BackingStore.MultisampleEnable),                 0 },
    { "AntialiasedLineEnable",      EBT_Rasterizer,     D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_AntialiasedLineEnable,     offsetof_fx(SRasterizerBlock, BackingStore.AntialiasedLineEnable),             0 },

    { "DepthEnable",                EBT_DepthStencil,   D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_DepthEnable,               offsetof_fx(SDepthStencilBlock, BackingStore.DepthEnable),                     0 },
    { "DepthWriteMask",             EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvDEPTH_WRITE_MASK,    ELHS_DepthWriteMask,            offsetof_fx(SDepthStencilBlock, BackingStore.DepthWriteMask),                  0 },
    { "DepthFunc",                  EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvCMP,                 ELHS_DepthFunc,                 offsetof_fx(SDepthStencilBlock, BackingStore.DepthFunc),                       0 },
    { "StencilEnable",              EBT_DepthStencil,   D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_StencilEnable,             offsetof_fx(SDepthStencilBlock, BackingStore.StencilEnable),                   0 },
    { "StencilReadMask",            EBT_DepthStencil,   D3D10_SVT_UINT8,              1, 1, FALSE, NULL,                    ELHS_StencilReadMask,           offsetof_fx(SDepthStencilBlock, BackingStore.StencilReadMask),                 0 },
    { "StencilWriteMask",           EBT_DepthStencil,   D3D10_SVT_UINT8,              1, 1, FALSE, NULL,                    ELHS_StencilWriteMask,          offsetof_fx(SDepthStencilBlock, BackingStore.StencilWriteMask),                0 },
    { "FrontFaceStencilFail",       EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvSTENCILOP,           ELHS_FrontFaceStencilFailOp,    offsetof_fx(SDepthStencilBlock, BackingStore.FrontFace.StencilFailOp),         0 },
    { "FrontFaceStencilDepthFail",  EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvSTENCILOP,           ELHS_FrontFaceStencilDepthFailOp,offsetof_fx(SDepthStencilBlock, BackingStore.FrontFace.StencilDepthFailOp),   0 },
    { "FrontFaceStencilPass",       EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvSTENCILOP,           ELHS_FrontFaceStencilPassOp,    offsetof_fx(SDepthStencilBlock, BackingStore.FrontFace.StencilPassOp),         0 },
    { "FrontFaceStencilFunc",       EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvCMP,                 ELHS_FrontFaceStencilFunc,      offsetof_fx(SDepthStencilBlock, BackingStore.FrontFace.StencilFunc),           0 },
    { "BackFaceStencilFail",        EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvSTENCILOP,           ELHS_BackFaceStencilFailOp,     offsetof_fx(SDepthStencilBlock, BackingStore.BackFace.StencilFailOp),          0 },
    { "BackFaceStencilDepthFail",   EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvSTENCILOP,           ELHS_BackFaceStencilDepthFailOp,offsetof_fx(SDepthStencilBlock, BackingStore.BackFace.StencilDepthFailOp),     0 },
    { "BackFaceStencilPass",        EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvSTENCILOP,           ELHS_BackFaceStencilPassOp,     offsetof_fx(SDepthStencilBlock, BackingStore.BackFace.StencilPassOp),          0 },
    { "BackFaceStencilFunc",        EBT_DepthStencil,   D3D10_SVT_UINT,               1, 1, FALSE, g_rvCMP,                 ELHS_BackFaceStencilFunc,       offsetof_fx(SDepthStencilBlock, BackingStore.BackFace.StencilFunc),            0 },

    { "AlphaToCoverageEnable",      EBT_Blend,          D3D10_SVT_BOOL,               1, 1, FALSE, g_rvBOOL,                ELHS_AlphaToCoverage,           offsetof_fx(SBlendBlock, BackingStore.AlphaToCoverageEnable),                  0 },
    { "BlendEnable",                EBT_Blend,          D3D10_SVT_BOOL,               1, 8, FALSE, g_rvBOOL,                ELHS_BlendEnable,               offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].BlendEnable),            strideof(SBlendBlock, BackingStore.RenderTarget) },
    { "SrcBlend",                   EBT_Blend,          D3D10_SVT_UINT,               1, 8, TRUE,  g_rvBLEND,               ELHS_SrcBlend,                  offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].SrcBlend),               strideof(SBlendBlock, BackingStore.RenderTarget) },
    { "DestBlend",                  EBT_Blend,          D3D10_SVT_UINT,               1, 8, TRUE,  g_rvBLEND,               ELHS_DestBlend,                 offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].DestBlend),              strideof(SBlendBlock, BackingStore.RenderTarget) },
    { "BlendOp",                    EBT_Blend,          D3D10_SVT_UINT,               1, 8, TRUE,  g_rvBLENDOP,             ELHS_BlendOp,                   offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].BlendOp),                strideof(SBlendBlock, BackingStore.RenderTarget) },
    { "SrcBlendAlpha",              EBT_Blend,          D3D10_SVT_UINT,               1, 8, TRUE,  g_rvBLEND,               ELHS_SrcBlendAlpha,             offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].SrcBlendAlpha),          strideof(SBlendBlock, BackingStore.RenderTarget) },
    { "DestBlendAlpha",             EBT_Blend,          D3D10_SVT_UINT,               1, 8, TRUE,  g_rvBLEND,               ELHS_DestBlendAlpha,            offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].DestBlendAlpha),         strideof(SBlendBlock, BackingStore.RenderTarget) },
    { "BlendOpAlpha",               EBT_Blend,          D3D10_SVT_UINT,               1, 8, TRUE,  g_rvBLENDOP,             ELHS_BlendOpAlpha,              offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].BlendOpAlpha),           strideof(SBlendBlock, BackingStore.RenderTarget) },
    { "RenderTargetWriteMask",      EBT_Blend,          D3D10_SVT_UINT8,              1, 8, FALSE, NULL,                    ELHS_RenderTargetWriteMask,     offsetof_fx(SBlendBlock, BackingStore.RenderTarget[0].RenderTargetWriteMask),  strideof(SBlendBlock, BackingStore.RenderTarget) },

    { "Filter",                     EBT_Sampler,        D3D10_SVT_UINT,               1, 1, FALSE, g_rvFILTER,              ELHS_Filter,                    offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.Filter),                   0 },
    { "AddressU",                   EBT_Sampler,        D3D10_SVT_UINT,               1, 1, FALSE, g_rvTADDRESS,            ELHS_AddressU,                  offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.AddressU),                 0 },
    { "AddressV",                   EBT_Sampler,        D3D10_SVT_UINT,               1, 1, FALSE, g_rvTADDRESS,            ELHS_AddressV,                  offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.AddressV),                 0 },
    { "AddressW",                   EBT_Sampler,        D3D10_SVT_UINT,               1, 1, FALSE, g_rvTADDRESS,            ELHS_AddressW,                  offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.AddressW),                 0 },
    { "MipLODBias",                 EBT_Sampler,        D3D10_SVT_FLOAT,              1, 1, FALSE, NULL,                    ELHS_MipLODBias,                offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.MipLODBias),               0 },
    { "MaxAnisotropy",              EBT_Sampler,        D3D10_SVT_UINT,               1, 1, FALSE, NULL,                    ELHS_MaxAnisotropy,             offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.MaxAnisotropy),            0 },
    { "ComparisonFunc",             EBT_Sampler,        D3D10_SVT_UINT,               1, 1, FALSE, g_rvCMP,                 ELHS_ComparisonFunc,            offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.ComparisonFunc),           0 },
    { "BorderColor",                EBT_Sampler,        D3D10_SVT_FLOAT,              4, 1, FALSE, NULL,                    ELHS_BorderColor,               offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.BorderColor),              0 },
    { "MinLOD",                     EBT_Sampler,        D3D10_SVT_FLOAT,              1, 1, FALSE, NULL,                    ELHS_MinLOD,                    offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.MinLOD),                   0 },
    { "MaxLOD",                     EBT_Sampler,        D3D10_SVT_FLOAT,              1, 1, FALSE, NULL,                    ELHS_MaxLOD,                    offsetof_fx(SSamplerBlock, BackingStore.SamplerDesc.MaxLOD),                   0 },
    { "Texture",                    EBT_Sampler,        D3D10_SVT_TEXTURE,            1, 1, FALSE, g_rvNULL,                ELHS_Texture,                   offsetof_fx(SSamplerBlock, BackingStore.pTexture),                             0 },

    // D3D11
    { "HullShader",                 EBT_Pass,           D3D11_SVT_HULLSHADER,         1, 1, FALSE, g_rvNULL,                ELHS_HullShaderBlock,           offsetof_fx(SPassBlock, BackingStore.pHullShaderBlock),                       0 },
    { "DomainShader",               EBT_Pass,           D3D11_SVT_DOMAINSHADER,       1, 1, FALSE, g_rvNULL,                ELHS_DomainShaderBlock,         offsetof_fx(SPassBlock, BackingStore.pDomainShaderBlock),                       0 },
    { "ComputeShader",              EBT_Pass,           D3D11_SVT_COMPUTESHADER,      1, 1, FALSE, g_rvNULL,                ELHS_ComputeShaderBlock,        offsetof_fx(SPassBlock, BackingStore.pComputeShaderBlock),                       0 },
};

#define NUM_STATES (sizeof(g_lvGeneral) / sizeof(LValue))
#define MAX_VECTOR_SCALAR_INDEX 8

CONST UINT g_lvGeneralCount = NUM_STATES;

} // end namespace D3DX11Effects


text:
package swt

type CustomCLayoutDataInterface interface {
	JavaLangObjectInterface
}

type CustomCLayoutData struct {
	JavaLangObject
}


text:
require 'spec_helper'

describe "check" do

  context "a locked card" do
    before :each do
      Plezel.api_key = @api_key
      @res = Plezel.check({number: @locked_card_number, month: 1, year: 2020}, 2000, 'EUR')
    end

    it "sends the right request" do
      WebMock.should have_requested(:post, /.*#{@api_key}.*\/card\/check.*/)
        .with(body: "card[number]=#{@locked_card_number}&card[month]=1&card[year]=2020&amount_cents=2000&currency=EUR")
    end

    it "response is an object" do
      @res.class.should eql(Plezel::CardStatus)
    end

    it "returns the right status" do
      @res.status.should eql(:locked)
    end
  end

end


text:
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# Test that unused sources are at least reported.

import BoostBuild

t = BoostBuild.Tester(["-d+2"], use_test_config=False)

t.write("a.cpp", "int main() {}\n")
t.write("b.cpp", "\n")
t.write("b.x", "")
t.write("jamroot.jam", """\
import "class" : new ;
import modules ;
import project ;
import targets ;
import type ;
import virtual-target ;

type.register X : x ;

class test-target-class : basic-target
{
    rule construct ( name : source-targets * : property-set )
    {
        local result = [ property-set.empty ] ;
        if ! [ modules.peek : GENERATE_NOTHING ]
        {
            result += [ virtual-target.from-file b.x : . : $(self.project) ] ;
            if ! [ modules.peek : GENERATE_ONLY_UNUSABLE ]
            {
                result += [ virtual-target.from-file b.cpp : . : $(self.project)
                    ] ;
            }
        }
        return $(result) ;
    }

    rule compute-usage-requirements ( rproperties : targets * )
    {
        return [ property-set.create <define>FOO ] ;
    }
}

rule make-b-main-target
{
    local project = [ project.current ] ;
    targets.main-target-alternative [ new test-target-class b : $(project) ] ;
}

exe a : a.cpp b c ;
make-b-main-target ;
alias c ;  # Expands to nothing, intentionally.
""")

t.run_build_system()

# The second invocation should do nothing, and produce no warning. The previous
# invocation might have printed executed actions and other things, so it is not
# easy to check if a warning was issued or not.
t.run_build_system(stdout="")

t.run_build_system(["-sGENERATE_ONLY_UNUSABLE=1"], stdout="")

# Check that even if main target generates nothing, its usage requirements are
# still propagated to dependants.
t.write("a.cpp", """\
#ifndef FOO
    #error We refuse to compile without FOO being defined!
    We_refuse_to_compile_without_FOO_being_defined
#endif
int main() {}
""")
t.run_build_system(["-sGENERATE_NOTHING=1"])

t.cleanup()


text:
<?php

declare(strict_types=1);

namespace unreal4u\MQTT\Internals;

use unreal4u\MQTT\Exceptions\InvalidResponseType;
use unreal4u\MQTT\Utilities;

use function ord;
use function sprintf;
use function strlen;

/**
 * Trait ReadableContent
 * @package unreal4u\MQTT\Internals
 */
trait ReadableContent
{
    /**
     * The remaining length field may be from 1 to 4 bytes long, this field will represent that offset
     * @var int
     */
    private $sizeOfRemainingLengthField = 1;

    /**
     * @param string $rawMQTTHeaders
     * @param ClientInterface $client
     * @return bool
     * @throws InvalidResponseType
     */
    final public function instantiateObject(string $rawMQTTHeaders, ClientInterface $client): bool
    {
        //var_dump(base64_encode($rawMQTTHeaders)); // Make it a bit easier to create unit tests
        $this->checkControlPacketValue(ord($rawMQTTHeaders[0]) >> 4);
        $this->fillObject($rawMQTTHeaders, $client);

        return true;
    }

    /**
     * Checks whether the control packet corresponds to this object
     *
     * @param int $controlPacketValue
     * @return bool
     * @throws InvalidResponseType
     */
    private function checkControlPacketValue(int $controlPacketValue): bool
    {
        // Check whether the first byte corresponds to the expected control packet value
        if (static::CONTROL_PACKET_VALUE !== $controlPacketValue) {
            throw new InvalidResponseType(sprintf(
                'Value of received value does not correspond to response (Expected: %d, Actual: %d)',
                static::CONTROL_PACKET_VALUE,
                $controlPacketValue
            ));
        }

        return true;
    }

    /**
     * Returns the correct format for the length in bytes of the remaining bytes
     *
     * @param ClientInterface $client
     * @param string $rawMQTTHeaders
     * @return int
     */
    private function performRemainingLengthFieldOperations(
        string &$rawMQTTHeaders,
        ClientInterface $client
    ): int {
        // Early return: assume defaults if first digit has a value under 128, no further need for complex checks
        if (ord($rawMQTTHeaders[1]) < 128) {
            return ord($rawMQTTHeaders[1]);
        }

        // If we have less than 4 bytes now, we should really try to recover the rest of the remaining field data
        if (strlen($rawMQTTHeaders) < 4) {
            // At this point we could actually read at least 128 as a minimum, but restrict it to what we need right now
            $rawMQTTHeaders .= $client->readBrokerData(4 - strlen($rawMQTTHeaders));
        }

        $remainingBytes = Utilities::convertRemainingLengthStringToInt(substr($rawMQTTHeaders, 1, 4));

        // Estimate how much longer is the remaining length field, this will also set $this->sizeOfRemainingLengthField
        $this->calculateSizeOfRemainingLengthField($remainingBytes);
        return $remainingBytes;
    }

    /**
     * Sets the offset of the remaining length field
     *
     * @param int $size
     * @return int
     */
    private function calculateSizeOfRemainingLengthField(int $size): int
    {
        $blockSize = $iterations = 0;
        while ($size >= $blockSize) {
            $iterations++;
            $blockSize = 128 ** $iterations;
        }

        $this->sizeOfRemainingLengthField = $iterations;
        return $iterations;
    }

    /**
     * All classes must implement how to handle the object filling
     * @param string $rawMQTTHeaders
     * @param ClientInterface $client
     * @return ReadableContentInterface
     */
    abstract public function fillObject(string $rawMQTTHeaders, ClientInterface $client): ReadableContentInterface;

    /**
     * Any class can overwrite the default behaviour
     * @param ClientInterface $client
     * @param WritableContentInterface $originalRequest
     * @return bool
     */
    public function performSpecialActions(ClientInterface $client, WritableContentInterface $originalRequest): bool
    {
        return false;
    }
}


text:
require "test_helper"

module ShopifyApp
  class JWTTest < ActiveSupport::TestCase
    TEST_SHOPIFY_DOMAIN = "https://test.myshopify.io"
    TEST_SANITIZED_SHOPIFY_DOMAIN = "test.myshopify.io"
    TEST_USER_ID = "121"
    TEST_JWT_EXPIRE_AT = 1.day.from_now

    setup do
      ShopifyApp.configuration.api_key = "api_key"
      ShopifyApp.configuration.secret = "secret"
      ShopifyApp.configuration.old_secret = "old_secret"
      ShopifyApp.configuration.myshopify_domain = "myshopify.io"
    end

    test "#shopify_domain, #shopify_user_id and #expire_at are returned from jwt payload" do
      p = payload
      jwt = JWT.new(token(p))

      assert_equal TEST_SANITIZED_SHOPIFY_DOMAIN, jwt.shopify_domain
      assert_equal TEST_USER_ID.to_i, jwt.shopify_user_id
      assert_equal TEST_JWT_EXPIRE_AT.to_i, jwt.expire_at
    end

    test "#shopify_domain and #shopify_user_id are returned using the old secret" do
      p = payload
      t = ::JWT.encode(p, ShopifyApp.configuration.old_secret, "HS256")
      jwt = JWT.new(t)

      assert_equal TEST_SANITIZED_SHOPIFY_DOMAIN, jwt.shopify_domain
      assert_equal TEST_USER_ID.to_i, jwt.shopify_user_id
    end

    test "#shopify_user_id returns nil if sub is nil on token payload" do
      p = payload
      p["sub"] = nil
      jwt = JWT.new(token(p))

      assert_nil jwt.shopify_user_id
    end

    test "shopify_domain and shopify_user_id are nil if the jwt is invalid" do
      expect_jwt_error(::JWT::DecodeError, "Not enough or too many segments")

      jwt = JWT.new("token")

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_domain and #shopify_user_id are nil if the jwt is unsigned" do
      # The library expects there to be a 3rd segment if we want to verify signature
      expect_jwt_error(::JWT::IncorrectAlgorithm, "Expected a different algorithm")

      t = ::JWT.encode(payload, nil, "none")
      jwt = JWT.new(t)

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_domain and #shopify_user_id are nil if the signature is bad" do
      expect_jwt_error(::JWT::VerificationError, "Signature verification failed")

      t = ::JWT.encode(payload, "bad", "HS256")
      jwt = JWT.new(t)

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_domain and #shopify_user_id are nil if 'aud' claim doesn't match api_key" do
      expect_jwt_error(::ShopifyApp::InvalidAudienceError, "'aud' claim does not match api_key")

      ShopifyApp.configuration.api_key = "other_key"

      p = payload
      jwt = JWT.new(token(p))

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_domain and #shopify_user_id are nil if 'exp' claim is in the past" do
      expect_jwt_error(::JWT::ExpiredSignature, "Signature has expired")

      p = payload(exp: 1.day.ago)
      jwt = JWT.new(token(p))

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_domain and #shopify_user_id are nil if 'nbf' claim is in the future" do
      expect_jwt_error(::JWT::ImmatureSignature, "Signature nbf has not been reached")

      p = payload(nbf: 1.day.from_now)
      jwt = JWT.new(token(p))

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_domain and #shopify_user_id are nil if `dest` is not a valid shopify domain" do
      expect_jwt_error(::ShopifyApp::InvalidDestinationError, "'dest' claim host not a valid shopify host")

      p = payload(dest: "https://example.com")
      jwt = JWT.new(token(p))

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_domain and #shopify_user_id are nil if `iss` host doesn't match `dest` host" do
      expect_jwt_error(::ShopifyApp::MismatchedHostsError, "'dest' claim host does not match 'iss' claim host")

      p = payload(dest: "https://other.myshopify.io")
      jwt = JWT.new(token(p))

      assert_nil jwt.shopify_domain
      assert_nil jwt.shopify_user_id
    end

    test "#shopify_user_id returns nil if `sub` does not exist" do
      p = payload(sub: nil)
      jwt = JWT.new(token(p))

      assert_nil jwt.shopify_user_id
      assert_equal TEST_SANITIZED_SHOPIFY_DOMAIN, jwt.shopify_domain
    end

    private

    def expect_jwt_error(klass, message)
      message = "Failed to validate JWT: [#{klass}] #{message}"
      ShopifyApp::Logger.expects(:warn).with(message)
    end

    def token(payload)
      ::JWT.encode(payload, ShopifyApp.configuration.secret, "HS256")
    end

    def header
      {
        "alg" => "none",
      }
    end

    def payload(
      api_key: "api_key",
      iss_host: TEST_SHOPIFY_DOMAIN,
      dest: iss_host,
      exp: TEST_JWT_EXPIRE_AT,
      nbf: 1.day.ago,
      sub: TEST_USER_ID
    )
      {
        "iss" => "#{iss_host}/admin",
        "dest" => dest,
        "aud" => api_key,
        "sub" => sub,
        "exp" => exp.to_i,
        "nbf" => nbf.to_i,
        "iat" => 1.day.ago.to_i,
        "jti" => "abc",
      }
    end
  end
end


text:
package helm

import (
	"context"
	"fmt"
	"runtime"
	"strconv"
	"strings"

	"github.com/mitchellh/go-homedir"

	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/constants"
	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/docker"
	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph"
	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/output/log"
	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest"
	"github.com/GoogleContainerTools/skaffold/pkg/skaffold/util"
	maps "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util/map"
)

// ConstructOverrideArgs creates the command line arguments for overrides
func ConstructOverrideArgs(r *latest.HelmRelease, builds []graph.Artifact, args []string) ([]string, error) {
	for _, k := range maps.SortKeys(r.SetValues) {
		args = append(args, "--set", fmt.Sprintf("%s=%s", k, r.SetValues[k]))
	}

	for _, k := range maps.SortKeys(r.SetFiles) {
		exp, err := homedir.Expand(r.SetFiles[k])
		if err != nil {
			return nil, fmt.Errorf("unable to expand %q: %w", r.SetFiles[k], err)
		}
		exp = SanitizeFilePath(exp, runtime.GOOS == "windows")

		args = append(args, "--set-file", fmt.Sprintf("%s=%s", k, exp))
	}

	envMap := map[string]string{}
	for idx, b := range builds {
		suffix := ""
		if idx > 0 {
			suffix = strconv.Itoa(idx + 1)
		}

		for k, v := range envVarForImage(b.ImageName, b.Tag) {
			envMap[k+suffix] = v
		}
	}
	log.Entry(context.TODO()).Debugf("EnvVarMap: %+v\n", envMap)

	for _, k := range maps.SortKeys(r.SetValueTemplates) {
		v, err := util.ExpandEnvTemplate(r.SetValueTemplates[k], envMap)
		if err != nil {
			return nil, err
		}
		expandedKey, err := util.ExpandEnvTemplate(k, envMap)
		if err != nil {
			return nil, err
		}

		args = append(args, "--set", fmt.Sprintf("%s=%s", expandedKey, v))
	}

	for _, v := range r.ValuesFiles {
		exp, err := homedir.Expand(v)
		if err != nil {
			return nil, fmt.Errorf("unable to expand %q: %w", v, err)
		}

		exp, err = util.ExpandEnvTemplate(exp, envMap)
		if err != nil {
			return nil, err
		}

		args = append(args, "-f", exp)
	}
	return args, nil
}

// GetArgs calculates the correct arguments to "helm get"
func GetArgs(releaseName string, namespace string) []string {
	args := []string{"get", "all"}
	if namespace != "" {
		args = append(args, "--namespace", namespace)
	}
	return append(args, releaseName)
}

// envVarForImage creates an environment map for an image and digest tag (fqn)
func envVarForImage(imageName string, digest string) map[string]string {
	customMap := map[string]string{
		"IMAGE_NAME": imageName,
		"DIGEST":     digest, // The `DIGEST` name is kept for compatibility reasons
	}

	// Standardize access to Image reference fields in templates
	ref, err := docker.ParseReference(digest)
	if err == nil {
		customMap[constants.ImageRef.Repo] = ref.BaseName
		customMap[constants.ImageRef.Tag] = ref.Tag
		customMap[constants.ImageRef.Digest] = ref.Digest
	} else {
		log.Entry(context.TODO()).Warnf("unable to extract values for %v, %v and %v from image %v due to error:\n%v", constants.ImageRef.Repo, constants.ImageRef.Tag, constants.ImageRef.Digest, digest, err)
	}

	if digest == "" {
		return customMap
	}

	// DIGEST_ALGO and DIGEST_HEX are deprecated and will contain nonsense values
	names := strings.SplitN(digest, ":", 2)
	if len(names) >= 2 {
		customMap["DIGEST_ALGO"] = names[0]
		customMap["DIGEST_HEX"] = names[1]
	} else {
		customMap["DIGEST_HEX"] = digest
	}

	// IMAGE_DOMAIN and IMAGE_REPO_NO_DOMAIN added for v2beta* 'helm+explicitRegistry' -> v3alpha* compatibility
	customMap["IMAGE_DOMAIN"] = ref.Domain
	customMap["IMAGE_REPO_NO_DOMAIN"] = strings.TrimPrefix(ref.BaseName, ref.Domain+"/")
	return customMap
}


text:
package io.github.dsdolzhenko.bencoding;

import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;

public class BDictionaryTest {

    @Test
    public void dictionariesWithTheSameValuesShouldBeEqual() throws Exception {
        final BDictionary<BString, BValue> firstValue = new BDictionary<>();
        final BDictionary<BString, BValue> secondValue = new BDictionary<>();

        firstValue.put(new BString("cow"), new BString("moo"));
        firstValue.put(new BString("spam"), new BString("eggs"));

        secondValue.put(new BString("cow"), new BString("moo"));
        secondValue.put(new BString("spam"), new BString("eggs"));

        assertEquals(firstValue, secondValue);
    }

    @Test
    public void dictionariesWithDifferentValuesShouldNotBeEqual() throws Exception {
        final BDictionary<BString, BValue> firstValue = new BDictionary<>();
        final BDictionary<BString, BValue> secondValue = new BDictionary<>();

        firstValue.put(new BString("cow"), new BString("moo"));
        firstValue.put(new BString("spam"), new BString("eggs"));

        secondValue.put(new BString("cow"), new BString("moo"));
        secondValue.put(new BString("cat"), new BString("meow"));

        assertNotEquals(firstValue, secondValue);
    }

    @Test
    public void dictionaryShouldBeEncodedCorrectly() throws Exception {
        final BDictionary<BString, BValue> dictionary = new BDictionary<>();

        dictionary.put(new BString("cow"), new BString("moo"));
        dictionary.put(new BString("spam"), new BString("eggs"));

        assertEquals(dictionary.encode(), "d3:cow3:moo4:spam4:eggse");
    }

    @Test
    public void emptyDictionaryShouldBeEncodedCorrectly() throws Exception {
        final BDictionary<BString, BValue> dictionary = new BDictionary<>();

        assertEquals(dictionary.encode(), "de");
    }

    @Test
    public void emptyDictionaryShouldBeDecodedSuccessfully() throws Exception {
        final BDictionary<BString, BValue> dictionary = new BDictionary<>();

        assertEquals(dictionary, BDictionary.decode(new BReader("de")));
    }

    @Test
    public void simpleDictionaryShouldBeDecodedSuccessfully() throws Exception {
        final BDictionary<BString, BValue> dictionary = new BDictionary<>();

        dictionary.put(new BString("key1"), new BString("string"));
        dictionary.put(new BString("key2"), new BInteger(1));

        assertEquals(dictionary, BDictionary.decode(new BReader("d4:key16:string4:key2i1ee")));
    }
}


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-16.js
 * @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Object.getOwnPropertyNames)
 */

function testcase() {
  var desc = Object.getOwnPropertyDescriptor(Object, "getOwnPropertyNames");
  if (desc.value === Object.getOwnPropertyNames &&
      desc.writable === true &&
      desc.enumerable === false &&
      desc.configurable === true) {
    return true;
  }
 }
runTestCase(testcase);


text:
<?php namespace Develpr\Hmac\Signature;

use Develpr\Hmac\Contracts\Credential;
use Develpr\Hmac\Exceptions\CredentialNotProvidedException;
use Develpr\Hmac\Exceptions\ExpiredRequestTimestampException;
use Symfony\Component\HttpFoundation\Request;
use Develpr\Hmac\Contracts\CredentialProvider;
use GuzzleHttp\Psr7;

class RequestVerifier extends Signature
{
	/**
	 * @param Request $request
	 * @param CredentialProvider $credentialProvider
	 * @return CredentialProvider|null
	 * @throws ExpiredRequestTimestampException
	 */
	public function checkRequest(Request $request, CredentialProvider $credentialProvider)
	{
		$originalAuthData = $this->retrieveOriginalAuthData($request);

		$originalDate = $this->retrieveOriginalDate($request);

		$shortDate = substr($originalDate, 0, 8);

		/** @var Credential $credential */
		$credential = $credentialProvider->getCredential($originalAuthData['Credential']);

		if(! $credential ){
			throw new CredentialNotProvidedException($originalAuthData['Credential']);
		}

		$parsed = $this->getSignatureIngredients($request, $originalAuthData['SignedHeaders']);

		$payload = $this->getPayload($request);
		$context = $this->createContext($parsed, $payload);

		$toSign = $this->createStringToSign($originalDate, $context['requestContext']);

		$signingKey = $this->getSigningKey(
				$shortDate,
				$credential->getSecretKey()
		);

		$computedSignature = hash_hmac($this->getHashAlgorithm(), $toSign, $signingKey);

		if($originalAuthData['Signature'] === $computedSignature){
			return $credential;
		}else{
			return false;
		}
	}

	private function getSignatureIngredients(Request $request, array $originalHeaders)
	{
		//This looks a bit ugly, but we're just making sure we're only grabbing the headers that were originally considered
		//when the request was signed. Other headers may have been added at various times in the request lifecycle, and
		//we don't want to check these!
		$headers = array_intersect_key(array_change_key_case($request->headers->all(), CASE_LOWER), array_flip((array) array_map('strtolower', $originalHeaders)));

		$uri = $request->getUri();
		$path = $request->getPathInfo();
		$query = $request->query->all();

		return [
				'method'  => $request->getMethod(),
				'path'    => $path,
				'query'   => $query,
				'uri'     => $uri,
				'headers' => $headers,
				'body'    => $request->getContent()
		];
	}

	protected function getPayload(Request $request)
	{
		$ctx = hash_init($this->getHashAlgorithm());
		hash_update($ctx, $request->getContent());
		$out = hash_final($ctx);

		return $out;
	}

	/**
	 * We need to take the original signature and parse out the information from it that we'll be using to complete
	 * the check signature.
	 *
	 * @param Request $request
	 * @return array
	 */
	private function retrieveOriginalAuthData(Request $request)
	{
		//note: header names are case insensitive but this method will ignore case
		$authHeader = $request->headers->get($this->getAuthHeaderName());

		if(! $authHeader )
		{
			throw new \InvalidArgumentException("No " . $this->getAuthHeaderName() . " header was provided. \n
												Expected " . $this->getAuthHeaderName() . ". Without this header it's not\n
												possible to verify the request because there is no signing information.");
		}

		if( strpos($authHeader, ($this->getSignature())) === false || strpos($authHeader, $this->getSignature()) !== 0)
		{
			throw new \InvalidArgumentException("The Authorization header contained a signature that doens't match the current \n
												version signature. Expected to find " . $this->getSignature() . " at start \n
												of the authorization header. Something else was there. It's possible that you're using\n
												an newer/older version of the library to sign the request then used to verify the request.\n
												Note that this doens't nessisarily mean that the request is invalid, but because signatures\n
												may be computed different in different versions, it's important to be sure the versions\n
												match to prevent false-negatives.");
		}

		$authHeader = str_replace($this->getSignature(), '', $authHeader);
		$splitHeaders = array_map('trim', explode(',', $authHeader));
		$result = [];
		for($i = 0; $i < count($splitHeaders); $i++){
			list($key, $val) = explode('=', $splitHeaders[$i]);
			$result[trim($key)] = $val;
		}

		$result['SignedHeaders'] = explode(';', $result['SignedHeaders']);

		return $result;
	}

	private function retrieveOriginalDate(Request $request)
	{
		$date = $request->headers->get('X-' . $this->getHeaderNamespace() .'-Date');
		if( ! $date )
		{
			throw new \InvalidArgumentException("No X-" . $this->getHeaderNamespace() . "-Date header was provided. \n
			   									Expected X-" . $this->getHeaderNamespace() . "-Date. Without this header it's not\n
												possible to verify the request because there is no signing information.");
		}

		if($this->shouldCheckRequestAge() && (strtotime(gmdate(self::ISO8601_BASIC)) - strtotime($date) > $this->maxRequestAge())){
			throw new ExpiredRequestTimestampException($this->maxRequestAge());
		}

		return $date;
	}

}


text:
var Dateify = function(dateValue) {
  this.dateTime = new Date(dateValue);
  this.hours = this.dateTime.getHours();
  this.minutes = this.dateTime.getMinutes();
  this.calendarDate = Date.UTC(
                                this.dateTime.getFullYear(),
                                this.dateTime.getMonth(),
                                this.dateTime.getDate()
                              );
  this.now = new Date(Date.now());
  this.currentCalendarDate = Date.UTC(
                                       this.now.getFullYear(),
                                       this.now.getMonth(),
                                       this.now.getDate()
                                     );
  this.longDayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
  this.shortDayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
  this.longMonthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
  this.shortMonthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
};

Dateify.millisecondsFromNow = function(dateValue) {
  var dateify = new Dateify(dateValue);
  return dateify.dateTime - dateify.now;
};

Dateify.secondsFromNow = function(dateValue) {
  return parseInt(this.millisecondsFromNow(dateValue) / 1000);
};

Dateify.minutesFromNow = function(dateValue) {
  return parseInt(this.millisecondsFromNow(dateValue) / 60000);
};

Dateify.hoursFromNow = function(dateValue) {
  return parseInt(this.millisecondsFromNow(dateValue) / 3600000);
};

Dateify.calendarDaysFromNow = function(dateValue) {
  var dateify = new Dateify(dateValue);
  return parseInt((dateify.calendarDate - dateify.currentCalendarDate) / 86400000);
};

Dateify.createMessage = function(timeDifference, unit) {
  if (timeDifference > 0) {
    return "in " + timeDifference + " " + unit;
  }
  else if (timeDifference < 0) {
    return Math.abs(timeDifference) + " " + unit + " ago";
  };
};

Dateify.sayDays = function(dateValue) {
  var recent = {
    "-1": "yesterday",
    "0": "today",
    "1": "tomorrow"
  };
  var calendarDaysFromNow = this.calendarDaysFromNow(dateValue);
  var recentMessage = recent[calendarDaysFromNow];

  if (recentMessage) {
    return recentMessage;
  }
  else {
    return this.createMessage(calendarDaysFromNow, "days");
  };
};

Dateify.sayTime = function(dateValue) {
  var dateify = new Dateify(dateValue);
  var hours = dateify.hours;
  var minutes = dateify.minutes;
  var timeOfDay = (hours < 12) ? "AM":"PM";

  if (hours === 0) {
    hours = 12;
  }
  else if (hours >= 13) {
    hours -= 12;
  };

  if (minutes < 10) {
    minutes = "0" + minutes;
  }

  return hours + ":" + minutes + " " + timeOfDay;
};


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Tests for element</title>

element #1 (hidden)

element #2 (invisible)

element #1 (visible)

element #2 (visible)

element #3 (hidden)


text:
package com.eolwral.osmonitor.provider;

import com.eolwral.osmonitor.db.PreferenceDBHelper;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;

public class PreferenceContentProvider extends ContentProvider {
  private PreferenceDBHelper dbHelper = null;
  private SQLiteDatabase database = null;

  public final static String TABLE = "preference";
  public final static String KEY = "id";
  public final static String VALUE = "value";
  public static final String NOEXIST = "noExist";

  // base
  private static final String AUTHORITY = "com.eolwral.osmonitor.provider";
  private static final String SETTINGS_PATH = "settings";

  private static final int SETTINGS_METHOD = 10;

  public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + SETTINGS_PATH);

  // prepare UriMatcher
  private static final UriMatcher osmURIMatcher = new UriMatcher(UriMatcher.NO_MATCH);
  static {
    osmURIMatcher.addURI(AUTHORITY, SETTINGS_PATH, SETTINGS_METHOD);
  }

  @Override
  public boolean onCreate() {
    initSQLiteDB();
    return false;
  }

  private void initSQLiteDB() {
    dbHelper = new PreferenceDBHelper(getContext());
    database = dbHelper.getWritableDatabase();
  }

  @Override
  public Cursor query(Uri uri, String[] projection, String selection,
      String[] selectionArgs, String sortOrder) {

    int uriType = osmURIMatcher.match(uri);
    Cursor cursor = null;

    switch (uriType) {
    case SETTINGS_METHOD:
      cursor = database.query(TABLE, projection, selection, selectionArgs,
          null, null, sortOrder);
      break;
    default:
      throw new IllegalArgumentException("Unknown URI: " + uri);
    }

    return cursor;
  }

  @Override
  public String getType(Uri uri) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public Uri insert(Uri uri, ContentValues values) {

    int uriType = osmURIMatcher.match(uri);
    long recordId = 0;

    switch (uriType) {
    case SETTINGS_METHOD:
      recordId = database.insert(TABLE, null, values);
      break;
    default:
      throw new IllegalArgumentException("Unknown URI: " + uri);
    }

    // notify
    getContext().getContentResolver().notifyChange(uri, null);

    if (recordId == -1)
      return Uri.parse(SETTINGS_PATH + "/" + NOEXIST);
    return Uri.parse(SETTINGS_PATH + "/" + values.get(KEY));
  }

  @Override
  public int delete(Uri uri, String selection, String[] selectionArgs) {
    return 0;
  }

  @Override
  public int update(Uri uri, ContentValues values, String selection,
      String[] selectionArgs) {
    int uriType = osmURIMatcher.match(uri);

    int rowsUpdated = 0;
    switch (uriType) {
    case SETTINGS_METHOD:
      rowsUpdated = database.update(TABLE, values, selection, selectionArgs);
      break;
    default:
      throw new IllegalArgumentException("Unknown URI: " + uri);
    }

    // notify
    getContext().getContentResolver().notifyChange(uri, null);

    return rowsUpdated;
  }

}


text:
// ✿✿✿✿ ʕ •ᴥ•ʔ/ ︻デ═一

package pylapp.smoothclicker.android.tools.screen;

import android.app.Activity;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.widget.Toast;

import pylapp.smoothclicker.android.receivers.BRScreenOff;
import pylapp.smoothclicker.android.utils.Config;
import pylapp.smoothclicker.android.views.SettingsActivity;

/**
 * Async Task which consists on working on the device and more on its screen of displayed elements.
 *
 * @author Pierre-Yves Lapersonne
 * @version 1.1.0
 * @since 13/06/2016
 * @see AsyncTask
 */
public abstract class AsyncTaskForScreen<T, U, V> extends AsyncTask<T, U, V>{

    /* ********** *
     * ATTRIBUTES *
     * ********** */

    /**
     * The application context
     */
    protected Activity mContext;

    /**
     * The receiver which will deal with the screen-off events
     */
    private BRScreenOff mBrScreenOff;

    /**
     * Flag which indicates if the broadcast receiver dedicated to screen-off events is registered
     */
    private boolean mIsBrScreenOffRegistered;

    //private static final String LOG_TAG = AsyncTaskForScreen.class.getSimpleName();

    /* *********** *
     * CONSTRUCTOR *
     * *********** */

    /**
     *
     * @param c - The context to use, must not be null
     */
    public AsyncTaskForScreen(Activity c){
        super();
        if ( c == null ) throw new IllegalArgumentException("The context parameter must not be null!");
        mContext = c;
    }

    /* ******* *
     * METHODS *
     * ******* */

    /**
     * Forces the screen state making the screen on and unlocking the device (if needed).
     * It registers a receiver which will deal with screen-off events
     */
    protected void forceScreenState(){
        forceScreenOnIfNeeded();
        forceScreenUnlockIfNeeded();
        registerScreenOffReceiver();
    }

    /**
     * Forces the screen's state to make it always on if needed (i.e. if the settings have the dedicated option activated).
     * It will make the screen on and keeps it on.
     * Wakelocks will be used to awake the screen and keep it on.
     */
    protected void forceScreenOnIfNeeded(){

        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
        boolean isEnabled = sp.getBoolean(SettingsActivity.PREF_KEY_WAKELOCK, false);
        if ( isEnabled ){
            WakelockManager.instance.refreshContext(mContext);
            WakelockManager.instance.acquireWakelock();
        }

    }

    /**
     * Forces the phone to have its screen unlocked by executing a dedicated custom script
     * the user has put in its device
     */
    protected void forceScreenUnlockIfNeeded(){

        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
        boolean isEnabled = sp.getBoolean(SettingsActivity.PREF_KEY_UNLOCK_SCRIPT, false);

        if ( isEnabled ){
            KeyguardManager km = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
            if (km.inKeyguardRestrictedInputMode()) {
                UnlockerStub unlocker = new UnlockerImpl(sp.getString(SettingsActivity.PREF_KEY_FILE_UNLOCK_NAME, Config.DEFAULT_FILE_SH_UNLOCK_NAME));
                try {
                    unlocker.unlock(null);
                } catch (UnlockerStub.UnlockException ue) {
                    ue.printStackTrace();
                    displayToast("An error occurs during unlock execution: " + ue.getMessage());
                }
            }
        }

    }

    /**
     * Disable the lock which made the screen always on
     */
    protected void disableForceScreenOn(){
        WakelockManager.instance.releaseWakelock();
        unregisterScreenOffReceiver();
    }

    /**
     * Checks if the task has been canceled or must finish.
     * In this case the task will release the screen-always--on-lock
     * @return boolean - True if the AsyncTask has been cancelled, false otherwise
     */
    protected boolean checkIfCancelled(){
        if ( isCancelled() || getStatus() == Status.FINISHED ){
            disableForceScreenOn();
            return true;
        }
        return false;
    }

    /**
     * Registers a broadcast receiver which is triggered when a screen-off event is broadcast
     */
    protected void registerScreenOffReceiver(){
        IntentFilter screenStateFilter = new IntentFilter();
        screenStateFilter.addAction(BRScreenOff.SCREEN_OFF_ACTION);
        if ( mBrScreenOff != null && mIsBrScreenOffRegistered ){
            try {
                mContext.unregisterReceiver(mBrScreenOff);
                mIsBrScreenOffRegistered = false;
            } catch ( IllegalArgumentException iae ){
                iae.printStackTrace();
            }
        }
        mBrScreenOff = new BRScreenOff();
        mContext.registerReceiver(mBrScreenOff, screenStateFilter);
        mIsBrScreenOffRegistered = true;
    }

    /**
     * Unregisters the broadcast receiver which is triggered when a screen-off event is broadcast
     */
    protected void unregisterScreenOffReceiver(){
        if ( mBrScreenOff != null && mIsBrScreenOffRegistered ){
            try {
                mContext.unregisterReceiver(mBrScreenOff);
                mIsBrScreenOffRegistered = false;
            } catch ( IllegalArgumentException iae ){
                iae.printStackTrace();
            }
        }
    }

    /**
     * Displays a toast with a dedicated message
     * @param m - The message to display in a toast
     */
    protected void displayToast( final String m ){
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(mContext, m, Toast.LENGTH_LONG).show();
            }
        });
    }

}


text:
// -----------------------------------------------------------------------------------
//
//	Lightbox v2.04
//	by Lokesh Dhakar - http://www.lokeshdhakar.com
//	Last Modification: 2/9/08
//
//	For more information, visit:
//	http://lokeshdhakar.com/projects/lightbox2/
//
//	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
//  	- Free for use in both personal and commercial projects
//		- Attribution requires leaving author name, author link, and the license info intact.
//
//  Thanks: Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.com), and Thomas Fuchs(mir.aculo.us) for ideas, libs, and snippets.
//  		Artemy Tregubenko (arty.name) for cleanup and help in updating to latest ver of proto-aculous.
//
// -----------------------------------------------------------------------------------
/*

    Table of Contents
    -----------------
    Configuration

    Lightbox Class Declaration
    - initialize()
    - updateImageList()
    - start()
    - changeImage()
    - resizeImageContainer()
    - showImage()
    - updateDetails()
    - updateNav()
    - enableKeyboardNav()
    - disableKeyboardNav()
    - keyboardAction()
    - preloadNeighborImages()
    - end()

    Function Calls
    - document.observe()

*/
// -----------------------------------------------------------------------------------

//
//  Configurationl
//
LightboxOptions = Object.extend({
    fileLoadingImage:        '/samples/web-designs/images/loading.gif',
    fileBottomNavCloseImage: '/samples/web-designs/images/closelabel.gif',

    overlayOpacity: 0.8,   // controls transparency of shadow overlay

    animate: true,         // toggles resizing animations
    resizeSpeed: 7,        // controls the speed of the image resizing animations (1=slowest and 10=fastest)

    borderSize: 10,         //if you adjust the padding in the CSS, you will need to update this variable

	// When grouping images this is used to write: Image # of #.
	// Change it for non-english localization
	labelImage: "Image",
	labelOf: "of"
}, window.LightboxOptions || {});

// -----------------------------------------------------------------------------------

var Lightbox = Class.create();

Lightbox.prototype = {
    imageArray: [],
    activeImage: undefined,

    // initialize()
    // Constructor runs on completion of the DOM loading. Calls updateImageList and then
    // the function inserts html at the bottom of the page which is used to display the shadow
    // overlay and the image container.
    //
    initialize: function() {

        this.updateImageList();

        this.keyboardAction = this.keyboardAction.bindAsEventListener(this);

        if (LightboxOptions.resizeSpeed > 10) LightboxOptions.resizeSpeed = 10;
        if (LightboxOptions.resizeSpeed < 1)  LightboxOptions.resizeSpeed = 1;

	    this.resizeDuration = LightboxOptions.animate ? ((11 - LightboxOptions.resizeSpeed) * 0.15) : 0;
	    this.overlayDuration = LightboxOptions.animate ? 0.2 : 0;  // shadow fade in/out duration

        // When Lightbox starts it will resize itself from 250 by 250 to the current image dimension.
        // If animations are turned off, it will be hidden as to prevent a flicker of a
        // white 250 by 250 box.
        var size = (LightboxOptions.animate ? 250 : 1) + 'px';

        // Code inserts html at the bottom of the page that looks similar to this:
        //
        //

        //

        //

        //

        //
        //

        //
        //
        //

        //

        //
        //
        //
        //

        //

        //

        //

        //

        //

        //
        //
        //

        //

        //
        //
        //
        //

        //

        //

        //

        var objBody = $$('body')[0];

		objBody.appendChild(Builder.node('div',{id:'overlay'}));

        objBody.appendChild(Builder.node('div',{id:'lightbox'}, [
            Builder.node('div',{id:'outerImageContainer'},
                Builder.node('div',{id:'imageContainer'}, [
                    Builder.node('img',{id:'lightboxImage'}),
                    Builder.node('div',{id:'hoverNav'}, [
                        Builder.node('a',{id:'prevLink', href: '#' }),
                        Builder.node('a',{id:'nextLink', href: '#' })
                    ]),
                    Builder.node('div',{id:'loading'},
                        Builder.node('a',{id:'loadingLink', href: '#' },
                            Builder.node('img', {src: LightboxOptions.fileLoadingImage})
                        )
                    )
                ])
            ),
            Builder.node('div', {id:'imageDataContainer'},
                Builder.node('div',{id:'imageData'}, [
                    Builder.node('div',{id:'imageDetails'}, [
                        Builder.node('span',{id:'caption'}),
                        Builder.node('span',{id:'numberDisplay'})
                    ]),
                    Builder.node('div',{id:'bottomNav'},
                        Builder.node('a',{id:'bottomNavClose', href: '#' },
                            Builder.node('img', { src: LightboxOptions.fileBottomNavCloseImage })
                        )
                    )
                ])
            )
        ]));

		$('overlay').hide().observe('click', (function() { this.end(); }).bind(this));
		$('lightbox').hide().observe('click', (function(event) { if (event.element().id == 'lightbox') this.end(); }).bind(this));
		$('outerImageContainer').setStyle({ width: size, height: size });
		$('prevLink').observe('click', (function(event) { event.stop(); this.changeImage(this.activeImage - 1); }).bindAsEventListener(this));
		$('nextLink').observe('click', (function(event) { event.stop(); this.changeImage(this.activeImage + 1); }).bindAsEventListener(this));
		$('loadingLink').observe('click', (function(event) { event.stop(); this.end(); }).bind(this));
		$('bottomNavClose').observe('click', (function(event) { event.stop(); this.end(); }).bind(this));

        var th = this;
        (function(){
            var ids =
                'overlay lightbox outerImageContainer imageContainer lightboxImage hoverNav prevLink nextLink loading loadingLink ' +
                'imageDataContainer imageData imageDetails caption numberDisplay bottomNav bottomNavClose';
            $w(ids).each(function(id){ th[id] = $(id); });
        }).defer();
    },

    //
    // updateImageList()
    // Loops through anchor tags looking for 'lightbox' references and applies onclick
    // events to appropriate links. You can rerun after dynamically adding images w/ajax.
    //
    updateImageList: function() {
        this.updateImageList = Prototype.emptyFunction;

        document.observe('click', (function(event){
            var target = event.findElement('a[rel^=lightbox]') || event.findElement('area[rel^=lightbox]');
            if (target) {
                event.stop();
                this.start(target);
            }
        }).bind(this));
    },

    //
    //  start()
    //  Display overlay and lightbox. If image is part of a set, add siblings to imageArray.
    //
    start: function(imageLink) {

        $$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'hidden' });

        // stretch overlay to fill page and fade in
        var arrayPageSize = this.getPageSize();
        $('overlay').setStyle({ width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px' });

        new Effect.Appear(this.overlay, { duration: this.overlayDuration, from: 0.0, to: LightboxOptions.overlayOpacity });

        this.imageArray = [];
        var imageNum = 0;

        if ((imageLink.rel == 'lightbox')){
            // if image is NOT part of a set, add single image to imageArray
            this.imageArray.push([imageLink.href, imageLink.title]);
        } else {
            // if image is part of a set..
            this.imageArray =
                $$(imageLink.tagName + '[href][rel="' + imageLink.rel + '"]').
                collect(function(anchor){ return [anchor.href, anchor.title]; }).
                uniq();

            while (this.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
        }

        // calculate top and left offset for the lightbox
        var arrayPageScroll = document.viewport.getScrollOffsets();
        var lightboxTop = arrayPageScroll[1] + (document.viewport.getHeight() / 10);
        var lightboxLeft = arrayPageScroll[0];
        this.lightbox.setStyle({ top: lightboxTop + 'px', left: lightboxLeft + 'px' }).show();

        this.changeImage(imageNum);
    },

    //
    //  changeImage()
    //  Hide most elements and preload image in preparation for resizing image container.
    //
    changeImage: function(imageNum) {

        this.activeImage = imageNum; // update global var

        // hide elements during transition
        if (LightboxOptions.animate) this.loading.show();
        this.lightboxImage.hide();
        this.hoverNav.hide();
        this.prevLink.hide();
        this.nextLink.hide();
		// HACK: Opera9 does not currently support scriptaculous opacity and appear fx
        this.imageDataContainer.setStyle({opacity: .0001});
        this.numberDisplay.hide();

        var imgPreloader = new Image();

        // once image is preloaded, resize image container

        imgPreloader.onload = (function(){
            this.lightboxImage.src = this.imageArray[this.activeImage][0];
            this.resizeImageContainer(imgPreloader.width, imgPreloader.height);
        }).bind(this);
        imgPreloader.src = this.imageArray[this.activeImage][0];
    },

    //
    //  resizeImageContainer()
    //
    resizeImageContainer: function(imgWidth, imgHeight) {

        // get current width and height
        var widthCurrent  = this.outerImageContainer.getWidth();
        var heightCurrent = this.outerImageContainer.getHeight();

        // get new width and height
        var widthNew  = (imgWidth  + LightboxOptions.borderSize * 2);
        var heightNew = (imgHeight + LightboxOptions.borderSize * 2);

        // scalars based on change from old to new
        var xScale = (widthNew  / widthCurrent)  * 100;
        var yScale = (heightNew / heightCurrent) * 100;

        // calculate size difference between new and old image, and resize if necessary
        var wDiff = widthCurrent - widthNew;
        var hDiff = heightCurrent - heightNew;

        if (hDiff != 0) new Effect.Scale(this.outerImageContainer, yScale, {scaleX: false, duration: this.resizeDuration, queue: 'front'});
        if (wDiff != 0) new Effect.Scale(this.outerImageContainer, xScale, {scaleY: false, duration: this.resizeDuration, delay: this.resizeDuration});

        // if new and old image are same size and no scaling transition is necessary,
        // do a quick pause to prevent image flicker.
        var timeout = 0;
        if ((hDiff == 0) && (wDiff == 0)){
            timeout = 100;
            if (Prototype.Browser.IE) timeout = 250;
        }

        (function(){
            this.prevLink.setStyle({ height: imgHeight + 'px' });
            this.nextLink.setStyle({ height: imgHeight + 'px' });
            this.imageDataContainer.setStyle({ width: widthNew + 'px' });

            this.showImage();
        }).bind(this).delay(timeout / 1000);
    },

    //
    //  showImage()
    //  Display image and begin preloading neighbors.
    //
    showImage: function(){
        this.loading.hide();
        new Effect.Appear(this.lightboxImage, {
            duration: this.resizeDuration,
            queue: 'end',
            afterFinish: (function(){ this.updateDetails(); }).bind(this)
        });
        this.preloadNeighborImages();
    },

    //
    //  updateDetails()
    //  Display caption, image number, and bottom nav.
    //
    updateDetails: function() {

        // if caption is not null
        if (this.imageArray[this.activeImage][1] != ""){
            this.caption.update(this.imageArray[this.activeImage][1]).show();
        }

        // if image is part of set display 'Image x of x'
        if (this.imageArray.length > 1){
            this.numberDisplay.update( LightboxOptions.labelImage + ' ' + (this.activeImage + 1) + ' ' + LightboxOptions.labelOf + '  ' + this.imageArray.length).show();
        }

        new Effect.Parallel(
            [
                new Effect.SlideDown(this.imageDataContainer, { sync: true, duration: this.resizeDuration, from: 0.0, to: 1.0 }),
                new Effect.Appear(this.imageDataContainer, { sync: true, duration: this.resizeDuration })
            ],
            {
                duration: this.resizeDuration,
                afterFinish: (function() {
	                // update overlay size and update nav
	                var arrayPageSize = this.getPageSize();
	                this.overlay.setStyle({ height: arrayPageSize[1] + 'px' });
	                this.updateNav();
                }).bind(this)
            }
        );
    },

    //
    //  updateNav()
    //  Display appropriate previous and next hover navigation.
    //
    updateNav: function() {

        this.hoverNav.show();

        // if not first image in set, display prev image button
        if (this.activeImage > 0) this.prevLink.show();

        // if not last image in set, display next image button
        if (this.activeImage < (this.imageArray.length - 1)) this.nextLink.show();

        this.enableKeyboardNav();
    },

    //
    //  enableKeyboardNav()
    //
    enableKeyboardNav: function() {
        document.observe('keydown', this.keyboardAction);
    },

    //
    //  disableKeyboardNav()
    //
    disableKeyboardNav: function() {
        document.stopObserving('keydown', this.keyboardAction);
    },

    //
    //  keyboardAction()
    //
    keyboardAction: function(event) {
        var keycode = event.keyCode;

        var escapeKey;
        if (event.DOM_VK_ESCAPE) {  // mozilla
            escapeKey = event.DOM_VK_ESCAPE;
        } else { // ie
            escapeKey = 27;
        }

        var key = String.fromCharCode(keycode).toLowerCase();

        if (key.match(/x|o|c/) || (keycode == escapeKey)){ // close lightbox
            this.end();
        } else if ((key == 'p') || (keycode == 37)){ // display previous image
            if (this.activeImage != 0){
                this.disableKeyboardNav();
                this.changeImage(this.activeImage - 1);
            }
        } else if ((key == 'n') || (keycode == 39)){ // display next image
            if (this.activeImage != (this.imageArray.length - 1)){
                this.disableKeyboardNav();
                this.changeImage(this.activeImage + 1);
            }
        }
    },

    //
    //  preloadNeighborImages()
    //  Preload previous and next images.
    //
    preloadNeighborImages: function(){
        var preloadNextImage, preloadPrevImage;
        if (this.imageArray.length > this.activeImage + 1){
            preloadNextImage = new Image();
            preloadNextImage.src = this.imageArray[this.activeImage + 1][0];
        }
        if (this.activeImage > 0){
            preloadPrevImage = new Image();
            preloadPrevImage.src = this.imageArray[this.activeImage - 1][0];
        }

    },

    //
    //  end()
    //
    end: function() {
        this.disableKeyboardNav();
        this.lightbox.hide();
        new Effect.Fade(this.overlay, { duration: this.overlayDuration });
        $$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'visible' });
    },

    //
    //  getPageSize()
    //
    getPageSize: function() {

	     var xScroll, yScroll;

		if (window.innerHeight && window.scrollMaxY) {
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}

		var windowWidth, windowHeight;

		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth;
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}

		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else {
			pageHeight = yScroll;
		}

		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){
			pageWidth = xScroll;
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight];
	}
}

document.observe('dom:loaded', function () { new Lightbox(); });


text:
///////////////////////////////////////////////////////////////
// Scheduler.cs - Automatic persisting of database contents  //
// Ver 1.0                                                   //
// Application: Demonstration for CSE681-SMA, Project#2      //
// Language:    C#, ver 6.0, Visual Studio 2015              //
// Platform:    Dell XPS2700, Core-i7, Windows 10            //
// Author:      Ayush Khemka, aykhemka@syr.edu, 538044584    //
// Source:      Jim Fawcett, CST 4-187, Syracuse University  //
//              (315) 443-3948, jfawcett@twcny.rr.com        //
///////////////////////////////////////////////////////////////
/*
 * Package Operations:
 * -------------------
 * This package runs a simple timer and after a specific time
 * time interval, persists contents to XML files. This process
 * will carry on until a key is pressed.
 */
/*
 * Maintenance:
 * ------------
 * Required Files: UtilityExtensions.cs
 *
 * Build is based on TimerDemo.cs given by
 * Dr. James Fawcett as a starter package for
 * Project #2
 *
 * Build Process:  devenv Project2.sln /Rebuild debug
 *                 Run from Developer Command Prompt
 *                 To find: search for developer
 *
 * Maintenance History:
 * --------------------
 * ver 1.0 : 07 Oct 15
 * - first release
 *
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;

namespace Project2
{
    public class Scheduler
    {

        public Timer schedular { get; set; } = new Timer();

        public Scheduler(int interval)
        {
            schedular.Interval = interval;
            schedular.AutoReset = true;

            // Note use of timer's Elapsed delegate, binding to subscriber lambda
            // This delegate is invoked when the internal timer thread has waited
            // for the specified Interval.

            schedular.Elapsed += (object source, ElapsedEventArgs e) =>
            {

                Console.Write("\n  Persisted to XML files at {0}", e.SignalTime);
            };
        }
        static void Main(string[] args)
        {
            "Demonstrate Timer - needed for scheduled persistance in Project #2".title('=');
            Console.Write("\n\n  press any key to exit\n");

            Scheduler td = new Scheduler(100);
            td.schedular.Enabled = true;
            Console.ReadKey();
            Console.Write("\n\n");
        }
    }
}


text: alert( 'from example...' );


text:
<?php
namespace Procure\Domain\GoodsReceipt\Validator;

use Procure\Domain\AbstractDoc;
use Procure\Domain\AbstractRow;
use Procure\Domain\Validator\AbstractValidator;
use Procure\Domain\Validator\RowValidatorInterface;

/**
 *
 * @author Nguyen Mau Tri - ngmautri@gmail.com
 *
 */
class NullRowValidator extends AbstractValidator implements RowValidatorInterface
{

    /**
     *
     * {@inheritdoc}
     * @see \Procure\Domain\Validator\RowValidatorInterface::validate()
     */
    public function validate(AbstractDoc $rootEntity, AbstractRow $localEntity)
    {
        // Do Nothing.
    }
}


text:
module AuthorizeNet
  URI = "https://api2.authorize.net/xml/v1/request.api"
  TEST_URI = "https://apitest.authorize.net/xml/v1/request.api"
  XML_SCHEMA = "AnetApi/xml/v1/schema/AnetApiSchema.xsd"
  XML_HEADER = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
  RESULT_OK = "Ok"
  RESULT_ERROR = "Error"

  # ===============================================================
  # Constants for types of authorize net credit card validation
  #
  # Live Mode - Executes a test charge on the credit card for $0.01
  #   that is immediately voided
  # Test Mode - Does basic mathematical checks on card validity
  # None - No validation, could be useful for integration tests?
  # ===============================================================
  module ValidationMode
    LIVE = "liveMode"
    TEST = "testMode"
    NONE = "None"
  end
end

# require all authorize-net files
current_dir = __FILE__.match(/(.*)\/authorize_net.rb/)
if !current_dir.nil?
  authorize_dir = current_dir[1] + "/authorize_net/**/*.rb"

  Dir[authorize_dir].each do |filename|
    require filename
  end

else
  raise "Error loading authorize_net files"
end


text:
class CategoriesController < ApplicationController

	before_action :authenticate_user!
	before_action :verify_is_moderator, :except => [:items]
	before_action :set_searching

	def index
		@categories = Category.all
	end

	def new
		@category = Category.new
		@categories = Category.roots
	end

	def create

		@category = Category.new(create_params)

		if @category.save

			redirect_to categories_path
		else
			render 'new'
		end
	end

	def edit

		@category = Category.find(params[:id])
		@categories = Category.roots
	end

	def update
		@category = Category.find(params[:id])

		if @category.update(create_params)
			redirect_to categories_path
		else
			render 'edit'
		end
	end

	def destroy
		@category = Category.find(params[:id])
		@category.destroy
		redirect_to categories_path
	end

	def show
		@category = Category.find(params[:id])
	end

	def items
		@category = Category.find(params[:id])
		@categories = @category.self_and_descendants
		#@categories = @category.self_and_descendants.page(params[:page])
	end

	def set_item
		parent_id = set_item_params

		@category = Category.find(parent_id)

		redirect_to items_path(:id => parent_id)
	end

#	def get_leaves
#
#		@class = params[:which]
#		@form = params[:form]
#		@categories = Category.find(params[:id]).children
#		respond_to do |format|
#			format.js
#    		end
#	end

  private
  def category_params
	 params.require(:category).permit(:name, :parent_id)

  end

  def create_params
	name = params.require(:category).permit(:name)
	parent_id = params.require(:parent).permit(:id1,:id2,:id3, :id4, :id5).values.reject(&:empty?).compact.last
	return name.merge(Hash["parent_id" => parent_id ])
  end

	def set_item_params
		return params.require(:category).permit(:id1,:id2,:id3, :id4, :id5).values.reject(&:empty?).compact.last
	end

	def set_searching
		@q = Item.ransack(params[:q])
	end

end


text:
/* Browser Resets
*********************************/
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus  {outline: none;}
.slides,
.flex-control-nav,
.flex-direction-nav {margin: 0; padding: 0; list-style: none;}

/* Icon Fonts
*********************************/
/* Font-face Icons */
@font-face {
	font-family: 'flexslider-icon';
	src:url('fonts/flexslider-icon.eot');
	src:url('fonts/flexslider-icon.eot@#iefix') format('embedded-opentype'),
		url('fonts/flexslider-icon.woff') format('woff'),
		url('fonts/flexslider-icon.ttf') format('truetype'),
		url('fonts/flexslider-icon.svg#flexslider-icon') format('svg');
	font-weight: normal;
	font-style: normal;
}

/* FlexSlider Necessary Styles
*********************************/
.flexslider, .flexslider-thumb {margin: 0; padding: 0;width: 100%;}
.flexslider, .flexslider-thumb  .slides > li {width: 100%;display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */
.flexslider, .flexslider-thumb  .slides img {width: 100%; display: block;}
.flex-pauseplay span {text-transform: capitalize;}

/* Clearfix for the .slides element */
.slides:after {content: "\0020"; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
html[xmlns] .slides {display: block;}
* html .slides {height: 1%;}

/* No JavaScript Fallback */
/* If you are not using another script, such as Modernizr, make sure you
 * include js that eliminates this class on page load */
.no-js .slides > li:first-child {display: block;}

/* FlexSlider Default Theme
*********************************/
.flexslider, .flexslider-thumb  { margin: 0 0 60px; background: #fff;position: relative; zoom: 1;}
/*
@-moz-document url-prefix() {
	.flexslider, .flexslider-thumb  {border-top:1px solid rgba(255,255,255,0.001);}
	.logo{margin-left: -220px;}
}
*/
.flex-viewport { max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -o-transition: all 1s ease; transition: all 1s ease; }
.loading .flex-viewport { max-height: 300px; }
.flexslider .slides, .flexslider-thumb .slides { zoom: 1; }
.carousel li { margin-right: 5px; }

/* Direction Nav */
.flex-direction-nav {*height: 0;line-height: 25px;}
.flex-direction-nav a  { text-decoration:none; display: block; width: 40px; height: 40px; margin: -20px 0 0; position: absolute; top: 50%; z-index: 10; overflow: hidden; opacity: 0; cursor: pointer; color: rgba(0,0,0,0.8); text-shadow: 1px 1px 0 rgba(255,255,255,0.3); -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; }
.flex-direction-nav .flex-prev { left: 0px; }
.flex-direction-nav .flex-next { right: 0px; text-align: right; }
.flexslider:hover .flex-prev { opacity: 0.7; left: 10px; }
.flexslider:hover .flex-next { opacity: 0.7; right: 10px; }
.flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover { opacity: 1; }
.flexslider-thumb:hover .flex-prev { opacity: 0.7; left: 10px; }
.flexslider-thumb:hover .flex-next { opacity: 0.7; right: 10px; }
.flexslider-thumb:hover .flex-next:hover, .flexslider:hover .flex-prev:hover { opacity: 1; }
.flex-direction-nav .flex-disabled { opacity: 0!important; filter:alpha(opacity=0); cursor: default; }
.flex-direction-nav a:before  { font-family: "flexslider-icon"; font-size: 40px; display: inline-block; content: '\f001'; }
.flex-direction-nav a.flex-next:before  { content: '\f002'; }

/* Pause/Play */
.flex-pauseplay a { display: block; width: 20px; height: 20px; position: absolute; bottom: 5px; left: 10px; opacity: 0.8; z-index: 10; overflow: hidden; cursor: pointer; color: #000; }
.flex-pauseplay a:before  { font-family: "flexslider-icon"; font-size: 20px; display: inline-block; content: '\f004'; }
.flex-pauseplay a:hover  { opacity: 1; }
.flex-pauseplay a.flex-play:before { content: '\f003'; }

/* Control Nav */
.flex-control-nav {width: 100%; position: absolute; bottom: -40px; text-align: center;}
.flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline;}
.flex-control-paging li a {width: 11px; height: 11px; display: block; background: #666; background: rgba(0,0,0,0.5); cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; -webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); -moz-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); -o-box-shadow: inset 0 0 3px rgba(0,0,0,0.3); box-shadow: inset 0 0 3px rgba(0,0,0,0.3); }
.flex-control-paging li a:hover { background: #333; background: rgba(0,0,0,0.7); }
.flex-control-paging li a.flex-active { background: #000; background: rgba(0,0,0,0.9); cursor: default; }

.flex-control-thumbs {margin: 5px 0 0; position: static; overflow: hidden;}
.flex-control-thumbs li {width: 25%; float: left; margin: 0;}
.flex-control-thumbs img {width: 100%; display: block; opacity: .7; cursor: pointer;}
.flex-control-thumbs img:hover {opacity: 1;}
.flex-control-thumbs .flex-active {opacity: 1; cursor: default;}

@media screen and (max-width: 860px) {
  .flex-direction-nav .flex-prev { opacity: 1; left: 10px;}
  .flex-direction-nav .flex-next { opacity: 1; right: 10px;}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>com.hazelcast.cache.impl (Hazelcast Root 3.3.3 API)</title>
<meta name="date" content="2014-11-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package com.hazelcast.cache.impl

     Hazelcast JSR-107 aka JCache implementation

See: Description

Interface Summary

Interface
Description

CacheEventData

Cache event data object used in publish - dispatch

CacheEventListener

Cache Event Listener

ICacheRecordStore

Record store for the ICache

Class Summary

Class
Description

AbstractClusterWideIterator<K,V>

Base cluster-wide iterator

CacheClearResponse

Provides the response service for CacheClearOperation

CacheDataSerializerHook

This class contains all the ID hooks for IdentifiedDataSerializable classes used inside the JCache framework.

CacheDistributedObject

distributed object for cache, it will be used as a delegate in CacheProxy

CacheEntry<K,V>

Entry for Cache.

CacheEntryEventImpl<K,V>

CacheEntryProcessorEntry<K,V>

Entry of Entry Processor for CacheEntry.

CacheEntryProcessorResult<T>

Result of the CacheEntryProcessorEntry

CacheEventDataImpl

CacheEventListenerAdaptor<K,V>

Adapter for EventListener.

CacheEventSet

CacheKeyIteratorResult

Result of the CacheKeyIteratorOperation

CacheMXBeanImpl

Implementation of the CacheMXBean.

CachePartitionSegment

Cache Partition Segment

 CachePartitionSegment is a data structure responsible from
 all cache data of a partition defined by partitionId

 This Data structure is managed by CacheService

CachePortableHook

This class contains all the ID hooks for Portable classes used inside the JCache framework.

CacheProxy<K,V>

ICache implementation:

 This proxy is the implementation of ICache and javax.cache.Cache which is returned by
 HazelcastServerCacheManager.

CacheProxyUtil

Helper methods for Cache Proxy impl

CacheRecordStore

Implementation of the ICacheRecordStore

 Represents a named ICache on-heap data for a single partition.

CacheService

Cache Service is the base access point of jcache impl to manage
 cache data on a node.

CacheStatisticsImpl

Some statistics of a ICache

 Statistics accumulated in this data object is published through MxBean

CacheStatisticsMXBeanImpl

Implementation of the CacheStatisticsMXBean

ClusterWideIterator<K,V>

Cluster-wide iterator for the ICache

 This cluster key iterator, uses to indexes to iterate the cluster which ar PartitionId and tableIndex.

HazelcastAbstractCachingProvider

Base CachingProvider implementations

HazelcastCacheManager

The Hazelcast CacheManager base class.

HazelcastCachingProvider

Hazelcast implementation of CachingProvider

HazelcastExpiryPolicy

Custom Expiry Policy helper class for general usage

HazelcastServerCacheManager

HazelcastServerCachingProvider

Provides server cachingProvider implementation.

MXBeanUtil

Provides utility functionality for the MXBean.

TCKMBeanServerBuilder

An MBeanServer builder for TCK tests.

TCKMBeanServerBuilder.RIMBeanServerDelegate

Enum Summary

Enum
Description

CacheEventType

cache events

Package com.hazelcast.cache.impl Description

     Hazelcast JSR-107 aka JCache implementation

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.


text:
import { idForProvider } from '../../_utils/idForProvider'

export default ({ provider }) => {
  const id = idForProvider(provider)
  return /* Prisma */ `
  generator client {
    provider = "prisma-client-js"
  }

  datasource db {
    provider = "${provider}"
    url      = env("DATABASE_URI_${provider}")
  }

  model User {
    id    ${id}
    email String  @unique
    name  String?
    posts Post[]
    val   Int?
  }

  model Post {
    id        ${id}
    createdAt DateTime @default(now())
    updatedAt DateTime @updatedAt
    published Boolean
    title     String
    content   String?
    authorId  String?
    author    User?    @relation(fields: [authorId], references: [id])
  }
  `
}


text:
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/market.dreamer.build.android/android-rename/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/market.dreamer.build.android/android-rename)
================

AndroidRenameGradlePlugin
================

Description
================

`Android` 应用打包结果重命名插件,可以应用在 `Application` 和 `Library` 中。

Integration
================

在项目的 `build.gradle` 中引用插件:

```gradle
dependencies {
    classpath 'com.android.tools.build:gradle:1.2.3'
    classpath 'market.dreamer.build.android:android-rename:0.0.5'
}
```

在模块的 `build.gradle` 中应用插件:

```gradle
apply plugin: 'com.android.application'
apply plugin: 'market.dreamer.android.rename'
```

Usage
================

**Basic Configuration**

```gradle
renameConfig {
    applicationName = "Test",
}
```

上面的配置将会得到输出结果 `Test-0.0.1-001-release.[apk/aar]` 。

**NOTE**
`renameConfig` 中能够使用的配置如下(以下所有配置皆可以定义为 `Closure` 形式,`Closure` 形式的定义将会取返回值作为结果):

* `applicationName` :应用的名称。`Closure` 形式时,没有传入参数。
* `versionName` :版本名称。在 `Android` 配置中,可能出现在两个地方,一是 `defaultConfig` 中,二是 `productFlavors` 中。定义为 `Closure` 时,会将 `versionName` 作为参数传入,如果定义了 `productFlavors` 将会传入 `flavors中的配置,否则使用 `defaultConfig` 中的值。
* `versionCode` :版本号。配置说明和 `versionName` 类似。
* `buildType` :编译类型。定义为 `Closure` 时,传入参数为 `buildType` 。
* `flavors` : `ProductFlavors` 。定义为 `Closure` 时,会将 `productFlavors` 列表作为参数传入。
* `divider` :分割符。默认分割符为 `-` ,可以通过这个字段做修改,这个字段也可以定义为 `Closure` 。
* `includes` :此配置定义最后的输出结果包含哪些部分,比如 `includes = [applicationName]` ,这时只能得到结果 `Test.[apk/aar]` ,而忽略掉了其他部分。除了以上给定的配置,也可以在 `includes` 中扩展自定义的 `Closure` 。
比如 `includes = [applicationName, {return new Date()}]` ,这时可以得到结果 `Test-20151017.[apk/aar]` 之类的结果。如果想要灵活的扩展,可以使用这个方式实现。

**More**

所有配置的默认值如下:

```gradle
renameConfig {
    applicationName = {}
    versionName = { versionName -> versionName }
    versionCode = { versionCode -> versionCode }
    buildType = { buildType -> buildType.name }
    flavors = { flavors -> flavors*.name.join(divider) }
    divider = { "-" }
    includes = [applicationName, versionName, versionCode, buildType, flavors];
}
```

如果想实现更深入的定制,可以按照以上配置进行自定义。

ChangeLog
================
0.0.5:

- Fix build exception

0.0.4:

- Fix error building when clean

0.0.3:

- Fix zip align error

License
=======

The MIT License (MIT)

Copyright (c) 2015 GodJobs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.