text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport"
        content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="google-site-verification"
        content="7UY7VcXR28Tpmw6m6fc6wtJJQvar71GKqGojp3HPb4Q"/>
  <title>Morpheus</title>
  <link rel="stylesheet" href="css/morpheus-latest.min.css">

  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

Please enable JavaScript


text:
package com.tle.web.sections.standard.js.modules;

import com.tle.core.javascript.JavascriptModule;
import com.tle.web.resources.ResourcesService;
import com.tle.web.sections.jquery.JQuerySelector;
import com.tle.web.sections.jquery.JQueryStatement;
import com.tle.web.sections.jquery.libraries.JQueryCore;
import com.tle.web.sections.js.JSCallable;
import com.tle.web.sections.js.JSStatements;
import com.tle.web.sections.js.generic.expression.FunctionCallExpression;
import com.tle.web.sections.js.generic.expression.ObjectExpression;
import com.tle.web.sections.js.generic.function.ExternallyDefinedFunction;
import com.tle.web.sections.js.generic.function.IncludeFile;
import com.tle.web.sections.render.PreRenderable;

/** @author aholland */
@SuppressWarnings("nls")
public class TooltipModule implements JavascriptModule {
  private static final long serialVersionUID = 1L;

  private static final PreRenderable INCLUDE =
      new IncludeFile(
          ResourcesService.getResourceHelper(TooltipModule.class).url("js/tooltip.js"),
          JQueryCore.PRERENDER);

  public static final JSCallable TOOL_TIP = new ExternallyDefinedFunction("tooltip", 1, INCLUDE);

  public static JSStatements getTooltipStatements(
      JQuerySelector hoverSelector,
      JQuerySelector tipSelector,
      int delay,
      boolean useMousePosition) {
    return new JQueryStatement(
        hoverSelector,
        new FunctionCallExpression(
            TOOL_TIP,
            new ObjectExpression(
                "tipelement", tipSelector, "delay", delay, "mousePosition", useMousePosition)));
  }

  public static JSStatements getTooltipStatements(
      JQuerySelector hoverSelector,
      JQuerySelector tipSelector,
      int delay,
      int xOffset,
      int yOffset,
      boolean useMousePosition) {
    return new JQueryStatement(
        hoverSelector,
        new FunctionCallExpression(
            TOOL_TIP,
            new ObjectExpression(
                "xOffset",
                xOffset,
                "yOffset",
                yOffset,
                "tipelement",
                tipSelector,
                "delay",
                delay,
                "mousePosition",
                useMousePosition)));
  }

  public static JSStatements getTooltipStatements(
      JQuerySelector hoverSelector, String hoverHtml, int delay, boolean useMousePosition) {
    return new JQueryStatement(
        hoverSelector,
        new FunctionCallExpression(
            TOOL_TIP,
            new ObjectExpression(
                "tipelement",
                null,
                "delay",
                delay,
                "tiphtml",
                hoverHtml,
                "mousePosition",
                useMousePosition)));
  }

  @Override
  public String getDisplayName() {
    return "Tooltip";
  }

  @Override
  public String getId() {
    return "tooltip";
  }

  @Override
  public Object getPreRenderer() {
    return INCLUDE;
  }
}

redpajama_set_name: RedPajamaGithub


text:
require 'date'
require 'pony'
require_relative 'core_ext/hash'
require_relative 'helpers'

module DoSnapshot
  # Shared mailer.
  #
  class Mail
    attr_writer :mailer, :opts_default, :smtp_default

    def initialize(options = {})
      options.each { |key, option| send("#{key}=", option) }
    end

    def reset_options
      @opts = opts_default
      @smtp = smtp_default
    end

    def mailer
      @mailer ||= Pony.method(:mail)
    end

    def smtp
      @smtp ||= smtp_default.dup
    end

    def opts
      @opts ||= opts_default.dup
    end

    def smtp=(options)
      options.each_pair do |key, value|
        smtp[key.to_sym] = value
      end if options
    end

    def opts=(options)
      options.each_pair do |key, value|
        opts[key.to_sym] = value
      end if options
    end

    # Sending message via Hash params.
    #
    # Options:: --mail to:mail@somehost.com from:from@host.com --smtp address:smtp.gmail.com user_name:someuser password:somepassword
    #
    def notify
      setup_notify
      logger.debug 'Sending e-mail notification.'
      # Look into your inbox :)
      mailer.call(opts)
    end

    protected

    def logger
      DoSnapshot::Helpers::UniversalLogger
    end

    def opts_default
      @opts_default ||= {
        subject: 'Digital Ocean: maximum snapshots is reached.',
        body: "Please cleanup your Digital Ocean account.\nSnapshot maximum is reached.",
        from: 'noreply@someonelse.com',
        to: 'to@someonelse.com',
        via: :smtp
      }
    end

    def smtp_default
      @smtp_default ||= {
        domain: 'localhost.localdomain',
        port: '25'
      }
    end

    def setup_notify
      opts[:body] = "#{opts[:body]}\n\nTrace: #{DateTime.now}\n#{DoSnapshot.logger.buffer.join("\n")}"
      opts[:via_options] = smtp
    end
  end
end


text:
const { Command } = require('discord.js-commando');

module.exports = class SayCommand extends Command {
    constructor(client) {
        super(client, {
            name: 'prune',
            group: 'mod',
            memberName: 'prune',
            description: 'Deletes `x` messages.',
            examples: ['prune 10'],
            args: [
                {
                    key: 'num',
                    prompt: 'How many messages do you want to prune?',
                    type: 'integer'
                }
            ]
        });
    }

    hasPermission(msg) {
        if (msg.channel.type === "dm") return false;
		if (this.client.isOwner(msg.author) || msg.member.hasPermission("MANAGE_MESSAGES")) {
            return true;
        } else return false;
	}

    run(msg, args) {
        const { num } = args;
        msg.channel.bulkDelete(num+1);
        return;
    }
};


text:
#include "../Precompiled.h"

#include "../Core/Context.h"
#include "../Core/Profiler.h"
#include "../Graphics/AnimatedModel.h"
#include "../Graphics/Animation.h"
#include "../Graphics/AnimationController.h"
#include "../Graphics/AnimationState.h"
#include "../IO/FileSystem.h"
#include "../IO/Log.h"
#include "../IO/MemoryBuffer.h"
#include "../Resource/ResourceCache.h"
#include "../Scene/Scene.h"
#include "../Scene/SceneEvents.h"

#include "../DebugNew.h"

namespace Urho3D
{

static const unsigned char CTRL_LOOPED = 0x1;
static const unsigned char CTRL_STARTBONE = 0x2;
static const unsigned char CTRL_AUTOFADE = 0x4;
static const unsigned char CTRL_SETTIME = 0x08;
static const unsigned char CTRL_SETWEIGHT = 0x10;
static const unsigned char CTRL_REMOVEONCOMPLETION = 0x20;
static const unsigned char CTRL_ADDITIVE = 0x40;
static const float EXTRA_ANIM_FADEOUT_TIME = 0.1f;
static const float COMMAND_STAY_TIME = 0.25f;
static const unsigned MAX_NODE_ANIMATION_STATES = 256;

extern const char* LOGIC_CATEGORY;

AnimationController::AnimationController(Context* context) :
    Component(context)
{
}

AnimationController::~AnimationController()
{
}

void AnimationController::RegisterObject(Context* context)
{
    context->RegisterFactory<AnimationController>(LOGIC_CATEGORY);

    URHO3D_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
    URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Animations", GetAnimationsAttr, SetAnimationsAttr, VariantVector, Variant::emptyVariantVector,
        AM_FILE | AM_NOEDIT);
    URHO3D_ACCESSOR_ATTRIBUTE("Network Animations", GetNetAnimationsAttr, SetNetAnimationsAttr, PODVector<unsigned char>,
        Variant::emptyBuffer, AM_NET | AM_LATESTDATA | AM_NOEDIT);
    URHO3D_MIXED_ACCESSOR_ATTRIBUTE("Node Animation States", GetNodeAnimationStatesAttr, SetNodeAnimationStatesAttr, VariantVector,
        Variant::emptyVariantVector, AM_FILE | AM_NOEDIT);
}

void AnimationController::OnSetEnabled()
{
    Scene* scene = GetScene();
    if (scene)
    {
        if (IsEnabledEffective())
            SubscribeToEvent(scene, E_SCENEPOSTUPDATE, URHO3D_HANDLER(AnimationController, HandleScenePostUpdate));
        else
            UnsubscribeFromEvent(scene, E_SCENEPOSTUPDATE);
    }
}

void AnimationController::Update(float timeStep)
{
    // Loop through animations
    for (unsigned i = 0; i < animations_.Size();)
    {
        AnimationControl& ctrl = animations_[i];
        AnimationState* state = GetAnimationState(ctrl.hash_);
        bool remove = false;

        if (!state)
            remove = true;
        else
        {
            // Advance the animation
            if (ctrl.speed_ != 0.0f)
                state->AddTime(ctrl.speed_ * timeStep);

            float targetWeight = ctrl.targetWeight_;
            float fadeTime = ctrl.fadeTime_;

            // If non-looped animation at the end, activate autofade as applicable
            if (!state->IsLooped() && state->GetTime() >= state->GetLength() && ctrl.autoFadeTime_ > 0.0f)
            {
                targetWeight = 0.0f;
                fadeTime = ctrl.autoFadeTime_;
            }

            // Process weight fade
            float currentWeight = state->GetWeight();
            if (currentWeight != targetWeight)
            {
                if (fadeTime > 0.0f)
                {
                    float weightDelta = 1.0f / fadeTime * timeStep;
                    if (currentWeight < targetWeight)
                        currentWeight = Min(currentWeight + weightDelta, targetWeight);
                    else if (currentWeight > targetWeight)
                        currentWeight = Max(currentWeight - weightDelta, targetWeight);
                    state->SetWeight(currentWeight);
                }
                else
                    state->SetWeight(targetWeight);
            }

            // Remove if weight zero and target weight zero
            if (state->GetWeight() == 0.0f && (targetWeight == 0.0f || fadeTime == 0.0f) && ctrl.removeOnCompletion_)
                remove = true;
        }

        // Decrement the command time-to-live values
        if (ctrl.setTimeTtl_ > 0.0f)
            ctrl.setTimeTtl_ = Max(ctrl.setTimeTtl_ - timeStep, 0.0f);
        if (ctrl.setWeightTtl_ > 0.0f)
            ctrl.setWeightTtl_ = Max(ctrl.setWeightTtl_ - timeStep, 0.0f);

        if (remove)
        {
            if (state)
                RemoveAnimationState(state);
            animations_.Erase(i);
            MarkNetworkUpdate();
        }
        else
            ++i;
    }

    // Node hierarchy animations need to be applied manually
    for (Vector<SharedPtr<AnimationState> >::Iterator i = nodeAnimationStates_.Begin(); i != nodeAnimationStates_.End(); ++i)
        (*i)->Apply();
}

bool AnimationController::Play(const String& name, unsigned char layer, bool looped, float fadeInTime)
{
    // Get the animation resource first to be able to get the canonical resource name
    // (avoids potential adding of duplicate animations)
    Animation* newAnimation = GetSubsystem<ResourceCache>()->GetResource<Animation>(name);
    if (!newAnimation)
        return false;

    // Check if already exists
    unsigned index;
    AnimationState* state;
    FindAnimation(newAnimation->GetName(), index, state);

    if (!state)
    {
        state = AddAnimationState(newAnimation);
        if (!state)
            return false;
    }

    if (index == M_MAX_UNSIGNED)
    {
        AnimationControl newControl;
        newControl.name_ = newAnimation->GetName();
        newControl.hash_ = newAnimation->GetNameHash();
        animations_.Push(newControl);
        index = animations_.Size() - 1;
    }

    state->SetLayer(layer);
    state->SetLooped(looped);
    animations_[index].targetWeight_ = 1.0f;
    animations_[index].fadeTime_ = fadeInTime;

    MarkNetworkUpdate();
    return true;
}

bool AnimationController::PlayExclusive(const String& name, unsigned char layer, bool looped, float fadeTime)
{
    bool success = Play(name, layer, looped, fadeTime);

    // Fade other animations only if successfully started the new one
    if (success)
        FadeOthers(name, 0.0f, fadeTime);

    return success;
}

bool AnimationController::Stop(const String& name, float fadeOutTime)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index != M_MAX_UNSIGNED)
    {
        animations_[index].targetWeight_ = 0.0f;
        animations_[index].fadeTime_ = fadeOutTime;
        MarkNetworkUpdate();
    }

    return index != M_MAX_UNSIGNED || state != nullptr;
}

void AnimationController::StopLayer(unsigned char layer, float fadeOutTime)
{
    bool needUpdate = false;
    for (Vector<AnimationControl>::Iterator i = animations_.Begin(); i != animations_.End(); ++i)
    {
        AnimationState* state = GetAnimationState(i->hash_);
        if (state && state->GetLayer() == layer)
        {
            i->targetWeight_ = 0.0f;
            i->fadeTime_ = fadeOutTime;
            needUpdate = true;
        }
    }

    if (needUpdate)
        MarkNetworkUpdate();
}

void AnimationController::StopAll(float fadeOutTime)
{
    if (animations_.Size())
    {
        for (Vector<AnimationControl>::Iterator i = animations_.Begin(); i != animations_.End(); ++i)
        {
            i->targetWeight_ = 0.0f;
            i->fadeTime_ = fadeOutTime;
        }

        MarkNetworkUpdate();
    }
}

bool AnimationController::Fade(const String& name, float targetWeight, float fadeTime)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED)
        return false;

    animations_[index].targetWeight_ = Clamp(targetWeight, 0.0f, 1.0f);
    animations_[index].fadeTime_ = fadeTime;
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::FadeOthers(const String& name, float targetWeight, float fadeTime)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED || !state)
        return false;

    unsigned char layer = state->GetLayer();

    bool needUpdate = false;
    for (unsigned i = 0; i < animations_.Size(); ++i)
    {
        if (i != index)
        {
            AnimationControl& control = animations_[i];
            AnimationState* otherState = GetAnimationState(control.hash_);
            if (otherState && otherState->GetLayer() == layer)
            {
                control.targetWeight_ = Clamp(targetWeight, 0.0f, 1.0f);
                control.fadeTime_ = fadeTime;
                needUpdate = true;
            }
        }
    }

    if (needUpdate)
        MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetLayer(const String& name, unsigned char layer)
{
    AnimationState* state = GetAnimationState(name);
    if (!state)
        return false;

    state->SetLayer(layer);
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetStartBone(const String& name, const String& startBoneName)
{
    // Start bone can only be set in model mode
    AnimatedModel* model = GetComponent<AnimatedModel>();
    if (!model)
        return false;

    AnimationState* state = model->GetAnimationState(name);
    if (!state)
        return false;

    Bone* bone = model->GetSkeleton().GetBone(startBoneName);
    state->SetStartBone(bone);
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetTime(const String& name, float time)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED || !state)
        return false;

    time = Clamp(time, 0.0f, state->GetLength());
    state->SetTime(time);
    // Prepare "set time" command for network replication
    animations_[index].setTime_ = (unsigned short)(time / state->GetLength() * 65535.0f);
    animations_[index].setTimeTtl_ = COMMAND_STAY_TIME;
    ++animations_[index].setTimeRev_;
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetSpeed(const String& name, float speed)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED)
        return false;

    animations_[index].speed_ = speed;
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetWeight(const String& name, float weight)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED || !state)
        return false;

    weight = Clamp(weight, 0.0f, 1.0f);
    state->SetWeight(weight);
    // Prepare "set weight" command for network replication
    animations_[index].setWeight_ = (unsigned char)(weight * 255.0f);
    animations_[index].setWeightTtl_ = COMMAND_STAY_TIME;
    ++animations_[index].setWeightRev_;
    // Cancel any ongoing weight fade
    animations_[index].targetWeight_ = weight;
    animations_[index].fadeTime_ = 0.0f;

    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetRemoveOnCompletion(const String& name, bool removeOnCompletion)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED || !state)
        return false;

    animations_[index].removeOnCompletion_ = removeOnCompletion;
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetLooped(const String& name, bool enable)
{
    AnimationState* state = GetAnimationState(name);
    if (!state)
        return false;

    state->SetLooped(enable);
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetBlendMode(const String& name, AnimationBlendMode mode)
{
    AnimationState* state = GetAnimationState(name);
    if (!state)
        return false;

    state->SetBlendMode(mode);
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::SetAutoFade(const String& name, float fadeOutTime)
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED)
        return false;

    animations_[index].autoFadeTime_ = Max(fadeOutTime, 0.0f);
    MarkNetworkUpdate();
    return true;
}

bool AnimationController::IsPlaying(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    return index != M_MAX_UNSIGNED;
}

bool AnimationController::IsPlaying(unsigned char layer) const
{
    for (Vector<AnimationControl>::ConstIterator i = animations_.Begin(); i != animations_.End(); ++i)
    {
        AnimationState* state = GetAnimationState(i->hash_);
        if (state && state->GetLayer() == layer)
            return true;
    }

    return false;
}

bool AnimationController::IsFadingIn(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED || !state)
        return false;

    return animations_[index].fadeTime_ && animations_[index].targetWeight_ > state->GetWeight();
}

bool AnimationController::IsFadingOut(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED || !state)
        return false;

    return (animations_[index].fadeTime_ && animations_[index].targetWeight_ < state->GetWeight())
           || (!state->IsLooped() && state->GetTime() >= state->GetLength() && animations_[index].autoFadeTime_);
}

bool AnimationController::IsAtEnd(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    if (index == M_MAX_UNSIGNED || !state)
        return false;
    else
        return state->GetTime() >= state->GetLength();
}

unsigned char AnimationController::GetLayer(const String& name) const
{
    AnimationState* state = GetAnimationState(name);
    return (unsigned char)(state ? state->GetLayer() : 0);
}

Bone* AnimationController::GetStartBone(const String& name) const
{
    AnimationState* state = GetAnimationState(name);
    return state ? state->GetStartBone() : nullptr;
}

const String& AnimationController::GetStartBoneName(const String& name) const
{
    Bone* bone = GetStartBone(name);
    return bone ? bone->name_ : String::EMPTY;
}

float AnimationController::GetTime(const String& name) const
{
    AnimationState* state = GetAnimationState(name);
    return state ? state->GetTime() : 0.0f;
}

float AnimationController::GetWeight(const String& name) const
{
    AnimationState* state = GetAnimationState(name);
    return state ? state->GetWeight() : 0.0f;
}

bool AnimationController::IsLooped(const String& name) const
{
    AnimationState* state = GetAnimationState(name);
    return state ? state->IsLooped() : false;
}

AnimationBlendMode AnimationController::GetBlendMode(const String& name) const
{
    AnimationState* state = GetAnimationState(name);
    return state ? state->GetBlendMode() : ABM_LERP;
}

float AnimationController::GetLength(const String& name) const
{
    AnimationState* state = GetAnimationState(name);
    return state ? state->GetLength() : 0.0f;
}

float AnimationController::GetSpeed(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    return index != M_MAX_UNSIGNED ? animations_[index].speed_ : 0.0f;
}

float AnimationController::GetFadeTarget(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    return index != M_MAX_UNSIGNED ? animations_[index].targetWeight_ : 0.0f;
}

float AnimationController::GetFadeTime(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    return index != M_MAX_UNSIGNED ? animations_[index].targetWeight_ : 0.0f;
}

float AnimationController::GetAutoFade(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    return index != M_MAX_UNSIGNED ? animations_[index].autoFadeTime_ : 0.0f;
}

bool AnimationController::GetRemoveOnCompletion(const String& name) const
{
    unsigned index;
    AnimationState* state;
    FindAnimation(name, index, state);
    return index != M_MAX_UNSIGNED ? animations_[index].removeOnCompletion_ : false;
}

AnimationState* AnimationController::GetAnimationState(const String& name) const
{
    return GetAnimationState(StringHash(name));
}

AnimationState* AnimationController::GetAnimationState(StringHash nameHash) const
{
    // Model mode
    AnimatedModel* model = GetComponent<AnimatedModel>();
    if (model)
        return model->GetAnimationState(nameHash);

    // Node hierarchy mode
    for (Vector<SharedPtr<AnimationState> >::ConstIterator i = nodeAnimationStates_.Begin(); i != nodeAnimationStates_.End(); ++i)
    {
        Animation* animation = (*i)->GetAnimation();
        if (animation->GetNameHash() == nameHash || animation->GetAnimationNameHash() == nameHash)
            return *i;
    }

    return nullptr;
}

void AnimationController::SetAnimationsAttr(const VariantVector& value)
{
    animations_.Clear();
    animations_.Reserve(value.Size() / 5);  // Incomplete data is discarded
    unsigned index = 0;
    while (index + 4 < value.Size())    // Prevent out-of-bound index access
    {
        AnimationControl newControl;
        newControl.name_ = value[index++].GetString();
        newControl.hash_ = StringHash(newControl.name_);
        newControl.speed_ = value[index++].GetFloat();
        newControl.targetWeight_ = value[index++].GetFloat();
        newControl.fadeTime_ = value[index++].GetFloat();
        newControl.autoFadeTime_ = value[index++].GetFloat();
        animations_.Push(newControl);
    }
}

void AnimationController::SetNetAnimationsAttr(const PODVector<unsigned char>& value)
{
    MemoryBuffer buf(value);

    AnimatedModel* model = GetComponent<AnimatedModel>();

    // Check which animations we need to remove
    HashSet<StringHash> processedAnimations;

    unsigned numAnimations = buf.ReadVLE();
    while (numAnimations--)
    {
        String animName = buf.ReadString();
        StringHash animHash(animName);
        processedAnimations.Insert(animHash);

        // Check if the animation state exists. If not, add new
        AnimationState* state = GetAnimationState(animHash);
        if (!state)
        {
            Animation* newAnimation = GetSubsystem<ResourceCache>()->GetResource<Animation>(animName);
            state = AddAnimationState(newAnimation);
            if (!state)
            {
                URHO3D_LOGERROR("Animation update applying aborted due to unknown animation");
                return;
            }
        }
        // Check if the internal control structure exists. If not, add new
        unsigned index;
        for (index = 0; index < animations_.Size(); ++index)
        {
            if (animations_[index].hash_ == animHash)
                break;
        }
        if (index == animations_.Size())
        {
            AnimationControl newControl;
            newControl.name_ = animName;
            newControl.hash_ = animHash;
            animations_.Push(newControl);
        }

        unsigned char ctrl = buf.ReadUByte();
        state->SetLayer(buf.ReadUByte());
        state->SetLooped((ctrl & CTRL_LOOPED) != 0);
        state->SetBlendMode((ctrl & CTRL_ADDITIVE) != 0 ? ABM_ADDITIVE : ABM_LERP);
        animations_[index].speed_ = (float)buf.ReadShort() / 2048.0f; // 11 bits of decimal precision, max. 16x playback speed
        animations_[index].targetWeight_ = (float)buf.ReadUByte() / 255.0f; // 8 bits of decimal precision
        animations_[index].fadeTime_ = (float)buf.ReadUByte() / 64.0f; // 6 bits of decimal precision, max. 4 seconds fade
        if (ctrl & CTRL_STARTBONE)
        {
            StringHash boneHash = buf.ReadStringHash();
            if (model)
                state->SetStartBone(model->GetSkeleton().GetBone(boneHash));
        }
        else
            state->SetStartBone(nullptr);
        if (ctrl & CTRL_AUTOFADE)
            animations_[index].autoFadeTime_ = (float)buf.ReadUByte() / 64.0f; // 6 bits of decimal precision, max. 4 seconds fade
        else
            animations_[index].autoFadeTime_ = 0.0f;

        animations_[index].removeOnCompletion_ = (ctrl & CTRL_REMOVEONCOMPLETION) != 0;

        if (ctrl & CTRL_SETTIME)
        {
            unsigned char setTimeRev = buf.ReadUByte();
            unsigned short setTime = buf.ReadUShort();
            // Apply set time command only if revision differs
            if (setTimeRev != animations_[index].setTimeRev_)
            {
                state->SetTime(((float)setTime / 65535.0f) * state->GetLength());
                animations_[index].setTimeRev_ = setTimeRev;
            }
        }
        if (ctrl & CTRL_SETWEIGHT)
        {
            unsigned char setWeightRev = buf.ReadUByte();
            unsigned char setWeight = buf.ReadUByte();
            // Apply set weight command only if revision differs
            if (setWeightRev != animations_[index].setWeightRev_)
            {
                state->SetWeight((float)setWeight / 255.0f);
                animations_[index].setWeightRev_ = setWeightRev;
            }
        }
    }

    // Set any extra animations to fade out
    for (Vector<AnimationControl>::Iterator i = animations_.Begin(); i != animations_.End(); ++i)
    {
        if (!processedAnimations.Contains(i->hash_))
        {
            i->targetWeight_ = 0.0f;
            i->fadeTime_ = EXTRA_ANIM_FADEOUT_TIME;
        }
    }
}

void AnimationController::SetNodeAnimationStatesAttr(const VariantVector& value)
{
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    nodeAnimationStates_.Clear();
    unsigned index = 0;
    unsigned numStates = index < value.Size() ? value[index++].GetUInt() : 0;
    // Prevent negative or overly large value being assigned from the editor
    if (numStates > M_MAX_INT)
        numStates = 0;
    if (numStates > MAX_NODE_ANIMATION_STATES)
        numStates = MAX_NODE_ANIMATION_STATES;

    nodeAnimationStates_.Reserve(numStates);
    while (numStates--)
    {
        if (index + 2 < value.Size())
        {
            // Note: null animation is allowed here for editing
            const ResourceRef& animRef = value[index++].GetResourceRef();
            SharedPtr<AnimationState> newState(new AnimationState(GetNode(), cache->GetResource<Animation>(animRef.name_)));
            nodeAnimationStates_.Push(newState);

            newState->SetLooped(value[index++].GetBool());
            newState->SetTime(value[index++].GetFloat());
        }
        else
        {
            // If not enough data, just add an empty animation state
            SharedPtr<AnimationState> newState(new AnimationState(GetNode(), nullptr));
            nodeAnimationStates_.Push(newState);
        }
    }
}

VariantVector AnimationController::GetAnimationsAttr() const
{
    VariantVector ret;
    ret.Reserve(animations_.Size() * 5);
    for (Vector<AnimationControl>::ConstIterator i = animations_.Begin(); i != animations_.End(); ++i)
    {
        ret.Push(i->name_);
        ret.Push(i->speed_);
        ret.Push(i->targetWeight_);
        ret.Push(i->fadeTime_);
        ret.Push(i->autoFadeTime_);
    }
    return ret;
}

const PODVector<unsigned char>& AnimationController::GetNetAnimationsAttr() const
{
    attrBuffer_.Clear();

    AnimatedModel* model = GetComponent<AnimatedModel>();

    unsigned validAnimations = 0;
    for (Vector<AnimationControl>::ConstIterator i = animations_.Begin(); i != animations_.End(); ++i)
    {
        if (GetAnimationState(i->hash_))
            ++validAnimations;
    }

    attrBuffer_.WriteVLE(validAnimations);
    for (Vector<AnimationControl>::ConstIterator i = animations_.Begin(); i != animations_.End(); ++i)
    {
        AnimationState* state = GetAnimationState(i->hash_);
        if (!state)
            continue;

        unsigned char ctrl = 0;
        Bone* startBone = state->GetStartBone();
        if (state->IsLooped())
            ctrl |= CTRL_LOOPED;
        if (state->GetBlendMode() == ABM_ADDITIVE)
            ctrl |= CTRL_ADDITIVE;
        if (startBone && model && startBone != model->GetSkeleton().GetRootBone())
            ctrl |= CTRL_STARTBONE;
        if (i->autoFadeTime_ > 0.0f)
            ctrl |= CTRL_AUTOFADE;
        if (i->removeOnCompletion_)
            ctrl |= CTRL_REMOVEONCOMPLETION;
        if (i->setTimeTtl_ > 0.0f)
            ctrl |= CTRL_SETTIME;
        if (i->setWeightTtl_ > 0.0f)
            ctrl |= CTRL_SETWEIGHT;

        attrBuffer_.WriteString(i->name_);
        attrBuffer_.WriteUByte(ctrl);
        attrBuffer_.WriteUByte(state->GetLayer());
        attrBuffer_.WriteShort((short)Clamp(i->speed_ * 2048.0f, -32767.0f, 32767.0f));
        attrBuffer_.WriteUByte((unsigned char)(i->targetWeight_ * 255.0f));
        attrBuffer_.WriteUByte((unsigned char)Clamp(i->fadeTime_ * 64.0f, 0.0f, 255.0f));
        if (ctrl & CTRL_STARTBONE)
            attrBuffer_.WriteStringHash(startBone->nameHash_);
        if (ctrl & CTRL_AUTOFADE)
            attrBuffer_.WriteUByte((unsigned char)Clamp(i->autoFadeTime_ * 64.0f, 0.0f, 255.0f));
        if (ctrl & CTRL_SETTIME)
        {
            attrBuffer_.WriteUByte(i->setTimeRev_);
            attrBuffer_.WriteUShort(i->setTime_);
        }
        if (ctrl & CTRL_SETWEIGHT)
        {
            attrBuffer_.WriteUByte(i->setWeightRev_);
            attrBuffer_.WriteUByte(i->setWeight_);
        }
    }

    return attrBuffer_.GetBuffer();
}

VariantVector AnimationController::GetNodeAnimationStatesAttr() const
{
    VariantVector ret;
    ret.Reserve(nodeAnimationStates_.Size() * 3 + 1);
    ret.Push(nodeAnimationStates_.Size());
    for (Vector<SharedPtr<AnimationState> >::ConstIterator i = nodeAnimationStates_.Begin(); i != nodeAnimationStates_.End(); ++i)
    {
        AnimationState* state = *i;
        Animation* animation = state->GetAnimation();
        ret.Push(GetResourceRef(animation, Animation::GetTypeStatic()));
        ret.Push(state->IsLooped());
        ret.Push(state->GetTime());
    }
    return ret;
}

void AnimationController::OnSceneSet(Scene* scene)
{
    if (scene && IsEnabledEffective())
        SubscribeToEvent(scene, E_SCENEPOSTUPDATE, URHO3D_HANDLER(AnimationController, HandleScenePostUpdate));
    else if (!scene)
        UnsubscribeFromEvent(E_SCENEPOSTUPDATE);
}

AnimationState* AnimationController::AddAnimationState(Animation* animation)
{
    if (!animation)
        return nullptr;

    // Model mode
    AnimatedModel* model = GetComponent<AnimatedModel>();
    if (model)
        return model->AddAnimationState(animation);

    // Node hierarchy mode
    SharedPtr<AnimationState> newState(new AnimationState(node_, animation));
    nodeAnimationStates_.Push(newState);
    return newState;
}

void AnimationController::RemoveAnimationState(AnimationState* state)
{
    if (!state)
        return;

    // Model mode
    AnimatedModel* model = GetComponent<AnimatedModel>();
    if (model)
    {
        model->RemoveAnimationState(state);
        return;
    }

    // Node hierarchy mode
    for (Vector<SharedPtr<AnimationState> >::Iterator i = nodeAnimationStates_.Begin(); i != nodeAnimationStates_.End(); ++i)
    {
        if ((*i) == state)
        {
            nodeAnimationStates_.Erase(i);
            return;
        }
    }
}

void AnimationController::FindAnimation(const String& name, unsigned& index, AnimationState*& state) const
{
    StringHash nameHash(GetInternalPath(name));

    // Find the AnimationState
    state = GetAnimationState(nameHash);
    if (state)
    {
        // Either a resource name or animation name may be specified. We store resource names, so correct the hash if necessary
        nameHash = state->GetAnimation()->GetNameHash();
    }

    // Find the internal control structure
    index = M_MAX_UNSIGNED;
    for (unsigned i = 0; i < animations_.Size(); ++i)
    {
        if (animations_[i].hash_ == nameHash)
        {
            index = i;
            break;
        }
    }
}

void AnimationController::HandleScenePostUpdate(StringHash eventType, VariantMap& eventData)
{
    using namespace ScenePostUpdate;

    Update(eventData[P_TIMESTEP].GetFloat());
}

}


text:
class Location < ActiveRecord::Base
  has_many :location_subscriptions
  has_many :calls
  has_many :answers, through: :calls

  attr_accessible :name, :lat, :long, :description, :most_recent_activity

  validates :name, presence: true

  def self.activity_since(time)
    where('most_recent_activity >= ?', time)
  end

  def self.find_by_param(param)
    if param =~ /^[0-9]+$/
      find(param)
    else
      find_by!(name: param.gsub('-', ' '))
    end
  end

  def property_code
    digits = Rails.application.config.app_content_set.call_in_code_digits.to_i
    self.id.to_s.rjust(digits, '0')
  end

  def numerical_responses
    Question.numerical.map { |question| NumericalResponse.new(question, self) }
  end

  def has_numerical_responses?
    numerical_responses.any?(&:has_numeric_response?)
  end

  def has_voice_messages?
    answers.voice_messages.count > 0
  end

  def voice_messages
    answers.voice_messages
  end

  def new_activity!
    update_attribute(:most_recent_activity, Time.zone.now)
  end

  def to_param
    name.gsub(' ', '-')
  end

  def point
    [long.to_f, lat.to_f]
  end
end


text:
pkgdatadir = $(datadir)/fftw
pkglibdir = $(libdir)/fftw
pkgincludedir = $(includedir)/fftw
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i386-pc-nto-qnx6.4.1
host_triplet = i386-pc-nto-qnx6.4.1
subdir = m4
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_mpi.m4 \
	$(top_srcdir)/m4/acx_pthread.m4 \
	$(top_srcdir)/m4/ax_cc_maxopt.m4 \
	$(top_srcdir)/m4/ax_check_compiler_flags.m4 \
	$(top_srcdir)/m4/ax_compiler_vendor.m4 \
	$(top_srcdir)/m4/ax_gcc_aligns_stack.m4 \
	$(top_srcdir)/m4/ax_gcc_archflag.m4 \
	$(top_srcdir)/m4/ax_gcc_version.m4 \
	$(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
	$(top_srcdir)/m4/ax_openmp.m4 $(top_srcdir)/m4/libtool.m4 \
	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
	$(top_srcdir)/m4/ocaml.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /root/merged/ros6/fftw-3.2.2/missing --run aclocal-1.10
ALLOCA =
AMTAR = ${SHELL} /root/merged/ros6/fftw-3.2.2/missing --run tar
AR = ar
AS = as
AUTOCONF = ${SHELL} /root/merged/ros6/fftw-3.2.2/missing --run autoconf
AUTOHEADER = ${SHELL} /root/merged/ros6/fftw-3.2.2/missing --run autoheader
AUTOMAKE = ${SHELL} /root/merged/ros6/fftw-3.2.2/missing --run automake-1.10
AWK = gawk
CC = gcc -std=gnu99
CCDEPMODE = depmode=gcc3
CFLAGS = -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -march=pentium3
CODELET_OPTIM = -O -fno-schedule-insns -fno-web -fno-loop-optimize --param inline-unit-growth=1000 --param large-function-growth=1000
CPP = gcc -std=gnu99 -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DLLTOOL = dlltool
DSYMUTIL =
DUMPBIN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /usr/bin/grep -E
EXEEXT =
F77 =
FFLAGS =
FGREP = /usr/bin/grep -F
FLIBS =
GREP = /usr/bin/grep
INSTALL = .././install-sh -c
INSTALLED_OCAMLC = /usr/local/bin/ocamlc
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/qnx641/host/qnx6/x86/usr/bin/ntox86-ld
LDFLAGS =
LIBOBJS =
LIBS = -lm
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO =
LN_S = ln -s
LTLIBOBJS =
MAINT = #
MAKEINFO = ${SHELL} /root/merged/ros6/fftw-3.2.2/missing --run makeinfo
MKDIR_P = .././install-sh -c -d
MPICC =
MPILIBS =
MPIRUN =
NM = /usr/qnx641/host/qnx6/x86/usr/bin/nm -B
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OCAMLC =
OCAMLCFLAGS =
OCAMLDEFS =
OCAMLDEP =
OCAMLLDFLAGS =
OCAMLOPT =
OCAMLOPTCFLAGS =
OPENMP_CFLAGS =
OTOOL =
OTOOL64 =
PACKAGE = fftw
PACKAGE_BUGREPORT = fftw@fftw.org
PACKAGE_NAME = fftw
PACKAGE_STRING = fftw 3.2.2
PACKAGE_TARNAME = fftw
PACKAGE_VERSION = 3.2.2
PATH_SEPARATOR = :
POW_LIB =
PRECISION = d
PREC_SUFFIX =
PRTDIAG =
PTHREAD_CC =
PTHREAD_CFLAGS =
PTHREAD_LIBS =
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
SHARED_VERSION_INFO = 5:4:2
SHELL = /bin/sh
SIMD_CFLAGS =
STRIP = strip
TARGET_OCAMLBIN = /usr/local/bin
TARGET_OCAMLLIB = /usr/local/lib/fftw
TARGET_OCAMLRUN = /usr/local/bin/ocamlrun
THREADLIBS =
VERSION = 3.2.2
abs_builddir = /root/merged/ros6/fftw-3.2.2/m4
abs_srcdir = /root/merged/ros6/fftw-3.2.2/m4
abs_top_builddir = /root/merged/ros6/fftw-3.2.2
abs_top_srcdir = /root/merged/ros6/fftw-3.2.2
ac_ct_CC = gcc
ac_ct_DUMPBIN =
ac_ct_F77 =
acx_pthread_config =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i386-pc-nto-qnx6.4.1
build_alias =
build_cpu = i386
build_os = nto-qnx6.4.1
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = i386-pc-nto-qnx6.4.1
host_alias =
host_cpu = i386
host_os = nto-qnx6.4.1
host_vendor = pc
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = $(SHELL) /root/merged/ros6/fftw-3.2.2/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
lt_ECHO = print -r
mandir = ${datarootdir}/man
mkdir_p = $(top_builddir)/./install-sh -c -d
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
EXTRA_DIST = acx_mpi.m4 acx_pthread.m4 ax_cc_maxopt.m4		\
ax_check_compiler_flags.m4 ax_compiler_vendor.m4		\
ax_gcc_aligns_stack.m4 ax_gcc_archflag.m4 ax_gcc_version.m4	\
ax_gcc_x86_cpuid.m4 ax_openmp.m4 ocaml.m4

all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  m4/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  m4/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: # $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
tags: TAGS
TAGS:

ctags: CTAGS
CTAGS:

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am:

.MAKE: install-am install-strip

.PHONY: all all-am check check-am clean clean-generic clean-libtool \
	distclean distclean-generic distclean-libtool distdir dvi \
	dvi-am html html-am info info-am install install-am \
	install-data install-data-am install-dvi install-dvi-am \
	install-exec install-exec-am install-html install-html-am \
	install-info install-info-am install-man install-pdf \
	install-pdf-am install-ps install-ps-am install-strip \
	installcheck installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am

# libtool sticks a bunch of extra .m4 files in this directory,
# but they don't seem to be needed for the distributed tarball
# (they aren't needed for configure && make, and boostrapping
# will regenerate them anyway).
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:


text:
<?php

if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
	die('You cannot directly access the installer files.');
}

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

$thisStep = 0;

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

$requirements = array();
$numberOfRequirements = 5;
if(version_compare(phpversion(), '5.4.0', '>=')){
	$requirements[] = 'php_version';
}
if(function_exists('mysqli_connect')){
	$requirements[] = 'php_extension_mysqli';
}
if(session_status() != PHP_SESSION_DISABLED){
	$requirements[] = 'php_session_enabled';
}
if(file_exists('config') && is_dir('config')){
	$requirements[] = 'config_directory';
}
if(file_exists('config/config.php.example')){
	$requirements[] = 'config_example';
}

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

if(isset($_GET['go']) && $_GET['go'] == 'next'){
	if(count($requirements) === $numberOfRequirements){
		installer_message('All requirements fulfilled, let\'s get started with the installation!');

		installer_next($thisStep);
	}
}
?>
<?php echo installer_message(); ?>

Getting started

By following this wizard you will install and configure your new WebMUM installation.

System Info:

System: <?php echo php_uname(); ?>

Hostname: <?php echo isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'n/a'; ?>

IP: <?php echo isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : (isset($_SERVER['SERVER_NAME']) ? gethostbyname($_SERVER['SERVER_NAME']) : 'n/a'); ?>

PHP version: <?php echo phpversion(); ?>

Server API: <?php echo php_sapi_name(); ?>

WebMUM directory: <?php echo dirname($_SERVER['SCRIPT_FILENAME']); ?>

Server requirements

<?php if(in_array('php_version', $requirements)): ?>

PHP version (>=5.4.0 or >=7.0.0): <?php echo phpversion(); ?>  ✓

<?php else: ?>

PHP version (>=5.4.0 or >=7.0.0): <?php echo phpversion(); ?> ❌

<?php endif; ?>

Required PHP settings

<?php if(in_array('php_extension_mysqli', $requirements)): ?>

Database extension (mysqli): enabled ✓

<?php else: ?>

Database extension (mysqli): disabled ❌

<?php endif; ?>
<?php if(in_array('php_session_enabled', $requirements)): ?>

Session support: enabled ✓

<?php else: ?>

Session support: disabled ❌

<?php endif; ?>

Directories and files

<?php if(in_array('config_directory', $requirements)): ?>

"config/": exists ✓

<?php else: ?>

"config/": is missing ❌

<?php endif; ?>
<?php if(in_array('config_example', $requirements)): ?>

"config/config.php.example": exists ✓

<?php else: ?>

"config/config.php.example": is missing ❌

<?php endif; ?>

<?php if(count($requirements) === $numberOfRequirements):?>

Click on the Start button to continue.

	<a class="button button-primary" href="/?step=<?php echo $thisStep; ?>&go=next">Start
<?php else:?>

Some requirements aren't fulfilled.

<?php endif; ?>


text:
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

/** ------------------------------------------
 *  Route model binding
 *  ------------------------------------------
 */
Route::model('user', 'User');
Route::model('comment', 'Comment');
Route::model('post', 'Post');
Route::model('role', 'Role');

/** ------------------------------------------
 *  Route constraint patterns
 *  ------------------------------------------
 */
Route::pattern('comment', '[0-9]+');
Route::pattern('post', '[0-9]+');
Route::pattern('user', '[0-9]+');
Route::pattern('role', '[0-9]+');
Route::pattern('token', '[0-9a-z]+');

/** ------------------------------------------
 *  Frontend Routes
 *  ------------------------------------------
 */
//:: Application Routes ::

# Index Page - Last route, no matches
// Route::get('ajax', array('before' => 'detectLang','uses' => 'BaseController@getAjax', 'as' => 'getAjax'));

Route::get('/', array('before' => 'detectLang','uses' => 'CoreController@index', 'as' => 'home'));

# Posts - Second to last set, match slug
Route::get('{postSlug}', 'BlogController@getView');
Route::post('{postSlug}', 'BlogController@postView');


text:
class CreateProjects < ActiveRecord::Migration
  def change
    create_table :projects do |t|
      t.integer :vendor_id
      t.integer :user_id
      t.string :services_ids
      t.string :name
      t.boolean :status, :default => false, :null => false

      t.timestamps
    end
  end
end


text:
package com.graphhopper.util;

import java.util.List;

public class Instruction
{
    private static final AngleCalc ac = new AngleCalc();
    public static final int TURN_SHARP_LEFT = -3;
    public static final int TURN_LEFT = -2;
    public static final int TURN_SLIGHT_LEFT = -1;
    public static final int CONTINUE_ON_STREET = 0;
    public static final int TURN_SLIGHT_RIGHT = 1;
    public static final int TURN_RIGHT = 2;
    public static final int TURN_SHARP_RIGHT = 3;
    public static final int FINISH = 4;
    public static final int REACHED_VIA = 5;
    protected int sign;
    private final String name;
    private double distance;
    private long time;
    final PointList points;
    private final InstructionAnnotation annotation;

    /**
     * The points, distances and times have exactly the same count. The last point of this
     * instruction is not duplicated here and should be in the next one.
     */
    public Instruction( int sign, String name, InstructionAnnotation ia, PointList pl )
    {
        this.sign = sign;
        this.name = name;
        this.points = pl;
        this.annotation = ia;
    }

    public InstructionAnnotation getAnnotation()
    {
        return annotation;
    }

    public int getSign()
    {
        return sign;
    }

    /**
     * The instruction for the person/driver to execute.
     */
    public String getName()
    {
        return name;
    }

    public Instruction setDistance( double distance )
    {
        this.distance = distance;
        return this;
    }

    /**
     * Distance in meter until no new instruction
     */
    public double getDistance()
    {
        return distance;
    }

    public Instruction setTime( long time )
    {
        this.time = time;
        return this;
    }

    /**
     * Time in time until no new instruction
     */
    public long getTime()
    {
        return time;
    }

    /**
     * Latitude of the location where this instruction should take place.
     */
    double getFirstLat()
    {
        return points.getLatitude(0);
    }

    /**
     * Longitude of the location where this instruction should take place.
     */
    double getFirstLon()
    {
        return points.getLongitude(0);
    }

    double getFirstEle()
    {
        return points.getElevation(0);
    }

    public PointList getPoints()
    {
        return points;
    }

    /**
     * This method returns a list of gpx entries where the time (in time) is relative to the first
     * which is 0. It does NOT contain the last point which is the first of the next instruction.
     * <p>
     * @return the time offset to add for the next instruction
     */
    long fillGPXList( List<GPXEntry> list, long time,
            Instruction prevInstr, Instruction nextInstr, boolean firstInstr )
    {
        checkOne();
        int len = points.size();
        long prevTime = time;
        double lat = points.getLatitude(0);
        double lon = points.getLongitude(0);
        double ele = Double.NaN;
        boolean is3D = points.is3D();
        if (is3D)
            ele = points.getElevation(0);

        for (int i = 0; i < len; i++)
        {
            list.add(new GPXEntry(lat, lon, ele, prevTime));

            boolean last = i + 1 == len;
            double nextLat = last ? nextInstr.getFirstLat() : points.getLatitude(i + 1);
            double nextLon = last ? nextInstr.getFirstLon() : points.getLongitude(i + 1);
            double nextEle = is3D ? (last ? nextInstr.getFirstEle() : points.getElevation(i + 1)) : Double.NaN;
            if (is3D)
                prevTime = Math.round(prevTime + this.time * Helper.DIST_3D.calcDist(nextLat, nextLon, nextEle, lat, lon, ele) / distance);
            else
                prevTime = Math.round(prevTime + this.time * Helper.DIST_3D.calcDist(nextLat, nextLon, lat, lon) / distance);

            lat = nextLat;
            lon = nextLon;
            ele = nextEle;
        }
        return time + this.time;
    }

    @Override
    public String toString()
    {
        StringBuilder sb = new StringBuilder();
        sb.append('(');
        sb.append(sign).append(',');
        sb.append(name).append(',');
        sb.append(distance).append(',');
        sb.append(time);
        sb.append(')');
        return sb.toString();
    }

    /**
     * Return the direction like 'NE' based on the first tracksegment of the instruction. If
     * Instruction does not contain enough coordinate points, an empty string will be returned.
     */
    String calcDirection( Instruction nextI )
    {
        double azimuth = calcAzimuth(nextI);
        if (Double.isNaN(azimuth))
            return "";

        return ac.azimuth2compassPoint(azimuth);
    }

    /**
     * Return the azimuth in degree based on the first tracksegment of the instruction. If
     * Instruction does not contain enough coordinate points, an empty string will be returned.
     */
    public double calcAzimuth( Instruction nextI )
    {
        double nextLat;
        double nextLon;

        if (points.getSize() >= 2)
        {
            nextLat = points.getLatitude(1);
            nextLon = points.getLongitude(1);
        } else if (nextI != null && points.getSize() == 1)
        {
            nextLat = nextI.points.getLatitude(0);
            nextLon = nextI.points.getLongitude(0);
        } else
        {
            return Double.NaN;
        }

        double lat = points.getLatitude(0);
        double lon = points.getLongitude(0);
        return ac.calcAzimuth(lat, lon, nextLat, nextLon);
    }

    void checkOne()
    {
        if (points.size() < 1)
            throw new IllegalStateException("Instruction must contain at least one point " + toString());
    }

    public String getTurnDescription( Translation tr )
    {
        String str;
        String n = getName();
        int indi = getSign();
        if (indi == Instruction.FINISH)
        {
            str = tr.tr("finish");
        } else if (indi == Instruction.REACHED_VIA)
        {
            str = tr.tr("stopover", ((FinishInstruction) this).getViaPosition());
        } else if (indi == Instruction.CONTINUE_ON_STREET)
        {
            str = Helper.isEmpty(n) ? tr.tr("continue") : tr.tr("continue_onto", n);
        } else
        {
            String dir = null;
            switch (indi)
            {
                case Instruction.TURN_SHARP_LEFT:
                    dir = tr.tr("sharp_left");
                    break;
                case Instruction.TURN_LEFT:
                    dir = tr.tr("left");
                    break;
                case Instruction.TURN_SLIGHT_LEFT:
                    dir = tr.tr("slight_left");
                    break;
                case Instruction.TURN_SLIGHT_RIGHT:
                    dir = tr.tr("slight_right");
                    break;
                case Instruction.TURN_RIGHT:
                    dir = tr.tr("right");
                    break;
                case Instruction.TURN_SHARP_RIGHT:
                    dir = tr.tr("sharp_right");
                    break;
            }
            if (dir == null)
                throw new IllegalStateException("Indication not found " + indi);

            str = Helper.isEmpty(n) ? tr.tr("turn", dir) : tr.tr("turn_onto", dir, n);
        }
        return str;
    }
}


text:
__author__ = 'Neil Butcher'

from widget_population import PopulationWidget


text:
package cz.benky.webdav.service;

import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
import cz.benky.webdav.dao.CassandraDao;
import cz.benky.webdav.util.PathUtils;

import java.util.List;
import java.util.UUID;

public class CassandraService {
    private final CassandraDao cassandraDao;

    public CassandraService(final CassandraDao cassandraDao) {
        this.cassandraDao = cassandraDao;
    }

    public List<String> getSiblings(final String path) {
        return cassandraDao.getSiblings(path);
    }

    public void createDirectory(final String path) {
        cassandraDao.createDirectory(path);
    }

    public boolean resourceExists(final String path) {
        return cassandraDao.resourceExists(path);
    }

    public UUID getFile(final String localPath) {
        return cassandraDao.getFile(localPath);
    }

    public boolean isFile(final String localPath) {
        return cassandraDao.isFile(localPath);
    }

    public void deleteDirectory(final String path) {
        final String parentDirectory = PathUtils.getParentDirectory(path);
        final UUID file = cassandraDao.getFile(path);
        final UUID parent = cassandraDao.getFile(parentDirectory);
        final String fileName = PathUtils.getFileName(path);

        try {
            cassandraDao.deleteFromDirectory(parent, fileName);
            cassandraDao.deleteFromDirectory(file, ".");
        } catch (ConnectionException e) {
            throw new RuntimeException(e);
        }
    }
}


text:
'use strict';

describe('Drug Factory', function() {

    it('should convert simple drug one example to drug instance', function() {
        var drug_factory = new DrugFactory();
        var json = {
            id: 'example_drug_one',
            name: 'Drug One',
            description: 'Description of a Drug One',
            dose: {
                type: 'simple',
                a: 1,
                b: 2
            }
        };
        var drug = drug_factory.getDrugFromJson(json);
        expect(drug.getName()).toEqual('Drug One');
        expect(drug.getDescription()).toEqual('Description of a Drug One');
        expect(drug.getType()).toEqual('simple');
        expect(drug.getParameters().getAMin()).toEqual(1);
        expect(drug.getParameters().getAMax()).toEqual(1);
        expect(drug.getParameters().getB()).toEqual(2);
    });

    it('should convert simple drug two example to drug instance', function() {
        var drug_factory = new DrugFactory();
        var json = {
            id: 'example_drug_two',
            name: 'Drug Two',
            description: 'Description of a Drug Two',
            dose: {
                type: 'simple',
                a: [0.5, 0.6],
                b: 10
            }
        };
        var drug = drug_factory.getDrugFromJson(json);
        expect(drug.getName()).toEqual('Drug Two');
        expect(drug.getDescription()).toEqual('Description of a Drug Two');
        expect(drug.getType()).toEqual('simple');
        expect(drug.getParameters().getAMin()).toEqual(0.5);
        expect(drug.getParameters().getAMax()).toEqual(0.6);
        expect(drug.getParameters().getB()).toEqual(10);
    });

    it('should convert complex drug three example to drug instance', function() {
        var drug_factory = new DrugFactory();
        var json = {
            id: 'example_drug_three',
            name: 'Drug Three',
            description: 'Description of a Drug Three',
            dose: {
                type: 'complex',
                ranges: [12, 13, 14, 15],
                doses: [0.5, 1, 1.25, 1.30]
            }
        };
        var drug = drug_factory.getDrugFromJson(json);
        expect(drug.getName()).toEqual('Drug Three');
        expect(drug.getDescription()).toEqual('Description of a Drug Three');
        expect(drug.getType()).toEqual('complex');
        expect(drug.getParameters().getRanges()).toEqual([12, 13, 14, 15]);
        expect(drug.getParameters().getDoses()).toEqual([0.5, 1, 1.25, 1.30]);
    });

});


text:
#pragma once
#include <aws/translate/Translate_EXPORTS.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSClient.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/translate/TranslateServiceClientModel.h>

namespace Aws
{
namespace Translate
{
  /**
   *
Provides language translation for input text in the source language to the
   * specified target language.

   */
  class AWS_TRANSLATE_API TranslateClient : public Aws::Client::AWSJsonClient
  {
    public:
      typedef Aws::Client::AWSJsonClient BASECLASS;
      static const char* SERVICE_NAME;
      static const char* ALLOCATION_TAG;

       /**
        * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        TranslateClient(const Aws::Translate::TranslateClientConfiguration& clientConfiguration = Aws::Translate::TranslateClientConfiguration(),
                        std::shared_ptr<TranslateEndpointProviderBase> endpointProvider = Aws::MakeShared<TranslateEndpointProvider>(ALLOCATION_TAG));

       /**
        * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        TranslateClient(const Aws::Auth::AWSCredentials& credentials,
                        std::shared_ptr<TranslateEndpointProviderBase> endpointProvider = Aws::MakeShared<TranslateEndpointProvider>(ALLOCATION_TAG),
                        const Aws::Translate::TranslateClientConfiguration& clientConfiguration = Aws::Translate::TranslateClientConfiguration());

       /**
        * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
        * the default http client factory will be used
        */
        TranslateClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
                        std::shared_ptr<TranslateEndpointProviderBase> endpointProvider = Aws::MakeShared<TranslateEndpointProvider>(ALLOCATION_TAG),
                        const Aws::Translate::TranslateClientConfiguration& clientConfiguration = Aws::Translate::TranslateClientConfiguration());

        /* Legacy constructors due deprecation */
       /**
        * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        TranslateClient(const Aws::Client::ClientConfiguration& clientConfiguration);

       /**
        * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
        * is not specified, it will be initialized to default values.
        */
        TranslateClient(const Aws::Auth::AWSCredentials& credentials,
                        const Aws::Client::ClientConfiguration& clientConfiguration);

       /**
        * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
        * the default http client factory will be used
        */
        TranslateClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
                        const Aws::Client::ClientConfiguration& clientConfiguration);

        /* End of legacy constructors due deprecation */
        virtual ~TranslateClient();

        /**
         *
Creates a parallel data resource in Amazon Translate by importing an input
         * file from Amazon S3. Parallel data files contain examples that show how you want
         * segments of text to be translated. By adding parallel data, you can influence
         * the style, tone, and word choice in your translation output.

See
         * Also:
   AWS
         * API Reference

         */
        virtual Model::CreateParallelDataOutcome CreateParallelData(const Model::CreateParallelDataRequest& request) const;

        /**
         * A Callable wrapper for CreateParallelData that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::CreateParallelDataOutcomeCallable CreateParallelDataCallable(const Model::CreateParallelDataRequest& request) const;

        /**
         * An Async wrapper for CreateParallelData that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void CreateParallelDataAsync(const Model::CreateParallelDataRequest& request, const CreateParallelDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Deletes a parallel data resource in Amazon Translate.

See
         * Also:
   AWS
         * API Reference

         */
        virtual Model::DeleteParallelDataOutcome DeleteParallelData(const Model::DeleteParallelDataRequest& request) const;

        /**
         * A Callable wrapper for DeleteParallelData that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::DeleteParallelDataOutcomeCallable DeleteParallelDataCallable(const Model::DeleteParallelDataRequest& request) const;

        /**
         * An Async wrapper for DeleteParallelData that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void DeleteParallelDataAsync(const Model::DeleteParallelDataRequest& request, const DeleteParallelDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
A synchronous action that deletes a custom terminology.

See
         * Also:
   AWS
         * API Reference

         */
        virtual Model::DeleteTerminologyOutcome DeleteTerminology(const Model::DeleteTerminologyRequest& request) const;

        /**
         * A Callable wrapper for DeleteTerminology that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::DeleteTerminologyOutcomeCallable DeleteTerminologyCallable(const Model::DeleteTerminologyRequest& request) const;

        /**
         * An Async wrapper for DeleteTerminology that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void DeleteTerminologyAsync(const Model::DeleteTerminologyRequest& request, const DeleteTerminologyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Gets the properties associated with an asynchronous batch translation job
         * including name, ID, status, source and target languages, input/output S3
         * buckets, and so on.

See Also:
   AWS
         * API Reference

         */
        virtual Model::DescribeTextTranslationJobOutcome DescribeTextTranslationJob(const Model::DescribeTextTranslationJobRequest& request) const;

        /**
         * A Callable wrapper for DescribeTextTranslationJob that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::DescribeTextTranslationJobOutcomeCallable DescribeTextTranslationJobCallable(const Model::DescribeTextTranslationJobRequest& request) const;

        /**
         * An Async wrapper for DescribeTextTranslationJob that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void DescribeTextTranslationJobAsync(const Model::DescribeTextTranslationJobRequest& request, const DescribeTextTranslationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Provides information about a parallel data resource.

See Also:

         * AWS
         * API Reference

         */
        virtual Model::GetParallelDataOutcome GetParallelData(const Model::GetParallelDataRequest& request) const;

        /**
         * A Callable wrapper for GetParallelData that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::GetParallelDataOutcomeCallable GetParallelDataCallable(const Model::GetParallelDataRequest& request) const;

        /**
         * An Async wrapper for GetParallelData that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void GetParallelDataAsync(const Model::GetParallelDataRequest& request, const GetParallelDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Retrieves a custom terminology.

See Also:
   AWS
         * API Reference

         */
        virtual Model::GetTerminologyOutcome GetTerminology(const Model::GetTerminologyRequest& request) const;

        /**
         * A Callable wrapper for GetTerminology that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::GetTerminologyOutcomeCallable GetTerminologyCallable(const Model::GetTerminologyRequest& request) const;

        /**
         * An Async wrapper for GetTerminology that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void GetTerminologyAsync(const Model::GetTerminologyRequest& request, const GetTerminologyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Creates or updates a custom terminology, depending on whether one already
         * exists for the given terminology name. Importing a terminology with the same
         * name as an existing one will merge the terminologies based on the chosen merge
         * strategy. The only supported merge strategy is OVERWRITE, where the imported
         * terminology overwrites the existing terminology of the same name.

If you
         * import a terminology that overwrites an existing one, the new terminology takes
         * up to 10 minutes to fully propagate. After that, translations have access to the
         * new terminology.

See Also:
   AWS
         * API Reference

         */
        virtual Model::ImportTerminologyOutcome ImportTerminology(const Model::ImportTerminologyRequest& request) const;

        /**
         * A Callable wrapper for ImportTerminology that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ImportTerminologyOutcomeCallable ImportTerminologyCallable(const Model::ImportTerminologyRequest& request) const;

        /**
         * An Async wrapper for ImportTerminology that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ImportTerminologyAsync(const Model::ImportTerminologyRequest& request, const ImportTerminologyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Provides a list of languages (RFC-5646 codes and names) that Amazon Translate
         * supports.

See Also:
   AWS
         * API Reference

         */
        virtual Model::ListLanguagesOutcome ListLanguages(const Model::ListLanguagesRequest& request) const;

        /**
         * A Callable wrapper for ListLanguages that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListLanguagesOutcomeCallable ListLanguagesCallable(const Model::ListLanguagesRequest& request) const;

        /**
         * An Async wrapper for ListLanguages that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListLanguagesAsync(const Model::ListLanguagesRequest& request, const ListLanguagesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Provides a list of your parallel data resources in Amazon
         * Translate.

See Also:
   AWS
         * API Reference

         */
        virtual Model::ListParallelDataOutcome ListParallelData(const Model::ListParallelDataRequest& request) const;

        /**
         * A Callable wrapper for ListParallelData that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListParallelDataOutcomeCallable ListParallelDataCallable(const Model::ListParallelDataRequest& request) const;

        /**
         * An Async wrapper for ListParallelData that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListParallelDataAsync(const Model::ListParallelDataRequest& request, const ListParallelDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Lists all tags associated with a given Amazon Translate resource. For more
         * information, see  Tagging
         * your resources.

See Also:
   AWS
         * API Reference

         */
        virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const;

        /**
         * A Callable wrapper for ListTagsForResource that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const Model::ListTagsForResourceRequest& request) const;

        /**
         * An Async wrapper for ListTagsForResource that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListTagsForResourceAsync(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Provides a list of custom terminologies associated with your
         * account.

See Also:
   AWS
         * API Reference

         */
        virtual Model::ListTerminologiesOutcome ListTerminologies(const Model::ListTerminologiesRequest& request) const;

        /**
         * A Callable wrapper for ListTerminologies that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListTerminologiesOutcomeCallable ListTerminologiesCallable(const Model::ListTerminologiesRequest& request) const;

        /**
         * An Async wrapper for ListTerminologies that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListTerminologiesAsync(const Model::ListTerminologiesRequest& request, const ListTerminologiesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Gets a list of the batch translation jobs that you have
         * submitted.

See Also:
   AWS
         * API Reference

         */
        virtual Model::ListTextTranslationJobsOutcome ListTextTranslationJobs(const Model::ListTextTranslationJobsRequest& request) const;

        /**
         * A Callable wrapper for ListTextTranslationJobs that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::ListTextTranslationJobsOutcomeCallable ListTextTranslationJobsCallable(const Model::ListTextTranslationJobsRequest& request) const;

        /**
         * An Async wrapper for ListTextTranslationJobs that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void ListTextTranslationJobsAsync(const Model::ListTextTranslationJobsRequest& request, const ListTextTranslationJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Starts an asynchronous batch translation job. Use batch translation jobs to
         * translate large volumes of text across multiple documents at once. For batch
         * translation, the input documents must share the same source language. You can
         * specify one or more target languages. Batch translation translates each input
         * document into each of the target languages. For more information, see Asynchronous
         * batch processing

Batch translation jobs can be described with the
         * DescribeTextTranslationJob operation, listed with the
         * ListTextTranslationJobs operation, and stopped with the
         * StopTextTranslationJob operation.

Amazon Translate does not
         * support batch translation of multiple source languages at once.

         *

See Also:
   AWS
         * API Reference

         */
        virtual Model::StartTextTranslationJobOutcome StartTextTranslationJob(const Model::StartTextTranslationJobRequest& request) const;

        /**
         * A Callable wrapper for StartTextTranslationJob that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::StartTextTranslationJobOutcomeCallable StartTextTranslationJobCallable(const Model::StartTextTranslationJobRequest& request) const;

        /**
         * An Async wrapper for StartTextTranslationJob that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void StartTextTranslationJobAsync(const Model::StartTextTranslationJobRequest& request, const StartTextTranslationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Stops an asynchronous batch translation job that is in progress.

If
         * the job's state is IN_PROGRESS, the job will be marked for
         * termination and put into the STOP_REQUESTED state. If the job
         * completes before it can be stopped, it is put into the COMPLETED
         * state. Otherwise, the job is put into the STOPPED state.

         *
Asynchronous batch translation jobs are started with the
         * StartTextTranslationJob operation. You can use the
         * DescribeTextTranslationJob or ListTextTranslationJobs operations
         * to get a batch translation job's JobId.

See Also:

         * AWS
         * API Reference

         */
        virtual Model::StopTextTranslationJobOutcome StopTextTranslationJob(const Model::StopTextTranslationJobRequest& request) const;

        /**
         * A Callable wrapper for StopTextTranslationJob that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::StopTextTranslationJobOutcomeCallable StopTextTranslationJobCallable(const Model::StopTextTranslationJobRequest& request) const;

        /**
         * An Async wrapper for StopTextTranslationJob that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void StopTextTranslationJobAsync(const Model::StopTextTranslationJobRequest& request, const StopTextTranslationJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Associates a specific tag with a resource. A tag is a key-value pair that
         * adds as a metadata to a resource. For more information, see  Tagging
         * your resources.

See Also:
   AWS
         * API Reference

         */
        virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const;

        /**
         * A Callable wrapper for TagResource that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::TagResourceOutcomeCallable TagResourceCallable(const Model::TagResourceRequest& request) const;

        /**
         * An Async wrapper for TagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void TagResourceAsync(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Translates input text from the source language to the target language. For a
         * list of available languages and language codes, see Supported
         * languages.

See Also:
   AWS
         * API Reference

         */
        virtual Model::TranslateTextOutcome TranslateText(const Model::TranslateTextRequest& request) const;

        /**
         * A Callable wrapper for TranslateText that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::TranslateTextOutcomeCallable TranslateTextCallable(const Model::TranslateTextRequest& request) const;

        /**
         * An Async wrapper for TranslateText that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void TranslateTextAsync(const Model::TranslateTextRequest& request, const TranslateTextResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Removes a specific tag associated with an Amazon Translate resource. For more
         * information, see  Tagging
         * your resources.

See Also:
   AWS
         * API Reference

         */
        virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const;

        /**
         * A Callable wrapper for UntagResource that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::UntagResourceOutcomeCallable UntagResourceCallable(const Model::UntagResourceRequest& request) const;

        /**
         * An Async wrapper for UntagResource that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void UntagResourceAsync(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

        /**
         *
Updates a previously created parallel data resource by importing a new input
         * file from Amazon S3.

See Also:
   AWS
         * API Reference

         */
        virtual Model::UpdateParallelDataOutcome UpdateParallelData(const Model::UpdateParallelDataRequest& request) const;

        /**
         * A Callable wrapper for UpdateParallelData that returns a future to the operation so that it can be executed in parallel to other requests.
         */
        virtual Model::UpdateParallelDataOutcomeCallable UpdateParallelDataCallable(const Model::UpdateParallelDataRequest& request) const;

        /**
         * An Async wrapper for UpdateParallelData that queues the request into a thread executor and triggers associated callback when operation has finished.
         */
        virtual void UpdateParallelDataAsync(const Model::UpdateParallelDataRequest& request, const UpdateParallelDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;

      void OverrideEndpoint(const Aws::String& endpoint);
      std::shared_ptr<TranslateEndpointProviderBase>& accessEndpointProvider();
    private:
      void init(const TranslateClientConfiguration& clientConfiguration);

      TranslateClientConfiguration m_clientConfiguration;
      std::shared_ptr<Aws::Utils::Threading::Executor> m_executor;
      std::shared_ptr<TranslateEndpointProviderBase> m_endpointProvider;
  };

} // namespace Translate
} // namespace Aws


text:
package com.mpush.common.message;

import com.mpush.api.connection.Connection;
import com.mpush.api.protocol.Packet;
import com.mpush.common.ErrorCode;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelFutureListener;

import java.util.HashMap;
import java.util.Map;

import static com.mpush.api.protocol.Command.ERROR;

/**
 * Created by ohun on 2015/12/28.
 *
 * @author ohun@live.cn
 */
public final class ErrorMessage extends ByteBufMessage {
    public byte cmd;
    public byte code;
    public String reason;
    public String data;

    public ErrorMessage(byte cmd, Packet message, Connection connection) {
        super(message, connection);
        this.cmd = cmd;
    }

    public ErrorMessage(Packet message, Connection connection) {
        super(message, connection);
    }

    @Override
    public void decode(ByteBuf body) {
        cmd = decodeByte(body);
        code = decodeByte(body);
        reason = decodeString(body);
        data = decodeString(body);
    }

    @Override
    public void encode(ByteBuf body) {
        encodeByte(body, cmd);
        encodeByte(body, code);
        encodeString(body, reason);
        encodeString(body, data);
    }

    @Override
    protected Map<String, Object> encodeJsonBody() {
        Map<String, Object> body = new HashMap<>(4);
        if (cmd > 0) body.put("cmd", cmd);
        if (code > 0) body.put("code", code);
        if (reason != null) body.put("reason", reason);
        if (data != null) body.put("data", data);
        return body;
    }

    public static ErrorMessage from(BaseMessage src) {
        return new ErrorMessage(src.packet.cmd, src.packet.response(ERROR), src.connection);
    }

    public static ErrorMessage from(Packet src, Connection connection) {
        return new ErrorMessage(src.cmd, src.response(ERROR), connection);
    }

    public ErrorMessage setReason(String reason) {
        this.reason = reason;
        return this;
    }

    public ErrorMessage setData(String data) {
        this.data = data;
        return this;
    }

    public ErrorMessage setErrorCode(ErrorCode code) {
        this.code = code.errorCode;
        this.reason = code.errorMsg;
        return this;
    }

    @Override
    public void send() {
        super.sendRaw();
    }

    @Override
    public void close() {
        sendRaw(ChannelFutureListener.CLOSE);
    }

    @Override
    public String toString() {
        return "ErrorMessage{" +
                "reason='" + reason + '\'' +
                ", code=" + code +
                ", data=" + data +
                ", packet=" + packet +
                '}';
    }
}


text:
using System;
using System.Diagnostics;

namespace Moonlit
{
    /// <summary>
    /// 通用参数
    /// </summary>
    /// <typeparam name="T"></typeparam>
    [DebuggerStepThrough]
    public class EventArgs<T> : EventArgs
    {
        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        public T Value { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="EventArgs<T>"/> class.
        /// </summary>
        /// <param name="value">The value.</param>
        public EventArgs(T value)
        {
            this.Value = value;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="EventArgs<T>"/> class.
        /// </summary>
        public EventArgs()
        {

        }
    }
}