text:
static const char metal_ad_model_unlit_ps[] = R"(mtlcode
#pragma clang diagnostic ignored "-Wmissing-prototypes"

#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

struct PS_Input
{
    float4 PosVS;
    float4 Color;
    float4 UV_Others;
    float3 WorldN;
    float4 Alpha_Dist_UV;
    float4 Blend_Alpha_Dist_UV;
    float4 Blend_FBNextIndex_UV;
    float4 PosP;
};

struct AdvancedParameter
{
    float2 AlphaUV;
    float2 UVDistortionUV;
    float2 BlendUV;
    float2 BlendAlphaUV;
    float2 BlendUVDistortionUV;
    float2 FlipbookNextIndexUV;
    float FlipbookRate;
    float AlphaThreshold;
};

struct PS_ConstanBuffer
{
    float4 fLightDirection;
    float4 fLightColor;
    float4 fLightAmbient;
    float4 fFlipbookParameter;
    float4 fUVDistortionParameter;
    float4 fBlendTextureParameter;
    float4 fCameraFrontDirection;
    float4 fFalloffParameter;
    float4 fFalloffBeginColor;
    float4 fFalloffEndColor;
    float4 fEmissiveScaling;
    float4 fEdgeColor;
    float4 fEdgeParameter;
    float4 softParticleParam;
    float4 reconstructionParam1;
    float4 reconstructionParam2;
    float4 mUVInversedBack;
    float4 miscFlags;
};

struct main0_out
{
    float4 _entryPointOutput [[color(0)]];
};

struct main0_in
{
    float4 Input_Color [[user(locn0), centroid_perspective]];
    float4 Input_UV_Others [[user(locn1), centroid_perspective]];
    float3 Input_WorldN [[user(locn2)]];
    float4 Input_Alpha_Dist_UV [[user(locn3)]];
    float4 Input_Blend_Alpha_Dist_UV [[user(locn4)]];
    float4 Input_Blend_FBNextIndex_UV [[user(locn5)]];
    float4 Input_PosP [[user(locn6)]];
};

static inline __attribute__((always_inline))
AdvancedParameter DisolveAdvancedParameter(thread const PS_Input& psinput)
{
    AdvancedParameter ret;
    ret.AlphaUV = psinput.Alpha_Dist_UV.xy;
    ret.UVDistortionUV = psinput.Alpha_Dist_UV.zw;
    ret.BlendUV = psinput.Blend_FBNextIndex_UV.xy;
    ret.BlendAlphaUV = psinput.Blend_Alpha_Dist_UV.xy;
    ret.BlendUVDistortionUV = psinput.Blend_Alpha_Dist_UV.zw;
    ret.FlipbookNextIndexUV = psinput.Blend_FBNextIndex_UV.zw;
    ret.FlipbookRate = psinput.UV_Others.z;
    ret.AlphaThreshold = psinput.UV_Others.w;
    return ret;
}

static inline __attribute__((always_inline))
float3 PositivePow(thread const float3& base, thread const float3& power)
{
    return pow(fast::max(abs(base), float3(1.1920928955078125e-07)), power);
}

static inline __attribute__((always_inline))
float3 LinearToSRGB(thread const float3& c)
{
    float3 param = c;
    float3 param_1 = float3(0.4166666567325592041015625);
    return fast::max((PositivePow(param, param_1) * 1.05499994754791259765625) - float3(0.054999999701976776123046875), float3(0.0));
}

static inline __attribute__((always_inline))
float4 LinearToSRGB(thread const float4& c)
{
    float3 param = c.xyz;
    return float4(LinearToSRGB(param), c.w);
}

static inline __attribute__((always_inline))
float4 ConvertFromSRGBTexture(thread const float4& c, thread const bool& isValid)
{
    if (!isValid)
    {
        return c;
    }
    float4 param = c;
    return LinearToSRGB(param);
}

static inline __attribute__((always_inline))
float2 UVDistortionOffset(texture2d<float> t, sampler s, thread const float2& uv, thread const float2& uvInversed, thread const bool& convertFromSRGB)
{
    float4 sampledColor = t.sample(s, uv);
    if (convertFromSRGB)
    {
        float4 param = sampledColor;
        bool param_1 = convertFromSRGB;
        sampledColor = ConvertFromSRGBTexture(param, param_1);
    }
    float2 UVOffset = (sampledColor.xy * 2.0) - float2(1.0);
    UVOffset.y *= (-1.0);
    UVOffset.y = uvInversed.x + (uvInversed.y * UVOffset.y);
    return UVOffset;
}

static inline __attribute__((always_inline))
void ApplyFlipbook(thread float4& dst, texture2d<float> t, sampler s, float4 flipbookParameter, float4 vcolor, float2 nextUV, thread const float& flipbookRate, thread const bool& convertFromSRGB)
{
    if (flipbookParameter.x > 0.0)
    {
        float4 sampledColor = t.sample(s, nextUV);
        if (convertFromSRGB)
        {
            float4 param = sampledColor;
            bool param_1 = convertFromSRGB;
            sampledColor = ConvertFromSRGBTexture(param, param_1);
        }
        float4 NextPixelColor = sampledColor * vcolor;
        if (flipbookParameter.y == 1.0)
        {
            dst = mix(dst, NextPixelColor, float4(flipbookRate));
        }
    }
}

static inline __attribute__((always_inline))
void ApplyTextureBlending(thread float4& dstColor, float4 blendColor, float blendType)
{
    if (blendType == 0.0)
    {
        float3 _222 = (blendColor.xyz * blendColor.w) + (dstColor.xyz * (1.0 - blendColor.w));
        dstColor = float4(_222.x, _222.y, _222.z, dstColor.w);
    }
    else
    {
        if (blendType == 1.0)
        {
            float3 _234 = dstColor.xyz + (blendColor.xyz * blendColor.w);
            dstColor = float4(_234.x, _234.y, _234.z, dstColor.w);
        }
        else
        {
            if (blendType == 2.0)
            {
                float3 _247 = dstColor.xyz - (blendColor.xyz * blendColor.w);
                dstColor = float4(_247.x, _247.y, _247.z, dstColor.w);
            }
            else
            {
                if (blendType == 3.0)
                {
                    float3 _260 = dstColor.xyz * (blendColor.xyz * blendColor.w);
                    dstColor = float4(_260.x, _260.y, _260.z, dstColor.w);
                }
            }
        }
    }
}

static inline __attribute__((always_inline))
float SoftParticle(thread const float& backgroundZ, thread const float& meshZ, thread const float4& softparticleParam, thread const float4& reconstruct1, thread const float4& reconstruct2)
{
    float distanceFar = softparticleParam.x;
    float distanceNear = softparticleParam.y;
    float distanceNearOffset = softparticleParam.z;
    float2 rescale = reconstruct1.xy;
    float4 params = reconstruct2;
    float2 zs = float2((backgroundZ * rescale.x) + rescale.y, meshZ);
    float2 depth = ((zs * params.w) - float2(params.y)) / (float2(params.x) - (zs * params.z));
    float dir = sign(depth.x);
    depth *= dir;
    float alphaFar = (depth.x - depth.y) / distanceFar;
    float alphaNear = (depth.y - distanceNearOffset) / distanceNear;
    return fast::min(fast::max(fast::min(alphaFar, alphaNear), 0.0), 1.0);
}

static inline __attribute__((always_inline))
float3 SRGBToLinear(thread const float3& c)
{
    return fast::min(c, c * ((c * ((c * 0.305306017398834228515625) + float3(0.6821711063385009765625))) + float3(0.01252287812530994415283203125)));
}

static inline __attribute__((always_inline))
float4 SRGBToLinear(thread const float4& c)
{
    float3 param = c.xyz;
    return float4(SRGBToLinear(param), c.w);
}

static inline __attribute__((always_inline))
float4 ConvertToScreen(thread const float4& c, thread const bool& isValid)
{
    if (!isValid)
    {
        return c;
    }
    float4 param = c;
    return SRGBToLinear(param);
}

static inline __attribute__((always_inline))
float4 _main(PS_Input Input, constant PS_ConstanBuffer& v_417, thread texture2d<float> _uvDistortionTex, thread sampler sampler_uvDistortionTex, thread texture2d<float> _colorTex, thread sampler sampler_colorTex, thread texture2d<float> _alphaTex, thread sampler sampler_alphaTex, thread texture2d<float> _blendUVDistortionTex, thread sampler sampler_blendUVDistortionTex, thread texture2d<float> _blendTex, thread sampler sampler_blendTex, thread texture2d<float> _blendAlphaTex, thread sampler sampler_blendAlphaTex, thread texture2d<float> _depthTex, thread sampler sampler_depthTex)
{
    bool convertColorSpace = (isunordered(v_417.miscFlags.x, 0.0) || v_417.miscFlags.x != 0.0);
    PS_Input param = Input;
    AdvancedParameter advancedParam = DisolveAdvancedParameter(param);
    float2 param_1 = advancedParam.UVDistortionUV;
    float2 param_2 = v_417.fUVDistortionParameter.zw;
    bool param_3 = convertColorSpace;
    float2 UVOffset = UVDistortionOffset(_uvDistortionTex, sampler_uvDistortionTex, param_1, param_2, param_3);
    UVOffset *= v_417.fUVDistortionParameter.x;
    float4 param_4 = _colorTex.sample(sampler_colorTex, (Input.UV_Others.xy + UVOffset));
    bool param_5 = convertColorSpace;
    float4 Output = ConvertFromSRGBTexture(param_4, param_5) * Input.Color;
    float4 param_6 = Output;
    float param_7 = advancedParam.FlipbookRate;
    bool param_8 = convertColorSpace;
    ApplyFlipbook(param_6, _colorTex, sampler_colorTex, v_417.fFlipbookParameter, Input.Color, advancedParam.FlipbookNextIndexUV + UVOffset, param_7, param_8);
    Output = param_6;
    float4 param_9 = _alphaTex.sample(sampler_alphaTex, (advancedParam.AlphaUV + UVOffset));
    bool param_10 = convertColorSpace;
    float4 AlphaTexColor = ConvertFromSRGBTexture(param_9, param_10);
    Output.w *= (AlphaTexColor.x * AlphaTexColor.w);
    float2 param_11 = advancedParam.BlendUVDistortionUV;
    float2 param_12 = v_417.fUVDistortionParameter.zw;
    bool param_13 = convertColorSpace;
    float2 BlendUVOffset = UVDistortionOffset(_blendUVDistortionTex, sampler_blendUVDistortionTex, param_11, param_12, param_13);
    BlendUVOffset *= v_417.fUVDistortionParameter.y;
    float4 param_14 = _blendTex.sample(sampler_blendTex, (advancedParam.BlendUV + BlendUVOffset));
    bool param_15 = convertColorSpace;
    float4 BlendTextureColor = ConvertFromSRGBTexture(param_14, param_15);
    float4 param_16 = _blendAlphaTex.sample(sampler_blendAlphaTex, (advancedParam.BlendAlphaUV + BlendUVOffset));
    bool param_17 = convertColorSpace;
    float4 BlendAlphaTextureColor = ConvertFromSRGBTexture(param_16, param_17);
    BlendTextureColor.w *= (BlendAlphaTextureColor.x * BlendAlphaTextureColor.w);
    float4 param_18 = Output;
    ApplyTextureBlending(param_18, BlendTextureColor, v_417.fBlendTextureParameter.x);
    Output = param_18;
    if (v_417.fFalloffParameter.x == 1.0)
    {
        float3 cameraVec = normalize(-v_417.fCameraFrontDirection.xyz);
        float CdotN = fast::clamp(dot(cameraVec, normalize(Input.WorldN)), 0.0, 1.0);
        float4 FalloffBlendColor = mix(v_417.fFalloffEndColor, v_417.fFalloffBeginColor, float4(pow(CdotN, v_417.fFalloffParameter.z)));
        if (v_417.fFalloffParameter.y == 0.0)
        {
            float3 _611 = Output.xyz + FalloffBlendColor.xyz;
            Output = float4(_611.x, _611.y, _611.z, Output.w);
        }
        else
        {
            if (v_417.fFalloffParameter.y == 1.0)
            {
                float3 _624 = Output.xyz - FalloffBlendColor.xyz;
                Output = float4(_624.x, _624.y, _624.z, Output.w);
            }
            else
            {
                if (v_417.fFalloffParameter.y == 2.0)
                {
                    float3 _637 = Output.xyz * FalloffBlendColor.xyz;
                    Output = float4(_637.x, _637.y, _637.z, Output.w);
                }
            }
        }
        Output.w *= FalloffBlendColor.w;
    }
    float3 _651 = Output.xyz * v_417.fEmissiveScaling.x;
    Output = float4(_651.x, _651.y, _651.z, Output.w);
    float4 screenPos = Input.PosP / float4(Input.PosP.w);
    float2 screenUV = (screenPos.xy + float2(1.0)) / float2(2.0);
    screenUV.y = 1.0 - screenUV.y;
    screenUV.y = v_417.mUVInversedBack.x + (v_417.mUVInversedBack.y * screenUV.y);
    if ((isunordered(v_417.softParticleParam.w, 0.0) || v_417.softParticleParam.w != 0.0))
    {
        float backgroundZ = _depthTex.sample(sampler_depthTex, screenUV).x;
        float param_19 = backgroundZ;
        float param_20 = screenPos.z;
        float4 param_21 = v_417.softParticleParam;
        float4 param_22 = v_417.reconstructionParam1;
        float4 param_23 = v_417.reconstructionParam2;
        Output.w *= SoftParticle(param_19, param_20, param_21, param_22, param_23);
    }
    if (Output.w <= fast::max(0.0, advancedParam.AlphaThreshold))
    {
        discard_fragment();
    }
    float3 _745 = mix(v_417.fEdgeColor.xyz * v_417.fEdgeParameter.y, Output.xyz, float3(ceil((Output.w - advancedParam.AlphaThreshold) - v_417.fEdgeParameter.x)));
    Output = float4(_745.x, _745.y, _745.z, Output.w);
    float4 param_24 = Output;
    bool param_25 = convertColorSpace;
    return ConvertToScreen(param_24, param_25);
}

fragment main0_out main0(main0_in in [[stage_in]], constant PS_ConstanBuffer& v_417 [[buffer(0)]], texture2d<float> _colorTex [[texture(0)]], texture2d<float> _alphaTex [[texture(1)]], texture2d<float> _uvDistortionTex [[texture(2)]], texture2d<float> _blendTex [[texture(3)]], texture2d<float> _blendAlphaTex [[texture(4)]], texture2d<float> _blendUVDistortionTex [[texture(5)]], texture2d<float> _depthTex [[texture(6)]], sampler sampler_colorTex [[sampler(0)]], sampler sampler_alphaTex [[sampler(1)]], sampler sampler_uvDistortionTex [[sampler(2)]], sampler sampler_blendTex [[sampler(3)]], sampler sampler_blendAlphaTex [[sampler(4)]], sampler sampler_blendUVDistortionTex [[sampler(5)]], sampler sampler_depthTex [[sampler(6)]], float4 gl_FragCoord [[position]])
{
    main0_out out = {};
    PS_Input Input;
    Input.PosVS = gl_FragCoord;
    Input.Color = in.Input_Color;
    Input.UV_Others = in.Input_UV_Others;
    Input.WorldN = in.Input_WorldN;
    Input.Alpha_Dist_UV = in.Input_Alpha_Dist_UV;
    Input.Blend_Alpha_Dist_UV = in.Input_Blend_Alpha_Dist_UV;
    Input.Blend_FBNextIndex_UV = in.Input_Blend_FBNextIndex_UV;
    Input.PosP = in.Input_PosP;
    float4 _785 = _main(Input, v_417, _uvDistortionTex, sampler_uvDistortionTex, _colorTex, sampler_colorTex, _alphaTex, sampler_alphaTex, _blendUVDistortionTex, sampler_blendUVDistortionTex, _blendTex, sampler_blendTex, _blendAlphaTex, sampler_blendAlphaTex, _depthTex, sampler_depthTex);
    out._entryPointOutput = _785;
    return out;
}

)";


text:
/**
 * @private
 */
Ext.define('Ext.event.publisher.Focus', {
    extend: 'Ext.event.publisher.Dom',

    handledEvents: ['focusin', 'focusout'],

    syntheticEvents: {
        focusenter: true,
        focusleave: true
    },

    eventMap: {
        focus: 'focusenter',
        focusin: 'focusenter',
        blur: 'focusleave',
        focusout: 'focusleave'
    },

    handles: function(eventName) {
        return this.syntheticEvents[eventName];
    },

    doDelegatedEvent: function(e, invokeAfter) {
        var me = this;

        e = me.callParent([e, false]);

        if (e) {
            me.processSyntheticEvent(me.eventMap[e.type], e);

            if (invokeAfter) {
                me.afterEvent(e);
            }
        }
    },

    createSyntheticEvent: function(eventName, origEvent, realTarget) {
        var event = new Ext.event.Event(origEvent.browserEvent);

        event.type = eventName;

        if (realTarget) {
            event.relatedTarget = event.target;
            event.target = realTarget;
        }
        else {
            event.target = origEvent.target;
            event.relatedTarget = origEvent.relatedTarget || null;
        }

        return event;
    },

    processSyntheticEvent: function(eventName, e, eventTarget) {
        var me = this,
            subscribers, nodes, node, i, len, targets;

        subscribers = me.getSubscribers(eventName);

        if (subscribers.$length) {
            nodes   = me.gatherSubscriberNodes(eventName, subscribers);
            targets = [];

            for (i = 0, len = nodes.length; i < len; i++) {
                node = nodes[i];

                if (me.isEventTarget(node, eventName, e, eventTarget)) {
                    targets.push(node);
                }
            }

            for (i = 0, len = targets.length; i < len; i++) {
                node = targets[i];

                if (node) {
                    me.fireNodeEvent(node, eventName, e, eventTarget);
                }
            }
        }
    },

    gatherSubscriberNodes: function(eventName, subscribers) {
        var idSubscribers = subscribers.id,
            classNameSubscribers = subscribers.className,
            selectorSubscribers = subscribers.selector,
            hasIdSubscribers = idSubscribers.$length > 0,
            hasClassNameSubscribers = classNameSubscribers.$length > 0,
            hasSelectorSubscribers = selectorSubscribers.$length > 0,
            result = [],
            subscriber, item;

        if (hasIdSubscribers) {
            for (item in idSubscribers) {
                if (item === '$length') {
                    continue;
                }

                subscriber = document.getElementById(item);

                if (subscriber) {
                    result.push(subscriber);
                }
            }
        }

        // Blow up for now
        if (hasClassNameSubscribers) {
            Ext.Error.raise('Class name subscribers in Focus publisher');
        }

        // Same thing
        if (hasSelectorSubscribers) {
            Ext.Error.raise('Selector subscribers in Focus publisher');
        }

        return result;
    },

    isEventTarget: function(node, eventName, e, realTarget) {
        return eventName === 'focusenter' ? this.isFocusEnterTarget(node, e, realTarget)
             : eventName === 'focusleave' ? this.isFocusLeaveTarget(node, e, realTarget)
             :                              null
        ;
    },

    isFocusEnterTarget: function(node, e, eventTarget) {
        var event = e.browserEvent,
            from = eventTarget || event.relatedTarget,
            to = event.target,
            fly;

        if (to === window) {
            return false;
        }

        fly = Ext.fly(node);

        // If the focusin event happened outside of the node, it's definitely
        // not going to be a focusenter.
        if (!fly.isAncestor(to)) {
            return false;
        }

        // For focusin events originated from the "outside" of the document,
        // IE will report as if they came from the document body, and WebKit
        // will set relatedTarget to null. That's an easy catch.
        if (!from) {
            return true;
        }

        // If the node is not a parent of the "from" element, then we have a
        // legit focusenter
        if (!fly.isAncestor(from)) {
            return true;
        }

        return false;
    },

    isFocusLeaveTarget: function(node, e, eventTarget) {
        var event = e.browserEvent,
            from = eventTarget !== undefined ? eventTarget : event.target,
            to = eventTarget !== undefined ? event.target : event.relatedTarget,
            fly;

        // In Firefox we have to do really strange things :/
        if (from === window || to === window) {
            return false;
        }

        fly = Ext.fly(node);

        if (!fly.isAncestor(from)) {
            return false;
        }

        if (!to) {
            return true;
        }

        if (!fly.isAncestor(to)) {
            return true;
        }

        return false;
    },

    fireNodeEvent: function(subscriber, eventName, origEvent, realTarget) {
        var e = this.createSyntheticEvent(eventName, origEvent, realTarget);

        e.setCurrentTarget(subscriber);

        this.dispatch('#' + subscriber.id, eventName, [e, subscriber]);
    }
},

function() {
    // At this point only Firefox does not support focusin/focusout, see this bug:
    // https://bugzilla.mozilla.org/show_bug.cgi?id=687787
    if (!Ext.supports.FocusinFocusoutEvents) {
        // We need to track previously focused element to detect when
        // a target lost focus
        document.addEventListener('blur', function(e) {
            if (e.target === window || e.target === document) {
                delete document.previousActiveElement;
            }
            else {
                document.previousActiveElement = e.target;
            }
        }, true);

        // When focusin/focusout are not available we capture focus event instead,
        // and fire both focusenter *and* focusleave in the focus handler.
        this.override({
            handledEvents: ['focus'],

            doDelegatedEvent: function(e, invokeAfter) {
                var me = this,
                    el;

                e = me.callSuper([e, false]);

                if (e) {
                    el = document.previousActiveElement;

                    if (el !== undefined) {
                        me.processSyntheticEvent('focusleave', e, el);
                    }

                    me.processSyntheticEvent(me.eventMap[e.type], e, el || null);

                    if (invokeAfter) {
                        me.afterEvent(e);
                    }
                }
            }
        });
    }
});

redpajama_set_name: RedPajamaGithub


text:
package io.seldon.recommendation;

import io.seldon.clustering.recommender.ItemRecommendationAlgorithm;
import io.seldon.recommendation.combiner.AlgorithmResultsCombiner;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;

/**
 * Strategy using algorithms passed in a JS call.
 *
 * @author firemanphil
 *         Date: 23/03/15
 *         Time: 13:58
 */
@Deprecated
public class JsOverrideClientStrategy implements ClientStrategy {
    private static Logger logger = Logger.getLogger(JsOverrideClientStrategy.class.getName());
    private static final Map<String, String> oldAlgNamesToNew = new HashMap<>();
    static {
        oldAlgNamesToNew.put("CLUSTER_COUNTS_ITEM_CATEGORY", "itemCategoryClusterCountsRecommender");
        oldAlgNamesToNew.put("CLUSTER_COUNTS_DYNAMIC", "dynamicClusterCountsRecommender");
        oldAlgNamesToNew.put("CLUSTER_COUNTS_GLOBAL", "globalClusterCountsRecommender");

        oldAlgNamesToNew.put("CLUSTER_COUNTS_FOR_ITEM", "itemClusterCountsRecommender");
        oldAlgNamesToNew.put("CLUSTER_COUNTS_SIGNIFICANT", "itemSignificantCountsRecommender");
        oldAlgNamesToNew.put("SEMANTIC_VECTORS", "semanticVectorsRecommender");
        oldAlgNamesToNew.put("SIMILAR_ITEMS", "itemSimilarityRecommender");
        oldAlgNamesToNew.put("RECENT_ITEMS", "recentItemsRecommender");
        oldAlgNamesToNew.put("MOST_POPULAR", "mostPopularRecommender");

        oldAlgNamesToNew.put("MATRIX_FACTOR", "mfRecommender");
        oldAlgNamesToNew.put("RECENT_MATRIX_FACTOR", "recentMfRecommender");
        oldAlgNamesToNew.put("RECENT_SIMILAR_ITEMS", "itemSimilarityRecommender");
        oldAlgNamesToNew.put("WORD2VEC", "word2vecRecommender");
        oldAlgNamesToNew.put("TOPIC_MODEL", "topicModelRecommender");
        oldAlgNamesToNew.put("RECENT_TOPIC_MODEL", "recentTopicModelRecommender");
    }
    private final ClientStrategy baseStrategy;
    private final Collection<String> overrideAlgs;
    private final ApplicationContext ctxt;

    public JsOverrideClientStrategy(ClientStrategy baseStrategy, Collection<String> overrideAlgs, ApplicationContext ctxt) {
        this.baseStrategy = baseStrategy;
        this.overrideAlgs = overrideAlgs;
        this.ctxt = ctxt;
    }

    @Override
    public Double getDiversityLevel(String userId, String recTag) {
        return baseStrategy.getDiversityLevel(userId, recTag);
    }

    @Override
    public List<AlgorithmStrategy> getAlgorithms(String userId, String recTag) {
        List<AlgorithmStrategy> baseAlgStrats = baseStrategy.getAlgorithms(userId, recTag);
        List<AlgorithmStrategy> alternate = new ArrayList<>();
        AlgorithmStrategy first = baseAlgStrats.get(0);
        for(String override : overrideAlgs){
            String name = oldAlgNamesToNew.get(override);
            if (name == null) {
                logger.error("Algorithm name " + override + " Not Found!");
                continue;
            }
            Object bean = ctxt.getBean(oldAlgNamesToNew.get(override));
            if (bean != null) {
                ItemRecommendationAlgorithm newAlg= (ItemRecommendationAlgorithm) bean;
                alternate.add(new AlgorithmStrategy(newAlg, first.includers, first.filters, first.config, name));
            } else {
                logger.error("Couldn't translate old algorithm name " + override + " into algorithm.");
            }
        }
        return alternate;
    }

    @Override
    public AlgorithmResultsCombiner getAlgorithmResultsCombiner(String userId, String recTag) {
        return baseStrategy.getAlgorithmResultsCombiner(userId, recTag);
    }

    @Override
    public String getName(String userId, String recTag) {
        return baseStrategy.getName(userId, recTag);
    }

	@Override
	public Map<Integer, Double> getActionsWeights(String userId, String recTag) {
		return baseStrategy.getActionsWeights(userId, recTag);
	}
}


text:
        <input type="hidden" th:field="*{fields['__${field.name}__'].value}" />

        <input type="hidden" th:field="*{fields['__${field.name}__'].value}" />


text:
<?php
/* *
 * 功能:支付宝手机网站退款接口(alipay.trade.refund)接口业务参数封装
 * 版本:2.0
 * 修改日期:2016-11-01
 * 说明:
 * 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
 */

class AlipayTradeRefundContentBuilder
{

    // 商户订单号.
    private $outTradeNo;

    // 支付宝交易号
    private $tradeNo;

    // 退款的金额
    private $refundAmount;

    // 退款原因说明
    private $refundReason;

    // 标识一次退款请求号,同一笔交易多次退款保证唯一,部分退款此参数必填
    private $outRequestNo;

    private $bizContentarr = array();

    private $bizContent = NULL;

    public function getBizContent()
    {
        if(!empty($this->bizContentarr)){
            $this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
        }
        return $this->bizContent;
    }

    public function getTradeNo()
    {
        return $this->tradeNo;
    }

    public function setTradeNo($tradeNo)
    {
        $this->tradeNo = $tradeNo;
        $this->bizContentarr['trade_no'] = $tradeNo;
    }

    public function getOutTradeNo()
    {
        return $this->outTradeNo;
    }

    public function setOutTradeNo($outTradeNo)
    {
        $this->outTradeNo = $outTradeNo;
        $this->bizContentarr['out_trade_no'] = $outTradeNo;
    }

    public function getRefundAmount()
    {
        return $this->refundAmount;
    }

    public function setRefundAmount($refundAmount)
    {
        $this->refundAmount = $refundAmount;
        $this->bizContentarr['refund_amount'] = $refundAmount;
    }

    public function getRefundReason()
    {
        return $this->refundReason;
    }

    public function setRefundReason($refundReason)
    {
        $this->refundReason = $refundReason;
        $this->bizContentarr['refund_reason'] = $refundReason;
    }

    public function getOutRequestNo()
    {
        return $this->outRequestNo;
    }

    public function setOutRequestNo($outRequestNo)
    {
        $this->outRequestNo = $outRequestNo;
        $this->bizContentarr['out_request_no'] = $outRequestNo;
    }
}

?>


text:
code: true
type: page
title: get
description: Get a document from kuzzle
---

# Get

Gets a document.

## Arguments

```go
Get(
  index string,
  collection string,
  _id string,
  options types.QueryOptions) (json.RawMessage, error)
```

| Argument     | Type                          | Description                       |
| ------------ | ----------------------------- | --------------------------------- |
| `index`      |
string
             | Index name                        |
| `collection` |
string
             | Collection name                   |
| `id`         |
string
             | Document ID                       |
| `options`    |
types.QueryOptions
 | A struct containing query options |

### options

Additional query options

| Option     | Type
(default)            | Description                                                                  |
| ---------- | ----------------------------- | ---------------------------------------------------------------------------- |
| `Queuable` |
bool

(`true`) | If true, queues the request during downtime, until connected to Kuzzle again |

## Return

Returns a json.RawMessage containing the document.

| Name      | Type   | Description                                            |
| --------- | ------ | ------------------------------------------------------ |
| \_id      | string | Newly created document ID                              |
| \_version | int    | Version of the document in the persistent data storage |
| \_source  | object | The created document                                   |

## Usage

<<< ./snippets/get.go


text:
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2019, OpenNebula Project, OpenNebula Systems                */
/*                                                                            */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may    */
/* not use this file except in compliance with the License. You may obtain    */
/* a copy of the License at                                                   */
/*                                                                            */
/* http://www.apache.org/licenses/LICENSE-2.0                                 */
/*                                                                            */
/* Unless required by applicable law or agreed to in writing, software        */
/* distributed under the License is distributed on an "AS IS" BASIS,          */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   */
/* See the License for the specific language governing permissions and        */
/* limitations under the License.                                             */
/* -------------------------------------------------------------------------- */

define(function(require) {
  require('../bower_components/jquery/dist/jquery.min');
  var OpenNebulaAuth = require('opennebula/auth');
  var showErrorAuth = false;
  var textOpenNebulaNotRunning = "OpenNebula is not running or there was a server exception. Please check the server logs.";
  var textInvalidUserorPassword = "Invalid username or password";
  var textNoAnswerFromServer = "No answer from server. Is it running?";
  var textTwoFactorTokenInvalid = "Two factor Token Invalid";
  var idElementTwoFactor = "#two_factor_auth_token";

  function auth_success(req, response) {
    if (response && response.code && response.code === "two_factor_auth") {
      $("#login_form").hide();
      $("#login_spinner").hide();
      $("#two_factor_auth").fadeIn("slow");
      if(!showErrorAuth){
        showErrorAuth = true;
      } else {
        $("#error_message").text(textTwoFactorTokenInvalid);
        $("#error_box").fadeIn("slow");
        $("#login_spinner").hide();
      }
    } else {
      showErrorAuth = false;
      window.location.href = ".";
    }
  }

  function auth_error(req, error) {

    var status = error.error.http_status;

    switch (status){
    case 401:
      $("#error_message").text(textInvalidUserorPassword);
      break;
    case 500:
      $("#error_message").text(textOpenNebulaNotRunning);
      break;
    case 0:
      $("#error_message").text(textNoAnswerFromServer);
      break;
    default:
      $("#error_message").text("Unexpected error. Status " + status + ". Check the server logs.");
    };
    $("#error_box").fadeIn("slow");
    $("#login_spinner").hide();
  }

  function authenticate() {
    var username = $("#username").val();
    var password = $("#password").val();
    var remember = $("#check_remember").is(":checked");
    var two_factor_auth_token = $("#two_factor_auth_token").val();

    $("#error_box").fadeOut("slow");
    $("#login_spinner").show();

    OpenNebulaAuth.login({
      data: {
        username: username,
        password: password
      },
      remember: remember,
      success: auth_success,
      two_factor_auth_token: two_factor_auth_token,
      error: auth_error
    });
  }

  function getInternetExplorerVersion() {
    // Returns the version of Internet Explorer or a -1
    // (indicating the use of another browser).
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
      var ua = navigator.userAgent;
      var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
      if (re.exec(ua) != null)
          rv = parseFloat(RegExp.$1);
    }
    return rv;
  }

  function checkVersion() {
    var ver = getInternetExplorerVersion();

    if (ver > -1) {
      msg = ver <= 7.0 ? "You are using an old version of IE. \
  Please upgrade or use Firefox or Chrome for full compatibility." :
      "OpenNebula Sunstone is best seen with Chrome or Firefox";
      $("#error_box").text(msg);
      $("#error_box").fadeIn('slow');
    }
  }

  function limitToken(){
    $(idElementTwoFactor).off('input').on('input', function() {
      var element = $(this);
      if(element.attr("maxlength") && element.attr("maxlength") > 0){
        var value = element.val().replace(/[^0-9.]/g, '')
        if (value.length > element.attr("maxlength")){
          element.val(value.substr(0,15))
        }else{
          element.val(value)
        }
      }
    });
  }

  $(document).ready(function() {
    $("#login_form").submit(function () {
      limitToken();
      authenticate();
      return false;
    });

    $("#two_factor_auth_login").click(function() {
      if($(idElementTwoFactor) && $(idElementTwoFactor).val().length){
        authenticate();
      }
      return false;
    });

    //compact login elements according to screen height
    if (screen.height <= 600) {
      $('div#logo_sunstone').css("top", "15px");
      $('div#login').css("top", "10px");
      $('.error_message').css("top", "10px");
    };

    $("input#username.box").focus();
    $("#login_spinner").hide();

    checkVersion();
  });
});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BACnet.SchemaParser
{
    public class BitDefinition
    {
        /// <summary>
        /// The name of the bit
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// The index of the bit
        /// </summary>
        public int Index { get; private set; }

        /// <summary>
        /// Constructs a new bit definition instance
        /// </summary>
        /// <param name="name">The name of the bit</param>
        /// <param name="index">The index of the bit</param>
        public BitDefinition(string name, int index)
        {
            this.Name = name;
            this.Index = index;
        }
    }
}


text:
package genericcli

import (
	"bytes"
	"context"
	"errors"
	"testing"

	"github.com/google/kf/v2/pkg/kf/commands/config"
	configlogging "github.com/google/kf/v2/pkg/kf/commands/config/logging"
	fakeinjection "github.com/google/kf/v2/pkg/kf/injection/fake"
	"github.com/google/kf/v2/pkg/kf/testutil"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
	fakedynamicclient "knative.dev/pkg/injection/clients/dynamicclient/fake"
)

type genericType struct {
	KubernetesType
}

func (g *genericType) NewUnstructured(ns, name string) *unstructured.Unstructured {
	return &unstructured.Unstructured{
		Object: map[string]interface{}{
			"apiVersion": g.Group + "/" + g.Version,
			"kind":       g.Kind,
			"metadata": map[string]interface{}{
				"namespace": ns,
				"name":      name,
			},
		},
	}
}

func (g *genericType) NewTable(name string) *metav1beta1.Table {
	return &metav1beta1.Table{
		ColumnDefinitions: []metav1beta1.TableColumnDefinition{
			{Name: "Name"},
		},
		Rows: []metav1beta1.TableRow{
			{Cells: []interface{}{name}},
		},
	}
}

func TestNewDescribeCommand_docs(t *testing.T) {
	typ := &genericType{
		KubernetesType: KubernetesType{
			NsScoped: true,
			Group:    "kf.dev",
			Version:  "v1alpha1",
			Kind:     "App",
			Resource: "apps",
			KfName:   "KfApp",
		},
	}

	cases := map[string]struct {
		genericType *genericType
		opts        []DescribeOption

		wantUse     string
		wantShort   string
		wantLong    string
		wantAliases []string
	}{
		"general": {
			genericType: typ,

			wantUse:   "kfapp NAME",
			wantShort: "Print information about the given KfApp.",
			wantLong:  "Print information about the given KfApp.",
		},

		"overrides": {
			genericType: typ,
			opts: []DescribeOption{
				WithDescribeCommandName("some-name"),
				WithDescribeAliases([]string{"abc"}),
			},
			wantUse:     "some-name NAME",
			wantShort:   "Print information about the given KfApp.",
			wantLong:    "Print information about the given KfApp.",
			wantAliases: []string{"abc"},
		},
	}

	for tn, tc := range cases {
		t.Run(tn, func(t *testing.T) {
			cmd := NewDescribeCommand(tc.genericType, nil, tc.opts...)
			testutil.AssertEqual(t, "use", tc.wantUse, cmd.Use)
			testutil.AssertEqual(t, "short", tc.wantShort, cmd.Short)
			testutil.AssertEqual(t, "long", tc.wantLong, cmd.Long)
			testutil.AssertEqual(t, "aliases", tc.wantAliases, cmd.Aliases)
		})
	}
}

func TestNewDescribeCommand(t *testing.T) {
	nsType := &genericType{
		KubernetesType: KubernetesType{
			NsScoped: true,
			Group:    "kf.dev",
			Version:  "v1alpha1",
			Kind:     "App",
			Resource: "apps",
			KfName:   "App",
		},
	}

	clusterType := &genericType{
		KubernetesType: KubernetesType{
			NsScoped: false,
			Group:    "kf.dev",
			Version:  "v1alpha1",
			Kind:     "Space",
			Resource: "spaces",
			KfName:   "Space",
		},
	}

	type mocks struct {
		p *config.KfParams
	}

	cases := map[string]struct {
		t       Type
		args    []string
		setup   func(context.Context, *testing.T, *mocks)
		wantOut string
		wantErr error
	}{
		"no params": {
			t:       nsType,
			args:    []string{},
			wantErr: errors.New("accepts 1 arg(s), received 0"),
		},
		"namespace no target": {
			t:    nsType,
			args: []string{"name"},
			setup: func(ctx context.Context, t *testing.T, mocks *mocks) {
				mocks.p.Space = ""
			},
			wantErr: errors.New(config.EmptySpaceError),
		},
		"cluster good": {
			t:    clusterType,
			args: []string{"some-object-name"},
			setup: func(ctx context.Context, t *testing.T, mocks *mocks) {
				obj := clusterType.NewUnstructured("", "some-object-name")
				fakedynamicclient.Get(ctx).
					Resource(clusterType.GroupVersionResource(context.Background())).
					Create(ctx, obj, metav1.CreateOptions{})
			},
			wantOut: `Getting Space some-object-name
API Version:  kf.dev/v1alpha1
Kind:         Space
Metadata:
  Name:  some-object-name
`,
		},
		"missing object": {
			t:       clusterType,
			args:    []string{"some-object-name"},
			wantErr: errors.New(`spaces.kf.dev "some-object-name" not found`),
		},

		"namespace good": {
			t:    nsType,
			args: []string{"some-object-name"},
			setup: func(ctx context.Context, t *testing.T, mocks *mocks) {
				mocks.p.Space = "my-ns"
				obj := nsType.NewUnstructured("my-ns", "some-object-name")
				fakedynamicclient.Get(ctx).
					Resource(nsType.GroupVersionResource(context.Background())).
					Namespace("my-ns").
					Create(ctx, obj, metav1.CreateOptions{})
			},
			wantOut: `Getting App some-object-name in Space: my-ns
API Version:  kf.dev/v1alpha1
Kind:         App
Metadata:
  Name:       some-object-name
  Namespace:  my-ns
`,
		},
		"custom output": {
			t:    clusterType,
			args: []string{"some-object-name", "-o", "name"},
			setup: func(ctx context.Context, t *testing.T, mocks *mocks) {
				obj := clusterType.NewUnstructured("", "some-object-name")
				fakedynamicclient.Get(ctx).
					Resource(clusterType.GroupVersionResource(context.Background())).
					Create(ctx, obj, metav1.CreateOptions{})
			},
			wantOut: `Getting Space some-object-name
space.kf.dev/some-object-name
`,
		},
	}

	for tn, tc := range cases {
		t.Run(tn, func(t *testing.T) {

			buf := new(bytes.Buffer)
			ctx := fakeinjection.WithInjection(context.Background(), t)
			ctx = configlogging.SetupLogger(ctx, buf)

			mocks := &mocks{
				p: &config.KfParams{
					Space: "default",
				},
			}

			if tc.setup != nil {
				tc.setup(ctx, t, mocks)
			}

			cmd := NewDescribeCommand(tc.t, mocks.p)
			cmd.SetOutput(buf)
			cmd.SetArgs(tc.args)
			cmd.SetContext(ctx)

			_, actualErr := cmd.ExecuteC()
			if tc.wantErr != nil || actualErr != nil {
				testutil.AssertErrorsEqual(t, tc.wantErr, actualErr)
				return
			}

			testutil.AssertEqual(t, "output", buf.String(), tc.wantOut)
		})
	}
}


text:
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity">

  <!-- EXECUTION INSERT -->

  <insert id="insertExecution" parameterType="org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity">
    insert into ${prefix}ACT_RU_EXECUTION
    (
      ID_,
      PROC_INST_ID_,
      BUSINESS_KEY_,
      PROC_DEF_ID_,
      ACT_ID_,
      ACT_INST_ID_,
      IS_ACTIVE_,
      IS_CONCURRENT_,
      IS_SCOPE_,
      IS_EVENT_SCOPE_,
      PARENT_ID_,
      SUPER_EXEC_,
      SUPER_CASE_EXEC_,
      CASE_INST_ID_,
      SUSPENSION_STATE_,
      CACHED_ENT_STATE_,
      SEQUENCE_COUNTER_,
      TENANT_ID_,
      REV_
    )
    values
    (
      #{id ,jdbcType=VARCHAR},
      #{processInstanceId, jdbcType=VARCHAR},
      #{businessKey, jdbcType=VARCHAR},
      #{processDefinitionId ,jdbcType=VARCHAR},
      #{activityId ,jdbcType=VARCHAR},
      #{activityInstanceId ,jdbcType=VARCHAR},
      #{isActive ,jdbcType=BOOLEAN},
      #{isConcurrent ,jdbcType=BOOLEAN},
      #{isScope ,jdbcType=BOOLEAN},
      #{isEventScope ,jdbcType=BOOLEAN},
      #{parentId, jdbcType=VARCHAR},
      #{superExecutionId, jdbcType=VARCHAR},
      #{superCaseExecutionId, jdbcType=VARCHAR},
      #{caseInstanceId, jdbcType=VARCHAR},
      #{suspensionState, jdbcType=INTEGER},
      #{cachedEntityState, jdbcType=INTEGER},
      #{sequenceCounter, jdbcType=BIGINT},
      #{tenantId, jdbcType=VARCHAR},
      1
    )
  </insert>

  <!-- EXECUTION UPDATE -->

  <update id="updateExecution" parameterType="org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity">
    update ${prefix}ACT_RU_EXECUTION set
      REV_ = #{revisionNext, jdbcType=INTEGER},
      PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR},
      ACT_ID_ = #{activityId, jdbcType=VARCHAR},
      ACT_INST_ID_ = #{activityInstanceId, jdbcType=VARCHAR},
      IS_ACTIVE_ = #{isActive, jdbcType=BOOLEAN},
      IS_CONCURRENT_ = #{isConcurrent, jdbcType=BOOLEAN},
      IS_SCOPE_ = #{isScope, jdbcType=BOOLEAN},
      IS_EVENT_SCOPE_ = #{isEventScope, jdbcType=BOOLEAN},
      PARENT_ID_ = #{parentId, jdbcType=VARCHAR},
      SUPER_EXEC_ = #{superExecutionId, jdbcType=VARCHAR},
      SUSPENSION_STATE_ = #{suspensionState, jdbcType=INTEGER},
      CACHED_ENT_STATE_ = #{cachedEntityState, jdbcType=INTEGER},
      SEQUENCE_COUNTER_ = #{sequenceCounter, jdbcType=BIGINT},
      TENANT_ID_ = #{tenantId, jdbcType=BIGINT}
    where ID_ = #{id, jdbcType=VARCHAR}
      and REV_ = #{revision, jdbcType=INTEGER}
  </update>

  <update id="updateExecutionSuspensionStateByParameters" parameterType="java.util.Map">
    update ${prefix}ACT_RU_EXECUTION set
      REV_ = REV_ + 1,
      SUSPENSION_STATE_ = #{suspensionState, jdbcType=INTEGER}
    <where>
      <if test="processInstanceId != null">
        PROC_INST_ID_ = #{processInstanceId, jdbcType=VARCHAR}
      </if>
      <if test="processDefinitionId != null">
        and PROC_DEF_ID_ = #{processDefinitionId, jdbcType=VARCHAR}
      </if>
      <if test="processDefinitionKey != null">
        and PROC_DEF_ID_ IN (SELECT ID_ FROM ${prefix}ACT_RE_PROCDEF WHERE KEY_ = #{processDefinitionKey, jdbcType=VARCHAR})
      </if>
    </where>
  </update>

  <!-- EXECUTION DELETE -->

  <delete id="deleteExecution" parameterType="org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity">
    delete from ${prefix}ACT_RU_EXECUTION where ID_ = #{id} and REV_ = #{revision}
  </delete>

  <!-- EXECUTION RESULTMAP -->

  <resultMap id="executionResultMap" type="org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity">
    <id property="id" column="ID_" jdbcType="VARCHAR" />
    <result property="revision" column="REV_" jdbcType="INTEGER" />
    <result property="processInstanceId" column="PROC_INST_ID_" jdbcType="VARCHAR" />
    <result property="businessKey" column="BUSINESS_KEY_" jdbcType="VARCHAR" />
    <result property="processDefinitionId" column="PROC_DEF_ID_" jdbcType="VARCHAR" />
    <result property="activityId" column="ACT_ID_" jdbcType="VARCHAR" />
    <result property="activityInstanceId" column="ACT_INST_ID_" jdbcType="VARCHAR" />
    <result property="isActive" column="IS_ACTIVE_" jdbcType="BOOLEAN" />
    <result property="isConcurrent" column="IS_CONCURRENT_" jdbcType="BOOLEAN" />
    <result property="isScope" column="IS_SCOPE_" jdbcType="BOOLEAN" />
    <result property="isEventScope" column="IS_EVENT_SCOPE_" jdbcType="BOOLEAN" />
    <result property="parentId" column="PARENT_ID_" jdbcType="VARCHAR" />
    <result property="superExecutionId" column="SUPER_EXEC_" jdbcType="VARCHAR" />
    <result property="superCaseExecutionId" column="SUPER_CASE_EXEC_" jdbcType="VARCHAR" />
    <result property="caseInstanceId" column="CASE_INST_ID_" jdbcType="VARCHAR" />
    <result property="suspensionState" column="SUSPENSION_STATE_" jdbcType="INTEGER"/>
    <result property="cachedEntityState" column="CACHED_ENT_STATE_" jdbcType="INTEGER"/>
    <result property="sequenceCounter" column="SEQUENCE_COUNTER_" jdbcType="BIGINT"/>
    <result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR"/>
  </resultMap>

  <!-- EXECUTION SELECT -->

  <select id="selectExecution" parameterType="string" resultMap="executionResultMap">
    select * from ${prefix}ACT_RU_EXECUTION where ID_ = #{id}
  </select>

  <select id="selectExecutionsByParentExecutionId" parameterType="org.camunda.bpm.engine.impl.db.ListQueryParameterObject" resultMap="executionResultMap">
    select * from ${prefix}ACT_RU_EXECUTION
    where PARENT_ID_ = #{parameter}
  </select>

  <select id="selectExecutionsByProcessInstanceId" parameterType="org.camunda.bpm.engine.impl.db.ListQueryParameterObject" resultMap="executionResultMap">
    select * from ${prefix}ACT_RU_EXECUTION
    where PROC_INST_ID_ = #{parameter}
  </select>

  <select id="selectProcessInstanceIdsByProcessDefinitionId" parameterType="org.camunda.bpm.engine.impl.db.ListQueryParameterObject" resultType="string">
    select ID_
    from ${prefix}ACT_RU_EXECUTION
    where PROC_DEF_ID_ = #{parameter} and PARENT_ID_ is null
  </select>

  <select id="selectExecutionsByQueryCriteria" parameterType="org.camunda.bpm.engine.impl.ExecutionQueryImpl" resultMap="executionResultMap">
  	<include refid="org.camunda.bpm.engine.impl.persistence.entity.Commons.bindOrderBy"/>
    ${limitBefore}
    select RES.*
    ${limitBetween}
    <include refid="org.camunda.bpm.engine.impl.persistence.entity.Commons.orderBySelection"/>
    <include refid="selectExecutionsByQueryCriteriaSql"/>
    ${orderBy}
    ${limitAfter}
  </select>

  <select id="selectExecutionCountByQueryCriteria" parameterType="org.camunda.bpm.engine.impl.ExecutionQueryImpl" resultType="long">
    select count(*)
    <include refid="selectExecutionsByQueryCriteriaSql"/>
  </select>

  <!--  same as selectExecutionByQueryCriteria, but with different parameterType -->
  <select id="selectProcessInstanceByQueryCriteria" parameterType="org.camunda.bpm.engine.impl.ProcessInstanceQueryImpl" resultMap="executionResultMap">
  	<include refid="org.camunda.bpm.engine.impl.persistence.entity.Commons.bindOrderBy"/>
    ${limitBefore}
    select RES.*
    ${limitBetween}
    <include refid="org.camunda.bpm.engine.impl.persistence.entity.Commons.orderBySelection"/>
    <include refid="selectExecutionsByQueryCriteriaSql"/>
    ${orderBy}
    ${limitAfter}
  </select>

  <select id="selectProcessInstanceCountByQueryCriteria" parameterType="org.camunda.bpm.engine.impl.ProcessInstanceQueryImpl" resultType="long">
    select count(*)
    <include refid="selectExecutionsByQueryCriteriaSql"/>
  </select>

  <sql id="selectExecutionsByQueryCriteriaSql">
    from ${prefix}ACT_RU_EXECUTION RES
    <if test="businessKey != null">
        inner join ${prefix}ACT_RU_EXECUTION INST on RES.PROC_INST_ID_ = INST.ID_
    </if>
    <if test="incidentType != null || incidentId != null || incidentMessage != null || incidentMessageLike != null">
      <choose>
        <when test="onlyProcessInstances">
          inner join ${prefix}ACT_RU_INCIDENT INC on RES.ID_ = INC.PROC_INST_ID_
        </when>
        <otherwise>
          inner join ${prefix}ACT_RU_INCIDENT INC on RES.ID_ = INC.EXECUTION_ID_
        </otherwise>
      </choose>
    </if>
    inner join ${prefix}ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_
    <where>
      <if test="onlyProcessInstances">
        RES.PARENT_ID_ is null
      </if>
      <if test="processDefinitionId != null">
        and P.ID_ = #{processDefinitionId}
      </if>
      <if test="processDefinitionKey != null">
        and P.KEY_ = #{processDefinitionKey}
      </if>
      <if test="deploymentId != null">
        and P.DEPLOYMENT_ID_ = #{deploymentId}
      </if>
      <if test="executionId != null">
        and RES.ID_ = #{executionId}
      </if>
      <if test="processInstanceId != null">
        and RES.PROC_INST_ID_ = #{processInstanceId}
      </if>
      <if test="processInstanceIds != null and !processInstanceIds.isEmpty()">
        and RES.PROC_INST_ID_ in
        <foreach item="item" index="index" collection="processInstanceIds" open="(" separator="," close=")">
          #{item}
        </foreach>
      </if>
      <if test="businessKey != null">
        and INST.BUSINESS_KEY_ = #{businessKey}
      </if>
      <if test="activityId != null">
        and RES.ACT_ID_ = #{activityId}
      </if>
      <if test="superProcessInstanceId != null">
        <!-- A sub process instance is stored under a certain *execution*, potentially nested.
             A sub process instance is NOT stored under the process instance, hence the following: -->
        and RES.SUPER_EXEC_ IN (select ID_ from ${prefix}ACT_RU_EXECUTION where PROC_INST_ID_ = #{superProcessInstanceId})
      </if>
      <if test="subProcessInstanceId != null">
        and RES.ID_ = (select PROC_INST_ID_ from ${prefix}ACT_RU_EXECUTION where ID_ = (select SUPER_EXEC_ from ${prefix}ACT_RU_EXECUTION where ID_ = #{subProcessInstanceId}))
      </if>
      <if test="suspensionState != null">
        and RES.SUSPENSION_STATE_ = #{suspensionState.stateCode}
      </if>
      <if test="caseInstanceId != null">
        and RES.CASE_INST_ID_ = #{caseInstanceId}
      </if>
      <if test="superCaseInstanceId != null">
        and RES.SUPER_CASE_EXEC_ IN (select ID_ from ${prefix}ACT_RU_CASE_EXECUTION where CASE_INST_ID_ = #{superCaseInstanceId})
      </if>
      <if test="subCaseInstanceId != null">
        and RES.ID_ = (select PROC_INST_ID_ from ${prefix}ACT_RU_EXECUTION where ID_ = (select SUPER_EXEC_ from ${prefix}ACT_RU_CASE_EXECUTION where ID_ = #{subCaseInstanceId}))
      </if>
      <!-- PLEASE NOTE: If you change anything have a look into the HistoricVariableInstance & HistoricProcessInstance, the same query object is used there! -->
      <foreach collection="queryVariableValues" index="index" item="queryVariableValue">
        and EXISTS (
          select
            ID_
          from
            ${prefix}ACT_RU_VARIABLE
          WHERE
            NAME_= #{queryVariableValue.name}

        <choose>
          <when test="queryVariableValue.local">
            and RES.ID_ = EXECUTION_ID_
          </when>
          <otherwise>
            <!-- When process instance or case instance variable is queried for, taskId should be null -->
            and TASK_ID_ is null and RES.PROC_INST_ID_ = PROC_INST_ID_
          </otherwise>
        </choose>

        <bind name="varTypeField" value="'TYPE_'"/>
        <bind name="varPrefix" value="''"/>
        <if test="queryVariableValue.valueConditions != null">
          and
          <include refid="org.camunda.bpm.engine.impl.persistence.entity.Commons.variableValueConditions"/>
        </if>
      )
      </foreach>
      <!-- event subscriptions -->
      <if test="eventSubscriptions != null">
        <foreach collection="eventSubscriptions" index="index" item="eventSubscriptionValue">
          and exists (select ID_ from ${prefix}ACT_RU_EVENT_SUBSCR EVT where
          EVT.EXECUTION_ID_ = RES.ID_ and
          EVT.EVENT_TYPE_ = #{eventSubscriptionValue.eventType}
          <if test = "eventSubscriptionValue.eventName != null">
            and EVT.EVENT_NAME_ = #{eventSubscriptionValue.eventName}
          </if>
          )
        </foreach>
      </if>
      <if test="incidentType != null">
        and INC.INCIDENT_TYPE_ = #{incidentType}
      </if>
      <if test="incidentId != null">
        and INC.ID_ = #{incidentId}
      </if>
      <if test="incidentMessage != null">
        and INC.INCIDENT_MSG_ = #{incidentMessage}
      </if>
      <if test="incidentMessageLike != null">
        and INC.INCIDENT_MSG_ like #{incidentMessageLike}
      </if>
      <if test="isTenantIdSet">
        <if test="tenantIds != null && tenantIds.length > 0">
          and RES.TENANT_ID_ in
          <foreach item="tenantId" index="index" collection="tenantIds"
                   open="(" separator="," close=")">
            #{tenantId}
          </foreach>
        </if>
        <if test="tenantIds == null">
          and RES.TENANT_ID_ is null
        </if>
      </if>

      <include refid="org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.queryAuthorizationCheck" />

    </where>
  </sql>

  <select id="selectSubProcessInstanceBySuperExecutionId" parameterType="string" resultMap="executionResultMap">
    select *
    from ${prefix}ACT_RU_EXECUTION
    where SUPER_EXEC_ = #{parameter}
  </select>

  <select id="selectSubProcessInstanceBySuperCaseExecutionId" parameterType="string" resultMap="executionResultMap">
    select *
    from ${prefix}ACT_RU_EXECUTION
    where SUPER_CASE_EXEC_ = #{parameter}
  </select>

  <select id="selectExecutionByNativeQuery" parameterType="java.util.Map" resultMap="executionResultMap">
    <if test="resultType == 'LIST_PAGE'">
      ${limitBefore}
    </if>
    ${sql}
    <if test="resultType == 'LIST_PAGE'">
      ${limitAfter}
    </if>
  </select>

  <select id="selectExecutionByNativeQuery_mssql_or_db2" parameterType="java.util.Map" resultMap="executionResultMap">
    <if test="resultType == 'LIST_PAGE'">
        ${limitBeforeNativeQuery}
    </if>
    ${sql}
    <if test="resultType == 'LIST_PAGE'">
      ${limitAfter}
    </if>
  </select>

  <select id="selectExecutionCountByNativeQuery" parameterType="java.util.Map" resultType="long">
    ${sql}
  </select>

</mapper>


text:
class BSTIterator {
public:
    BSTIterator(TreeNode *root) {
        _push(root);
    }

    /** @return whether we have a next smallest number */
    bool hasNext() {
        return !_stack.empty();
    }

    /** @return the next smallest number */
    int next() {
        auto node = _stack.top();
        _stack.pop();
        _push(node->right);
        return node->val;
    }

    void _push(TreeNode* node){
        while(node != nullptr){
            _stack.push(node);
            node = node->left;
        }
    }
private:
    stack<TreeNode*> _stack;
};


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>bson_compare()</title>
<link rel="stylesheet" type="text/css" href="C.css">

Libbson › API Reference » bson_t »

bson_compare()

Synopsis

int
bson_compare (const bson_t *bson,
              const bson_t *other);

Parameters

bson

A bson_t.

other

A bson_t.

Description

The bson_compare() function shall compare two bson documents for equality.

This can be useful in conjunction with _qsort()_.

If equal, 0 is returned.

This function uses _memcmp()_ internally, so the semantics are the same.

Returns

less than zero, zero, or greater than zero in qsort() style.

More Information

bson_t


text:
<?php

class Google_Service_Dataproc_ClusterMetrics extends Google_Model
{
  public $hdfsMetrics;
  public $yarnMetrics;

  public function setHdfsMetrics($hdfsMetrics)
  {
    $this->hdfsMetrics = $hdfsMetrics;
  }
  public function getHdfsMetrics()
  {
    return $this->hdfsMetrics;
  }
  public function setYarnMetrics($yarnMetrics)
  {
    $this->yarnMetrics = $yarnMetrics;
  }
  public function getYarnMetrics()
  {
    return $this->yarnMetrics;
  }
}


text:
    import Ember from 'ember';

export default Ember.Route.extend({
	saveReview(params) {
      var newReview = this.store.createRecord('review', params);
      var rental = params.rental;
      rental.get('reviews').addObject(newReview);
      newReview.save().then(function() {
        return rental.save();
      });
      this.transitionTo('rental', rental);
    },
destroyRental(rental) {
      var review_deletions = rental.get('reviews').map(function(review) {
        return review.destroyRecord();
      });
      Ember.RSVP.all(review_deletions).then(function() {
        return rental.destroyRecord();
      });
      this.transitionTo('index');
    },
});


text:
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
using System.Web;

namespace TodoListWebApp
{
    public class TokenFactory
    {
        //
        // The Client ID is used by the application to uniquely identify itself to Azure AD.
        // The Cert Name is the subject name of the certificate used to authenticate this application to Azure AD.
        // The Tenant is the name of the Azure AD tenant in which this application is registered.
        // The AAD Instance is the instance of Azure, for example public Azure or Azure China.
        // The Authority is the sign-in URL of the tenant.
        //
        private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
        private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
        private static string clientId = ConfigurationManager.AppSettings["ida:ClientIdSqlAadApp"];
        private static string certName = ConfigurationManager.AppSettings["ida:CertName"];

        static string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);

        //
        // To authenticate to the To Do list service, the client needs to know the service's App ID URI.
        // To contact the To Do list service we need it's URL as well.
        //
        private static string sqlDBResourceId = ConfigurationManager.AppSettings["sqldb:ResourceId"];
        //private static string todoListBaseAddress = ConfigurationManager.AppSettings["todo:TodoListBaseAddress"];

        private static HttpClient httpClient = new HttpClient();
        private static AuthenticationContext authContext = null;
        private static ClientAssertionCertificate certCred = null;
        private static string token;

        public static string GetAccessToken()
        {
            //
            // Create the authentication context to be used to acquire tokens.
            //
            authContext = new AuthenticationContext(Startup.Authority);

            //
            // Initialize the Certificate Credential to be used by ADAL.
            // First find the matching certificate in the cert store.
            //

            X509Certificate2 cert = null;
            X509Store store = new X509Store(StoreLocation.CurrentUser);
            try
            {
                store.Open(OpenFlags.ReadOnly);
                // Place all certificates in an X509Certificate2Collection object.
                X509Certificate2Collection certCollection = store.Certificates;
                // Find unexpired certificates.
                X509Certificate2Collection currentCerts = certCollection.Find(X509FindType.FindByTimeValid, DateTime.Now, false);
                // From the collection of unexpired certificates, find the ones with the correct name.
                X509Certificate2Collection signingCert = currentCerts.Find(X509FindType.FindBySubjectDistinguishedName, certName, false);
                if (signingCert.Count == 0)
                {
                    throw new Exception("Cannot find certificate: " + certName);
                }
                // Return the first certificate in the collection, has the right name and is current.
                cert = signingCert[0];
            }
            finally
            {
                store.Close();
            }

            // Then create the certificate credential.
            certCred = new ClientAssertionCertificate(clientId, cert);
            AcquireToken().Wait();
            return token;
        }

        static async Task AcquireToken()
        {
            //
            // Get an access token from Azure AD using client credentials.
            // If the attempt to get a token fails because the server is unavailable, retry twice after 3 seconds each.
            //
            AuthenticationResult result = null;
            int retryCount = 0;
            bool retry = false;
            token = null;

            do
            {
                retry = false;
                try
                {
                    // ADAL includes an in memory cache, so this call will only send a message to the server if the cached token is expired.
                    result = await authContext.AcquireTokenAsync(sqlDBResourceId, certCred);
                }
                catch (AdalException ex)
                {
                    if (ex.ErrorCode == "temporarily_unavailable")
                    {
                        retry = true;
                        retryCount++;
                        Thread.Sleep(3000);
                    }

                    Debug.WriteLine(
                        String.Format("An error occurred while acquiring a token\nTime: {0}\nError: {1}\nRetry: {2}\n",
                        DateTime.Now.ToString(),
                        ex.ToString(),
                        retry.ToString()));
                }

            } while ((retry == true) && (retryCount < 3));

            if (result == null)
            {
                Debug.WriteLine("Canceling attempt to contact To Do list service.\n");
                return;
            }

            token = result.AccessToken;
            Debug.WriteLine("The access token obtained is:");
            Debug.WriteLine("--------------------------------------------------");
            Debug.WriteLine(result.AccessToken);
            Debug.WriteLine("--------------------------------------------------");
        }

        public static async Task<string> GetToken(string authority, string resource, string scope, string clientId, string clientSecret)
        {
            var authContext = new AuthenticationContext(authority);
            ClientCredential clientCred = new ClientCredential(clientId, clientSecret);
            AuthenticationResult result = await authContext.AcquireTokenAsync(resource, clientCred);

            if (result == null)
                throw new InvalidOperationException("Failed to obtain the JWT token");

            return result.AccessToken;
        }
    }
}


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>ansible.module_utils.facts.SunOSHardware</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Home

         Trees

         Indices

         Help

ansible

        Package ansible ::
        Package module_utils ::
        Module facts ::
        Class SunOSHardware

[hide private]

[frames] | no frames]

Class SunOSHardware

source code

object --+
         |
     Facts --+
             |
      Hardware --+
                 |
                SunOSHardware

In addition to the generic memory and cpu facts, this also sets
  swap_reserved_mb and swap_allocated_mb that is available from *swap
  -s*.

        Instance Methods
        [hide private]

          populate(self)

            source code

          get_cpu_facts(self)

            source code

          get_memory_facts(self)

            source code

          get_mount_facts(*args,
        **kwargs)

            source code

Inherited from Facts:
      __init__,
      get_caps_facts,
      get_cmdline,
      get_date_time_facts,
      get_dns_facts,
      get_env_facts,
      get_fips_facts,
      get_local_facts,
      get_lsb_facts,
      get_pkg_mgr_facts,
      get_platform_facts,
      get_public_ssh_host_keys,
      get_python_facts,
      get_selinux_facts,
      get_service_mgr_facts,
      get_user_facts,
      is_systemd_managed

Inherited from Facts (private):
      _get_mount_size_facts

Inherited from object:
      __delattr__,
      __format__,
      __getattribute__,
      __hash__,
      __reduce__,
      __reduce_ex__,
      __repr__,
      __setattr__,
      __sizeof__,
      __str__,
      __subclasshook__

        Static Methods
        [hide private]

Inherited from Hardware:
      __new__

        Class Variables
        [hide private]

        platform = 'SunOS'

Inherited from Facts:
      PKG_MGRS,
      SELINUX_MODE_DICT

Inherited from Facts (private):
      _I386RE

        Properties
        [hide private]

Inherited from object:
      __class__

        Method Details
        [hide private]

populate(self)

  	source code

Overrides:
        Facts.populate

get_mount_facts(*args,
        **kwargs)

  	source code

Decorators:

@timeout(10)

         Home

         Trees

         Indices

         Help

ansible

    Generated by Epydoc 3.0.1 on Fri Jul 29 13:11:38 2016

      http://epydoc.sourceforge.net


text:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
  <string-array name="ArticlesTabs">
    <item>@string/articlehome</item>
    <item>@string/articleHot</item>
  </string-array>
  <string-array name="NewsTabs">
    <item>@string/newshome</item>
    <item>@string/newsrecommend</item>
    <item>@string/newsworkhot</item>
  </string-array>
  <string-array name="StatusesTabs">
    <item>@string/statuses_all</item>
    <item>@string/statuses_following</item>
    <item>@string/statuses_my</item>
    <item>@string/statuses_mycomment</item>
    <item>@string/statuses_recentcomment</item>
    <item>@string/statuses_mention</item>
    <item>@string/statuses_comment</item>
  </string-array>
  <string-array name="QuestionsTabs">
    <item>@string/question_none</item>
    <item>@string/question_highscore</item>
    <item>@string/question_noanswer</item>
    <item>@string/question_solved</item>
    <item>@string/question_myquestion</item>
  </string-array>
  <string-array name="SearchTabs">
    <item>@string/articlehome</item>
    <item>@string/news</item>
    <item>@string/kbArticles</item>
    <item>@string/question</item>
  </string-array>
</resources>


text:
delete_sa_keys() {
  for SA_KEY_NAME in $(gcloud iam service-accounts keys list \
  --project="$APIGEE_PROJECT_ID" \
  --iam-account="$ENVOY_AX_SA"@"$APIGEE_PROJECT_ID".iam.gserviceaccount.com \
  --format="get(name)" --filter="keyType=USER_MANAGED")
  do
    gcloud iam service-accounts keys delete "$SA_KEY_NAME" \
    --project="$APIGEE_PROJECT_ID" \
    --iam-account="$ENVOY_AX_SA"@"$APIGEE_PROJECT_ID".iam.gserviceaccount.com -q
  done
}

if [ "$INSTALL_TYPE" == 'istio-apigee-envoy' ]
then
    gcloud --project="${PROJECT_ID}" container clusters get-credentials \
    "${CLUSTER_NAME}" --zone "${CLUSTER_LOCATION}"

    echo "Deleting the namespace - $NAMESPACE"
    kubectl --context="${CLUSTER_CTX}" delete namespace "$NAMESPACE"
fi

if [ "$PLATFORM" != 'opdk' ] && [ "$PLATFORM" != 'edge' ]
then
    echo "deleting the SA keys"
    delete_sa_keys;

    if [[ -z $PIPELINE_TEST ]]; then

        echo "Deleting the service account role binding"
        gcloud projects remove-iam-policy-binding "$APIGEE_PROJECT_ID" \
        --member="serviceAccount:$ENVOY_AX_SA@$APIGEE_PROJECT_ID.iam.gserviceaccount.com" \
        --role="roles/apigee.analyticsAgent"

        echo "Deleting the service account"
        gcloud iam service-accounts delete "$ENVOY_AX_SA"@"$APIGEE_PROJECT_ID".iam.gserviceaccount.com \
        --project="$APIGEE_PROJECT_ID" --quiet
    fi
    rm "$AX_SERVICE_ACCOUNT"
fi

if [ "$INSTALL_TYPE" == 'standalone-apigee-envoy' ]
then
    echo "Deleting docker containers"
    docker ps -a --format "{{ json . }}" | jq ' select( .Image | contains("envoyproxy")) | .Names ' | xargs docker rm -f
    docker ps -a --format "{{ json . }}" | jq ' select( .Image | contains("apigee-envoy-adapter")) | .Names ' | xargs docker rm -f
fi

echo "Deleting the developer app"
curl -H "Authorization: ${TOKEN_TYPE} ${TOKEN}" -X DELETE "${MGMT_HOST}/v1/organizations/${APIGEE_ORG}/developers/test-envoy@google.com/apps/envoy-adapter-dev-app"

echo "Deleting the developer"
curl -H "Authorization: ${TOKEN_TYPE} ${TOKEN}" -X DELETE "${MGMT_HOST}/v1/organizations/${APIGEE_ORG}/developers/test-envoy@google.com"

echo "Deleting the product"
curl -H "Authorization: ${TOKEN_TYPE} ${TOKEN}" -X DELETE "${MGMT_HOST}/v1/organizations/${APIGEE_ORG}/apiproducts/envoy-adapter-product-2"

echo "Deleting the directory"
rm -Rf "$CLI_HOME"
rm -Rf "$REMOTE_SERVICE_HOME"
rm "$ENVOY_HOME"/*.tar.*

echo "Done with the cleanup.."


text:
define(
['jquery','lodash','backbone'],

function($,_,Backbone) {
	var HiddenModel = Backbone.Model.extend({

		defaults:{
			"message": []
		},

		url: function(){
			return '/api/hidden/'+this.widsOption;
		},

		initialize: function(){
			var savedWidsOption = localStorage.getItem('wids');
			if( savedWidsOption == null) {
				this.widsOption = 0;
				localStorage.setItem('wids',0);
			} else {
				this.widsOption  = savedWidsOption;
			}
		},

		setWidsOption: function(signal){
			this.widsOption = signal;
			localStorage.setItem('wids',signal);
		},

		messageLength: function(){
			return this.toJSON().message.length;
		},

		messageToCollection: function(){
			var collection = new Backbone.Collection(this.toJSON().message);
			return collection;
		},

		stringToArray: function(){
			this.set("message",JSON.parse(this.get("message")));
		}

	});

	return HiddenModel;

});


text:
package org.hisp.dhis.metadata.users;

import org.hisp.dhis.ApiTest;
import org.hisp.dhis.actions.LoginActions;
import org.hisp.dhis.actions.UserActions;
import org.hisp.dhis.actions.metadata.OptionActions;
import org.hisp.dhis.dto.ApiResponse;
import org.hisp.dhis.helpers.ResponseValidationHelper;
import org.hisp.dhis.utils.DataGenerator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
 * @author Gintare Vilkelyte <vilkelyte.gintare@gmail.com>
 */
public class UsersRemovalTests
    extends ApiTest
{
    private UserActions userActions;

    private OptionActions optionActions;

    private LoginActions loginActions;

    private String userId;

    private String userName;

    private String password = "!XPTOqwerty1";

    @BeforeEach
    public void beforeEach()
    {
        userActions = new UserActions();
        optionActions = new OptionActions();
        loginActions = new LoginActions();

        userName = (DataGenerator.randomString()).toLowerCase();

        loginActions.loginAsSuperUser();

        userId = userActions.addUserFull( "johnny", "bravo", userName, password );
    }

    @Test
    public void shouldRemoveWhenUserWasLoggedIn()
    {
        loginActions.loginAsUser( userName, password );
        loginActions.loginAsSuperUser();

        ApiResponse response = userActions.delete( userId );

        ResponseValidationHelper.validateObjectRemoval( response, "User was not removed" );
    }

    @Test
    @Disabled
    // jira issue 5573
    public void shouldRemoveWhenUserWasGrantedAccessToMetadata()
    {
        // arrange
        String id = optionActions.createOptionSet();

        optionActions.grantUserAccessToOptionSet( id, userId );

        // act
        ApiResponse response = userActions.delete( userId );

        // assert
        ResponseValidationHelper.validateObjectRemoval( response, "User was not removed" );
    }
}


text:
package org.json.test.compliance.std;

import java.util.List;

public interface JSONObjectMeta {
	static interface Entry{
		String getName();
		Object getValue();
	};

	/**
	 * Get JSON value from name.
	 * @param name
	 * @return Must be one of the following:
	 *         java.lang.String,
	 *         java.lang.Number,
	 *         java.lang.Boolean,
	 *         null,
	 *         org.json.test.compliance.std.JSONObjectMeta
	 *         org.json.test.compliance.std.JSONArrayMeta
	 */
	Object get(String name);

	/**
	 * Return all entries of this map.
	 * @return All entries of this map. getValue() of each entry must be one of the following:
	 *         java.lang.String,
	 *         java.lang.Number,
	 *         java.lang.Boolean,
	 *         null,
	 *         org.json.test.compliance.std.JSONObjectMeta
	 *         org.json.test.compliance.std.JSONArrayMeta
	 */
	List<Entry> entries();
}


text:
layout: post
date: '2016-07-30'
title: "Watters Wtoo by Wedding Dress Marguerite 12360"
category: Watters
tags: [Watters]
---
### Watters Wtoo by Wedding Dress Marguerite 12360
Just **$331.99**
###

Buy it: [https://www.eudances.com/en/watters/996-wtoo-by-watters-wedding-dress-marguerite-12360.html](https://www.eudances.com/en/watters/996-wtoo-by-watters-wedding-dress-marguerite-12360.html)


text:
/* ****************************************************************************
 * Start data grouping module												 *
 ******************************************************************************/
/*jslint white:true */
var DATA_GROUPING = 'dataGrouping',
	seriesProto = Series.prototype,
	tooltipProto = Tooltip.prototype,
	baseProcessData = seriesProto.processData,
	baseGeneratePoints = seriesProto.generatePoints,
	baseDestroy = seriesProto.destroy,
	baseTooltipFooterHeaderFormatter = tooltipProto.tooltipFooterHeaderFormatter,
	NUMBER = 'number',

	commonOptions = {
		approximation: 'average', // average, open, high, low, close, sum
		//enabled: null, // (true for stock charts, false for basic),
		//forced: undefined,
		groupPixelWidth: 2,
		// the first one is the point or start value, the second is the start value if we're dealing with range,
		// the third one is the end value if dealing with a range
		dateTimeLabelFormats: {
			millisecond: ['%A, %b %e, %H:%M:%S.%L', '%A, %b %e, %H:%M:%S.%L', '-%H:%M:%S.%L'],
			second: ['%A, %b %e, %H:%M:%S', '%A, %b %e, %H:%M:%S', '-%H:%M:%S'],
			minute: ['%A, %b %e, %H:%M', '%A, %b %e, %H:%M', '-%H:%M'],
			hour: ['%A, %b %e, %H:%M', '%A, %b %e, %H:%M', '-%H:%M'],
			day: ['%A, %b %e, %Y', '%A, %b %e', '-%A, %b %e, %Y'],
			week: ['Week from %A, %b %e, %Y', '%A, %b %e', '-%A, %b %e, %Y'],
			month: ['%B %Y', '%B', '-%B %Y'],
			year: ['%Y', '%Y', '-%Y']
		}
		// smoothed = false, // enable this for navigator series only
	},

	specificOptions = { // extends common options
		line: {},
		spline: {},
		area: {},
		areaspline: {},
		column: {
			approximation: 'sum',
			groupPixelWidth: 10
		},
		arearange: {
			approximation: 'range'
		},
		areasplinerange: {
			approximation: 'range'
		},
		columnrange: {
			approximation: 'range',
			groupPixelWidth: 10
		},
		candlestick: {
			approximation: 'ohlc',
			groupPixelWidth: 10
		},
		ohlc: {
			approximation: 'ohlc',
			groupPixelWidth: 5
		}
	},

	// units are defined in a separate array to allow complete overriding in case of a user option
	defaultDataGroupingUnits = [[
			'millisecond', // unit name
			[1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
		], [
			'second',
			[1, 2, 5, 10, 15, 30]
		], [
			'minute',
			[1, 2, 5, 10, 15, 30]
		], [
			'hour',
			[1, 2, 3, 4, 6, 8, 12]
		], [
			'day',
			[1]
		], [
			'week',
			[1]
		], [
			'month',
			[1, 3, 6]
		], [
			'year',
			null
		]
	],

	/**
	 * Define the available approximation types. The data grouping approximations takes an array
	 * or numbers as the first parameter. In case of ohlc, four arrays are sent in as four parameters.
	 * Each array consists only of numbers. In case null values belong to the group, the property
	 * .hasNulls will be set to true on the array.
	 */
	approximations = {
		sum: function (arr) {
			var len = arr.length,
				ret;

			// 1. it consists of nulls exclusively
			if (!len && arr.hasNulls) {
				ret = null;
			// 2. it has a length and real values
			} else if (len) {
				ret = 0;
				while (len--) {
					ret += arr[len];
				}
			}
			// 3. it has zero length, so just return undefined
			// => doNothing()

			return ret;
		},
		average: function (arr) {
			var len = arr.length,
				ret = approximations.sum(arr);

			// If we have a number, return it divided by the length. If not, return
			// null or undefined based on what the sum method finds.
			if (typeof ret === NUMBER && len) {
				ret = ret / len;
			}

			return ret;
		},
		open: function (arr) {
			return arr.length ? arr[0] : (arr.hasNulls ? null : UNDEFINED);
		},
		high: function (arr) {
			return arr.length ? arrayMax(arr) : (arr.hasNulls ? null : UNDEFINED);
		},
		low: function (arr) {
			return arr.length ? arrayMin(arr) : (arr.hasNulls ? null : UNDEFINED);
		},
		close: function (arr) {
			return arr.length ? arr[arr.length - 1] : (arr.hasNulls ? null : UNDEFINED);
		},
		// ohlc and range are special cases where a multidimensional array is input and an array is output
		ohlc: function (open, high, low, close) {
			open = approximations.open(open);
			high = approximations.high(high);
			low = approximations.low(low);
			close = approximations.close(close);

			if (typeof open === NUMBER || typeof high === NUMBER || typeof low === NUMBER || typeof close === NUMBER) {
				return [open, high, low, close];
			}
			// else, return is undefined
		},
		range: function (low, high) {
			low = approximations.low(low);
			high = approximations.high(high);

			if (typeof low === NUMBER || typeof high === NUMBER) {
				return [low, high];
			}
			// else, return is undefined
		}
	};

/*jslint white:false */

/**
 * Takes parallel arrays of x and y data and groups the data into intervals defined by groupPositions, a collection
 * of starting x values for each group.
 */
seriesProto.groupData = function (xData, yData, groupPositions, approximation) {
	var series = this,
		data = series.data,
		dataOptions = series.options.data,
		groupedXData = [],
		groupedYData = [],
		dataLength = xData.length,
		pointX,
		pointY,
		groupedY,
		handleYData = !!yData, // when grouping the fake extended axis for panning, we don't need to consider y
		values = [[], [], [], []],
		approximationFn = typeof approximation === 'function' ? approximation : approximations[approximation],
		pointArrayMap = series.pointArrayMap,
		pointArrayMapLength = pointArrayMap && pointArrayMap.length,
		i;

	// Start with the first point within the X axis range (#2696)
	for (i = 0; i <= dataLength; i++) {
		if (xData[i] >= groupPositions[0]) {
			break;
		}
	}

	for (; i <= dataLength; i++) {

		// when a new group is entered, summarize and initiate the previous group
		while ((groupPositions[1] !== UNDEFINED && xData[i] >= groupPositions[1]) ||
				i === dataLength) { // get the last group

			// get group x and y
			pointX = groupPositions.shift();
			groupedY = approximationFn.apply(0, values);

			// push the grouped data
			if (groupedY !== UNDEFINED) {
				groupedXData.push(pointX);
				groupedYData.push(groupedY);
			}

			// reset the aggregate arrays
			values[0] = [];
			values[1] = [];
			values[2] = [];
			values[3] = [];

			// don't loop beyond the last group
			if (i === dataLength) {
				break;
			}
		}

		// break out
		if (i === dataLength) {
			break;
		}

		// for each raw data point, push it to an array that contains all values for this specific group
		if (pointArrayMap) {

			var index = series.cropStart + i,
				point = (data && data[index]) || series.pointClass.prototype.applyOptions.apply({ series: series }, [dataOptions[index]]),
				j,
				val;

			for (j = 0; j < pointArrayMapLength; j++) {
				val = point[pointArrayMap[j]];
				if (typeof val === NUMBER) {
					values[j].push(val);
				} else if (val === null) {
					values[j].hasNulls = true;
				}
			}

		} else {
			pointY = handleYData ? yData[i] : null;

			if (typeof pointY === NUMBER) {
				values[0].push(pointY);
			} else if (pointY === null) {
				values[0].hasNulls = true;
			}
		}
	}

	return [groupedXData, groupedYData];
};

/**
 * Extend the basic processData method, that crops the data to the current zoom
 * range, with data grouping logic.
 */
seriesProto.processData = function () {
	var series = this,
		chart = series.chart,
		options = series.options,
		dataGroupingOptions = options[DATA_GROUPING],
		groupingEnabled = series.allowDG !== false && dataGroupingOptions && pick(dataGroupingOptions.enabled, chart.options._stock),
		hasGroupedData;

	// run base method
	series.forceCrop = groupingEnabled; // #334
	series.groupPixelWidth = null; // #2110
	series.hasProcessed = true; // #2692

	// skip if processData returns false or if grouping is disabled (in that order)
	if (baseProcessData.apply(series, arguments) === false || !groupingEnabled) {
		return;

	} else {
		series.destroyGroupedData();

	}
	var i,
		processedXData = series.processedXData,
		processedYData = series.processedYData,
		plotSizeX = chart.plotSizeX,
		xAxis = series.xAxis,
		ordinal = xAxis.options.ordinal,
		groupPixelWidth = series.groupPixelWidth = xAxis.getGroupPixelWidth && xAxis.getGroupPixelWidth(),
		nonGroupedPointRange = series.pointRange;

	// Execute grouping if the amount of points is greater than the limit defined in groupPixelWidth
	if (groupPixelWidth) {
		hasGroupedData = true;

		series.points = null; // force recreation of point instances in series.translate

		var extremes = xAxis.getExtremes(),
			xMin = extremes.min,
			xMax = extremes.max,
			groupIntervalFactor = (ordinal && xAxis.getGroupIntervalFactor(xMin, xMax, series)) || 1,
			interval = (groupPixelWidth * (xMax - xMin) / plotSizeX) * groupIntervalFactor,
			groupPositions = xAxis.getTimeTicks(
				xAxis.normalizeTimeTickInterval(interval, dataGroupingOptions.units || defaultDataGroupingUnits),
				xMin,
				xMax,
				xAxis.options.startOfWeek,
				processedXData,
				series.closestPointRange
			),
			groupedXandY = seriesProto.groupData.apply(series, [processedXData, processedYData, groupPositions, dataGroupingOptions.approximation]),
			groupedXData = groupedXandY[0],
			groupedYData = groupedXandY[1];

		// prevent the smoothed data to spill out left and right, and make
		// sure data is not shifted to the left
		if (dataGroupingOptions.smoothed) {
			i = groupedXData.length - 1;
			groupedXData[i] = xMax;
			while (i-- && i > 0) {
				groupedXData[i] += interval / 2;
			}
			groupedXData[0] = xMin;
		}

		// record what data grouping values were used
		series.currentDataGrouping = groupPositions.info;
		if (options.pointRange === null) { // null means auto, as for columns, candlesticks and OHLC
			series.pointRange = groupPositions.info.totalRange;
		}
		series.closestPointRange = groupPositions.info.totalRange;

		// Make sure the X axis extends to show the first group (#2533)
		if (defined(groupedXData[0]) && groupedXData[0] < xAxis.dataMin) {
			if (xAxis.min === xAxis.dataMin) {
				xAxis.min = groupedXData[0];
			}
			xAxis.dataMin = groupedXData[0];
		}

		// set series props
		series.processedXData = groupedXData;
		series.processedYData = groupedYData;
	} else {
		series.currentDataGrouping = null;
		series.pointRange = nonGroupedPointRange;
	}
	series.hasGroupedData = hasGroupedData;
};

/**
 * Destroy the grouped data points. #622, #740
 */
seriesProto.destroyGroupedData = function () {

	var groupedData = this.groupedData;

	// clear previous groups
	each(groupedData || [], function (point, i) {
		if (point) {
			groupedData[i] = point.destroy ? point.destroy() : null;
		}
	});
	this.groupedData = null;
};

/**
 * Override the generatePoints method by adding a reference to grouped data
 */
seriesProto.generatePoints = function () {

	baseGeneratePoints.apply(this);

	// record grouped data in order to let it be destroyed the next time processData runs
	this.destroyGroupedData(); // #622
	this.groupedData = this.hasGroupedData ? this.points : null;
};

/**
 * Extend the original method, make the tooltip's header reflect the grouped range
 */
tooltipProto.tooltipFooterHeaderFormatter = function (point, isFooter) {
	var tooltip = this,
		series = point.series,
		options = series.options,
		tooltipOptions = series.tooltipOptions,
		dataGroupingOptions = options.dataGrouping,
		xDateFormat = tooltipOptions.xDateFormat,
		xDateFormatEnd,
		xAxis = series.xAxis,
		currentDataGrouping,
		dateTimeLabelFormats,
		labelFormats,
		formattedKey,
		ret;

	// apply only to grouped series
	if (xAxis && xAxis.options.type === 'datetime' && dataGroupingOptions && isNumber(point.key)) {

		// set variables
		currentDataGrouping = series.currentDataGrouping;
		dateTimeLabelFormats = dataGroupingOptions.dateTimeLabelFormats;

		// if we have grouped data, use the grouping information to get the right format
		if (currentDataGrouping) {
			labelFormats = dateTimeLabelFormats[currentDataGrouping.unitName];
			if (currentDataGrouping.count === 1) {
				xDateFormat = labelFormats[0];
			} else {
				xDateFormat = labelFormats[1];
				xDateFormatEnd = labelFormats[2];
			}
		// if not grouped, and we don't have set the xDateFormat option, get the best fit,
		// so if the least distance between points is one minute, show it, but if the
		// least distance is one day, skip hours and minutes etc.
		} else if (!xDateFormat && dateTimeLabelFormats) {
			xDateFormat = tooltip.getXDateFormat(point, tooltipOptions, xAxis);
		}

		// now format the key
		formattedKey = dateFormat(xDateFormat, point.key);
		if (xDateFormatEnd) {
			formattedKey += dateFormat(xDateFormatEnd, point.key + currentDataGrouping.totalRange - 1);
		}

		// return the replaced format
		ret = tooltipOptions[(isFooter ? 'footer' : 'header') + 'Format'].replace('{point.key}', formattedKey);

	// else, fall back to the regular formatter
	} else {
		ret = baseTooltipFooterHeaderFormatter.call(tooltip, point, isFooter);
	}

	return ret;
};

/**
 * Extend the series destroyer
 */
seriesProto.destroy = function () {
	var series = this,
		groupedData = series.groupedData || [],
		i = groupedData.length;

	while (i--) {
		if (groupedData[i]) {
			groupedData[i].destroy();
		}
	}
	baseDestroy.apply(series);
};

// Handle default options for data grouping. This must be set at runtime because some series types are
// defined after this.
wrap(seriesProto, 'setOptions', function (proceed, itemOptions) {

	var options = proceed.call(this, itemOptions),
		type = this.type,
		plotOptions = this.chart.options.plotOptions,
		defaultOptions = defaultPlotOptions[type].dataGrouping;

	if (specificOptions[type]) { // #1284
		if (!defaultOptions) {
			defaultOptions = merge(commonOptions, specificOptions[type]);
		}

		options.dataGrouping = merge(
			defaultOptions,
			plotOptions.series && plotOptions.series.dataGrouping, // #1228
			plotOptions[type].dataGrouping, // Set by the StockChart constructor
			itemOptions.dataGrouping
		);
	}

	if (this.chart.options._stock) {
		this.requireSorting = true;
	}

	return options;
});

/**
 * When resetting the scale reset the hasProccessed flag to avoid taking previous data grouping
 * of neighbour series into accound when determining group pixel width (#2692).
 */
wrap(Axis.prototype, 'setScale', function (proceed) {
	proceed.call(this);
	each(this.series, function (series) {
		series.hasProcessed = false;
	});
});

/**
 * Get the data grouping pixel width based on the greatest defined individual width
 * of the axis' series, and if whether one of the axes need grouping.
 */
Axis.prototype.getGroupPixelWidth = function () {

	var series = this.series,
		len = series.length,
		i,
		groupPixelWidth = 0,
		doGrouping = false,
		dataLength,
		dgOptions;

	// If multiple series are compared on the same x axis, give them the same
	// group pixel width (#334)
	i = len;
	while (i--) {
		dgOptions = series[i].options.dataGrouping;
		if (dgOptions) {
			groupPixelWidth = mathMax(groupPixelWidth, dgOptions.groupPixelWidth);

		}
	}

	// If one of the series needs grouping, apply it to all (#1634)
	i = len;
	while (i--) {
		dgOptions = series[i].options.dataGrouping;

		if (dgOptions && series[i].hasProcessed) { // #2692

			dataLength = (series[i].processedXData || series[i].data).length;

			// Execute grouping if the amount of points is greater than the limit defined in groupPixelWidth
			if (series[i].groupPixelWidth || dataLength > (this.chart.plotSizeX / groupPixelWidth) || (dataLength && dgOptions.forced)) {
				doGrouping = true;
			}
		}
	}

	return doGrouping ? groupPixelWidth : 0;
};

/**
 * Force data grouping on all the axis' series.
 */
Axis.prototype.setDataGrouping = function (dataGrouping, redraw) {
	var i;

	redraw = pick(redraw, true);

	if (!dataGrouping) {
		dataGrouping = {
			forced: false,
			units: null
		};
	}

	// Axis is instantiated, update all series
	if (this instanceof Axis) {
		i = this.series.length;
		while (i--) {
			this.series[i].update({
				dataGrouping: dataGrouping
			}, false);
		}

	// Axis not yet instanciated, alter series options
	} else {
		each(this.chart.options.series, function (seriesOptions) {
			seriesOptions.dataGrouping = dataGrouping;
		}, false);
	}

	if (redraw) {
		this.chart.redraw();
	}
};

/* ****************************************************************************
 * End data grouping module												   *
 ******************************************************************************/