text:
namespace {
constexpr char kPostMessage[] = "postMessage";
constexpr char kOnMessage[] = "onmessage";
constexpr char kAddEventListener[] = "addEventListener";
constexpr char kRemoveEventListener[] = "removeEventListener";
}  // anonymous namespace

namespace js_injection {

gin::WrapperInfo JsBinding::kWrapperInfo = {gin::kEmbedderNativeGin};

// static
base::WeakPtr<JsBinding> JsBinding::Install(
    content::RenderFrame* render_frame,
    const std::u16string& js_object_name,
    base::WeakPtr<JsCommunication> js_communication) {
  CHECK(!js_object_name.empty())
      << "JavaScript wrapper name shouldn't be empty";

  v8::Isolate* isolate = blink::MainThreadIsolate();
  v8::HandleScope handle_scope(isolate);
  v8::Local<v8::Context> context =
      render_frame->GetWebFrame()->MainWorldScriptContext();
  if (context.IsEmpty())
    return nullptr;

  v8::Context::Scope context_scope(context);
  // The call to CreateHandle() takes ownership of `js_binding` (but only on
  // success).
  JsBinding* js_binding =
      new JsBinding(render_frame, js_object_name, js_communication);
  gin::Handle<JsBinding> bindings = gin::CreateHandle(isolate, js_binding);
  if (bindings.IsEmpty()) {
    delete js_binding;
    return nullptr;
  }

  v8::Local<v8::Object> global = context->Global();
  global
      ->CreateDataProperty(context,
                           gin::StringToSymbol(isolate, js_object_name),
                           bindings.ToV8())
      .Check();

  return js_binding->weak_ptr_factory_.GetWeakPtr();
}

JsBinding::JsBinding(content::RenderFrame* render_frame,
                     const std::u16string& js_object_name,
                     base::WeakPtr<JsCommunication> js_communication)
    : render_frame_(render_frame),
      js_object_name_(js_object_name),
      js_communication_(js_communication) {
  mojom::JsToBrowserMessaging* js_to_java_messaging =
      js_communication_->GetJsToJavaMessage(js_object_name_);
  if (js_to_java_messaging) {
    js_to_java_messaging->SetBrowserToJsMessaging(
        receiver_.BindNewEndpointAndPassRemote());
  }
}

JsBinding::~JsBinding() = default;

void JsBinding::OnPostMessage(mojom::JsWebMessagePtr message) {
  // If `js_communication_` is null, this object will soon be destroyed.
  if (!js_communication_)
    return;

  v8::Isolate* isolate = blink::MainThreadIsolate();
  v8::HandleScope handle_scope(isolate);

  blink::WebLocalFrame* web_frame = render_frame_->GetWebFrame();
  if (!web_frame)
    return;

  v8::Local<v8::Context> context = web_frame->MainWorldScriptContext();
  if (context.IsEmpty())
    return;

  v8::Context::Scope context_scope(context);
  // Setting verbose makes the exception get reported to the default
  // uncaught-exception handlers, rather than just being silently swallowed.
  v8::TryCatch try_catch(isolate);
  try_catch.SetVerbose(true);

  // Simulate MessageEvent's data property. See
  // https://html.spec.whatwg.org/multipage/comms.html#messageevent
  v8::Local<v8::Object> event =
      gin::DataObjectBuilder(isolate)
          .Set("data", std::move(message->get_string_value()))
          .Build();
  v8::Local<v8::Value> argv[] = {event};

  v8::Local<v8::Object> self = GetWrapper(isolate).ToLocalChecked();
  v8::Local<v8::Function> on_message = GetOnMessage(isolate);
  if (!on_message.IsEmpty()) {
    web_frame->RequestExecuteV8Function(context, on_message, self, 1, argv, {});
  }

  // Copy the listeners so that if the listener modifies the list in some way
  // there isn't a UAF.
  std::vector<v8::Local<v8::Function>> listeners_copy;
  listeners_copy.reserve(listeners_.size());
  for (const auto& listener : listeners_) {
    listeners_copy.push_back(listener.Get(isolate));
  }
  for (const auto& listener : listeners_copy) {
    // Ensure the listener is still registered.
    if (base::Contains(listeners_, listener)) {
      web_frame->RequestExecuteV8Function(context, listener, self, 1, argv, {});
    }
  }
}

void JsBinding::ReleaseV8GlobalObjects() {
  listeners_.clear();
  on_message_.Reset();
}

gin::ObjectTemplateBuilder JsBinding::GetObjectTemplateBuilder(
    v8::Isolate* isolate) {
  return gin::Wrappable<JsBinding>::GetObjectTemplateBuilder(isolate)
      .SetMethod(kPostMessage, &JsBinding::PostMessage)
      .SetMethod(kAddEventListener, &JsBinding::AddEventListener)
      .SetMethod(kRemoveEventListener, &JsBinding::RemoveEventListener)
      .SetProperty(kOnMessage, &JsBinding::GetOnMessage,
                   &JsBinding::SetOnMessage);
}

void JsBinding::PostMessage(gin::Arguments* args) {
  std::u16string message;
  if (!args->GetNext(&message)) {
    args->ThrowError();
    return;
  }

  std::vector<blink::MessagePortChannel> ports;
  std::vector<v8::Local<v8::Object>> objs;
  // If we get more than two arguments and the second argument is not an array
  // of ports, we can't process.
  if (args->Length() >= 2 && !args->GetNext(&objs)) {
    args->ThrowError();
    return;
  }

  for (auto& obj : objs) {
    absl::optional<blink::MessagePortChannel> port =
        blink::WebMessagePortConverter::DisentangleAndExtractMessagePortChannel(
            args->isolate(), obj);
    // If the port is null we should throw an exception.
    if (!port.has_value()) {
      args->ThrowError();
      return;
    }
    ports.emplace_back(port.value());
  }

  mojom::JsToBrowserMessaging* js_to_java_messaging =
      js_communication_ ? js_communication_->GetJsToJavaMessage(js_object_name_)
                        : nullptr;
  if (js_to_java_messaging) {
    js_to_java_messaging->PostMessage(
        mojom::JsWebMessage::NewStringValue(std::move(message)),
        blink::MessagePortChannel::ReleaseHandles(ports));
  }
}

// AddEventListener() needs to match EventTarget's AddEventListener() in blink.
// It takes |type|, |listener| parameters, we ignore the |options| parameter.
// See https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener
void JsBinding::AddEventListener(gin::Arguments* args) {
  std::string type;
  if (!args->GetNext(&type)) {
    args->ThrowError();
    return;
  }

  // We only support message event.
  if (type != "message")
    return;

  v8::Local<v8::Function> listener;
  if (!args->GetNext(&listener))
    return;

  // Should be at most 3 parameters.
  if (args->Length() > 3) {
    args->ThrowError();
    return;
  }

  if (base::Contains(listeners_, listener))
    return;

  v8::Local<v8::Context> context = args->GetHolderCreationContext();
  listeners_.push_back(
      v8::Global<v8::Function>(context->GetIsolate(), listener));
}

// RemoveEventListener() needs to match EventTarget's RemoveEventListener() in
// blink. It takes |type|, |listener| parameters, we ignore |options| parameter.
// See https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener
void JsBinding::RemoveEventListener(gin::Arguments* args) {
  std::string type;
  if (!args->GetNext(&type)) {
    args->ThrowError();
    return;
  }

  // We only support message event.
  if (type != "message")
    return;

  v8::Local<v8::Function> listener;
  if (!args->GetNext(&listener))
    return;

  // Should be at most 3 parameters.
  if (args->Length() > 3) {
    args->ThrowError();
    return;
  }

  auto iter = base::ranges::find(listeners_, listener);
  if (iter == listeners_.end())
    return;

  listeners_.erase(iter);
}

v8::Local<v8::Function> JsBinding::GetOnMessage(v8::Isolate* isolate) {
  return on_message_.Get(isolate);
}

void JsBinding::SetOnMessage(v8::Isolate* isolate, v8::Local<v8::Value> value) {
  if (value->IsFunction())
    on_message_.Reset(isolate, value.As<v8::Function>());
  else
    on_message_.Reset();
}

}  // namespace js_injection


text:
package org.openkilda.testing.service.otsdb.model;

public enum Aggregator {
    MIN, MAX, SUM, AVG, MULT, DEV;

    @Override
    public String toString() {
        return this.name().toLowerCase();
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace process {

// Forward declarations.
class ProcessBase;

class Clock
{
public:
  static double now();
  static double now(ProcessBase* process);
  static void pause();
  static bool paused();
  static void resume();
  static void advance(double secs);
  static void advance(ProcessBase* process, double secs);
  static void update(double secs);
  static void update(ProcessBase* process, double secs);
  static void order(ProcessBase* from, ProcessBase* to);
  static void settle();
};

} // namespace process {

#endif // __PROCESS_CLOCK_HPP__


text:
<?php

// Heading
$_['lang_heading_title']      = 'Bank Transfer';

// Text
$_['lang_text_payment']       = 'Payment';
$_['lang_text_success']       = 'Success: You have modified bank transfer details.';

// Entry
$_['lang_entry_bank']         = 'Bank Transfer Instructions:';
$_['lang_entry_total']        = 'Total:
The checkout total the order must reach before this payment method becomes active.';
$_['lang_entry_order_status'] = 'Order Status:';
$_['lang_entry_geo_zone']     = 'Geo Zone:';
$_['lang_entry_status']       = 'Status:';
$_['lang_entry_sort_order']   = 'Sort Order:';

// Error
$_['lang_error_permission']   = 'Warning: You do not have permission to modify payment bank transfer.';
$_['lang_error_bank']         = 'Bank Transfer Instructions Required.';


text:
var app = require('./app')
  , repl = require('repl')
  , context = repl.start('blog> ').context

context.app = app
context.db = app.db


text:
require 'test_helper'

module PushType
  class TimeFieldTest < ActiveSupport::TestCase

    class TestPage < PushType::Node
      field :foo, :time
    end

    let(:node)  { TestPage.create FactoryBot.attributes_for(:node, foo: val) }
    let(:val)   { '15:00' }
    let(:field) { node.fields[:foo] }

    it { field.template.must_equal 'date' }
    it { field.form_helper.must_equal :time_field }
    it { field.json_value.must_equal val }
    it { field.value.must_equal val.to_time }

    it { node.foo.must_be_instance_of Time }
    it { node.foo.hour.must_equal 15 }

  end
end


text:
var util = require('util'),
    path = require('path'),
    fs = require('fs'),
    assetPkg,
    userPkg,
    pkg;

function writePkg() {
  // Reorder package keys
  var order = ['name', 'version', 'description', 'main', 'directories', 'scripts', 'repository'],
      _pkg = {};
  for (var i in order) {
    var _k = order[i];
    if (pkg[_k]) {
      _pkg[_k] = pkg[_k];
    };
  }
  _pkg = util._extend(_pkg, pkg);
  fs.writeFile('./package.json', JSON.stringify(_pkg, null, 2));
}

function writeReadme() {
  filePath = path.resolve('README.md');
  if(fs.existsSync(filePath)) {
    return false;
  }
  readme = [
    pkg.name,
    "===",
    pkg.description
  ].join('\n')
  fs.writeFile(filePath, readme);
}

assetPkg = require('../assets/package.json');

try {
  userPkg = require(path.resolve('./package.json'));
} catch(e) {
  userPkg = {};
}

pkg = util._extend(assetPkg, userPkg);

if (!pkg.name) {
  pkg.name = path.basename(path.resolve());
};

if (!pkg.description) {
  pkg.description = pkg.name;
};

// Read author form local git config
if (!pkg.repository) {
  try {
    var config = fs.readFileSync(path.resolve('.git/config'), {encoding: 'utf-8'}),
        matches;
    matches = config.match(/url ?\=(.*)/);
    pkg.repository = {
      "type": "git",
      "url": matches[1].trim()
    }
  } catch (e) {
    pkg.repository = {};
  }
};

// Read author from global git config
if (!pkg.author) {
  try {
    var config = fs.readFileSync(path.join(process.env.HOME + '', '.gitconfig'), {encoding: 'utf-8'}),
        name, email;
    name = config.match(/name ?\=(.*)/)[1].trim();
    email = config.match(/email ?\=(.*)/)[1].trim();
    pkg.author = {
      name: name,
      email: email
    };
  } catch (e) {
    pkg.author = {};
  }
};

writePkg();
writeReadme();


text:
/** @file
    @brief Header file for class that tracks and identifies LEDs.

    @date 2015

    @author
    Sensics, Inc.
    <http://sensics.com/osvr>
*/

// Copyright 2015 Sensics, Inc.
//
// 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.

#ifndef INCLUDED_LED_h_GUID_C53E1134_AD6B_46B0_4808_19C7EAA7D0EC
#define INCLUDED_LED_h_GUID_C53E1134_AD6B_46B0_4808_19C7EAA7D0EC

// Internal Includes
#include "LedIdentifier.h"

// Library/third-party includes
#include <opencv2/core/core.hpp>

// Standard includes
#include <vector>

namespace osvr {
namespace vbtracker {

    struct LedMeasurement {
        LedMeasurement() = default;
        explicit LedMeasurement(cv::KeyPoint const &kp)
            : loc(kp.pt), brightness(kp.size), diameter(kp.size),
              area((diameter / 2) * (diameter / 2) * CV_PI) {}

        /// Location in image space - should be undistorted when passed to the
        /// Led class.
        cv::Point2f loc;
        /// "Brightness" - currently actually diameter or radius.
        Brightness brightness;

        /// Blob diameter in pixels.
        float diameter = 0.f;

        /// Area in pixels
        float area = 1.f;

        /// Blob circularity (as defined by OpenCV) - in [0,1]
        float circularity = 0.f;

        /// Do we know an upright bounding box? (that is, is the next member
        /// valid?)
        bool knowBoundingBox = false;

        /// Dimensions of the upright bounding box.
        cv::Size2f boundingBox;
    };

    /// @brief Helper class to keep track of the state of a blob over time. This
    /// is used to help determine the identity of each LED in the scene. The
    /// LEDs are identified by their blink codes.  A steady one is presumed to
    /// be a light source.
    class Led {
      public:
        /// @name Constructors
        /// @brief Constructor takes initial values for the location and
        /// brightness, and a pointer to an object that will be used to identify
        /// the LEDs based on their brightness over time.
        /// @{
        Led(LedIdentifier *identifier, LedMeasurement const &meas);
        /// @}
        typedef int ID;

        static const ID SENTINEL_NO_IDENTIFIER_OBJECT_OR_INSUFFICIENT_DATA = -1;
        static const ID SENTINEL_INSUFFICIENT_EXTREMA_DIFFERENCE = -2;
        static const ID SENTINEL_NO_PATTERN_RECOGNIZED_DESPITE_SUFFICIENT_DATA =
            -3;
        static const uint8_t MAX_NOVELTY = 4;
        /// @brief Add a new measurement for this LED, which must be for a frame
        /// that is just following the previous measurement, so that the
        /// encoding of brightness and darkness can be used to identify it.
        /// @param meas A number of measurement parameters, of which only
        /// `brightness` and location are used in identifying beacon patterns.
        /// brightness is an abstract quantity that is fed into the identity
        /// detector; it may be area or summed brightness or another
        /// useful estimate of the LED state. The other parameters are carried
        /// along in the hope that they may be useful to later code. (For
        /// instance, not all identified beacons may be good choices to use in
        /// determining tracking pose)
        void addMeasurement(LedMeasurement const &meas, bool blobsKeepId);

        LedMeasurement const &getMeasurement() const {
            return m_latestMeasurement;
        }

        /// @brief Tells which LED I am.
        ///
        /// - An index of -1 means not yet determined.
        /// - An index below -1 means known not to be an LED (different
        ///   identifiers use different codes to differentiate between cases).
        /// - An index of 0 or higher is determined based on the flash pattern.
        int getID() const { return m_id; }

        /// @brief Gets either the raw negative sentinel ID or a 1-based ID (for
        /// display purposes)
        int getOneBasedID() const { return (m_id < 0) ? m_id : m_id + 1; }

        /// @brief Do we have a positive identification as a known LED?
        bool identified() const { return !(m_id < 0); }

        /// @brief Returns a value (decreasing per frame from some maximum down
        /// to a minimum of zero) indicating how new the identification of this
        /// blob with its current ID is. This can be used to compensate for
        /// accidental mis-identifications, identity switching, or the simple
        /// fact that new identifications might contain highly novel information
        /// that would otherwise "shock" the tracked state.
        uint8_t novelty() const { return m_novelty; }

        /// @brief Reports the most-recently-added position.
        cv::Point2f getLocation() const { return m_latestMeasurement.loc; }

        /// @brief Find the nearest KeyPoint from a container of points to me,
        /// if there is one within the specified threshold.  Runtime: O(n) where
        /// n is the number of elements in keypoints.
        /// @return end() if there is not a nearest within threshold (or an
        /// empty container).
        KeyPointIterator nearest(KeyPointList &keypoints,
                                 double threshold) const;

        /// @overload
        LedMeasurementIterator nearest(LedMeasurementList &meas,
                                       double threshold) const;

        /// @brief Returns the most-recent boolean "bright" state according to
        /// the LED identifier. Note that the value is only meaningful if
        /// `identified()` is true.
        bool isBright() const { return m_lastBright; }

        /// Used for a status display in debug windows.
        bool wasUsedLastFrame() const { return m_wasUsedLastFrame; }

        /// Call from inside the tracking algorithm to mark that it was used.
        void markAsUsed() { m_wasUsedLastFrame = true; }

        void resetUsed() { m_wasUsedLastFrame = false; }

        /// Called from within pose estimation or elsewhere with model-based
        /// knowledge that can refute the identification of this blob.
        void markMisidentified();

      private:
        /// Most recent measurement
        LedMeasurement m_latestMeasurement;

        /// Starting from current frame going backwards
        BrightnessList m_brightnessHistory;

        /// @brief Which LED am I? Non-negative are indices, negative are
        /// sentinels
        int m_id;

        /// @brief Object used to determine the identity of an LED
        LedIdentifier *m_identifier;

        /// @brief If identified, whether it is most recently in "bright" mode.
        bool m_lastBright = false;

        bool m_newlyRecognized = false;
        uint8_t m_novelty;

        bool m_wasUsedLastFrame = false;
    };

} // End namespace vbtracker
} // End namespace osvr

#endif // INCLUDED_LED_h_GUID_C53E1134_AD6B_46B0_4808_19C7EAA7D0EC


text:
module Drivers
  module Scm
    class Git < Drivers::Scm::Base
      adapter Chef::Provider::Git
      allowed_engines :git
      packages :git
      output filter: [:scm_provider, :repository, :revision, :enable_submodules, :ssh_wrapper, :remove_scm_files]
      defaults enable_submodules: true, ssh_wrapper: '/tmp/ssh-git-wrapper.sh'

      def before_deploy
        add_git_wrapper_script
        add_ssh_key
      end

      def after_deploy
        context.file File.join('/', 'tmp', '.ssh-deploy-key') do
          action :delete
        end
      end

      def raw_out
        super.merge(
          ssh_key: app['app_source'].try(:[], 'ssh_key') || node['deploy'][app['shortname']]['scm'].try(:[], 'ssh_key')
        )
      end

      private

      def add_git_wrapper_script
        context.template File.join('/', 'tmp', 'ssh-git-wrapper.sh') do
          source 'ssh-git-wrapper.sh.erb'
          mode '0770'
          owner node['deployer']['user'] || 'root'
          group www_group
        end
      end

      def add_ssh_key
        ssh_key = raw_out[:ssh_key]

        context.template File.join('/', 'tmp', '.ssh-deploy-key') do
          source 'ssh-deploy-key.erb'
          mode '0400'
          owner node['deployer']['user'] || 'root'
          group node['deployer']['group'] || 'root'
          variables ssh_key: ssh_key
        end
      end
    end
  end
end


text:
import { AbstractBatchRenderer, BatchShaderGenerator, Renderer, ViewableBuffer, Buffer, Geometry } from '@pixi/core';
import { TYPES } from '@pixi/constants';
import { premultiplyTint } from '@pixi/utils';

const shaderVert
    = `precision highp float;
attribute vec3 aVertexPosition;
attribute vec2 aTextureCoord;
attribute vec4 aColor;
attribute float aTextureId;

uniform mat3 projectionMatrix;

varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTextureId;

void main(void){
gl_Position.xyw = projectionMatrix * aVertexPosition;
gl_Position.z = 0.0;

vTextureCoord = aTextureCoord;
vTextureId = aTextureId;
vColor = aColor;
}
`;
const shaderFrag = `
varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTextureId;
uniform sampler2D uSamplers[%count%];

void main(void){
vec4 color;
%forloop%
gl_FragColor = color * vColor;
}`;

export class Batch3dGeometry extends Geometry
{
    _buffer: Buffer;
    _indexBuffer : Buffer;

    constructor(_static = false)
    {
        super();

        this._buffer = new Buffer(null, _static, false);

        this._indexBuffer = new Buffer(null, _static, true);

        this.addAttribute('aVertexPosition', this._buffer, 3, false, TYPES.FLOAT)
            .addAttribute('aTextureCoord', this._buffer, 2, false, TYPES.FLOAT)
            .addAttribute('aColor', this._buffer, 4, true, TYPES.UNSIGNED_BYTE)
            .addAttribute('aTextureId', this._buffer, 1, true, TYPES.FLOAT)
            .addIndex(this._indexBuffer);
    }
}

export class Batch2dPluginFactory
{
    // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
    static create(options: any): any
    {
        const { vertex, fragment, vertexSize, geometryClass } = (Object as any).assign({
            vertex: shaderVert,
            fragment: shaderFrag,
            geometryClass: Batch3dGeometry,
            vertexSize: 7,
        }, options);

        return class BatchPlugin extends AbstractBatchRenderer
        {
            constructor(renderer: Renderer)
            {
                super(renderer);

                this.shaderGenerator = new BatchShaderGenerator(vertex, fragment);
                this.geometryClass = geometryClass;
                this.vertexSize = vertexSize;
            }

            vertexSize: number;

            // eslint-disable-next-line max-len
            packInterleavedGeometry(element: any, attributeBuffer: ViewableBuffer, indexBuffer: Uint16Array, aIndex: number, iIndex: number)
            {
                const {
                    uint32View,
                    float32View,
                } = attributeBuffer;

                const p = aIndex / this.vertexSize;// float32View.length / 6 / 2;
                const uvs = element.uvs;
                const indices = element.indices;// geometry.getIndex().data;// indicies;
                const vertexData = element.vertexData;
                const vertexData2d = element.vertexData2d;
                const textureId = element._texture.baseTexture._batchLocation;

                const alpha = Math.min(element.worldAlpha, 1.0);

                const argb = alpha < 1.0 && element._texture.baseTexture.alphaMode ? premultiplyTint(element._tintRGB, alpha)
                    : element._tintRGB + (alpha * 255 << 24);

                if (vertexData2d)
                {
                    let j = 0;

                    for (let i = 0; i < vertexData2d.length; i += 3, j += 2)
                    {
                        float32View[aIndex++] = vertexData2d[i];
                        float32View[aIndex++] = vertexData2d[i + 1];
                        float32View[aIndex++] = vertexData2d[i + 2];
                        float32View[aIndex++] = uvs[j];
                        float32View[aIndex++] = uvs[j + 1];
                        uint32View[aIndex++] = argb;
                        float32View[aIndex++] = textureId;
                    }
                }
                else
                {
                    for (let i = 0; i < vertexData.length; i += 2)
                    {
                        float32View[aIndex++] = vertexData[i];
                        float32View[aIndex++] = vertexData[i + 1];
                        float32View[aIndex++] = 1.0;
                        float32View[aIndex++] = uvs[i];
                        float32View[aIndex++] = uvs[i + 1];
                        uint32View[aIndex++] = argb;
                        float32View[aIndex++] = textureId;
                    }
                }

                for (let i = 0; i < indices.length; i++)
                {
                    indexBuffer[iIndex++] = p + indices[i];
                }
            }
        };
    }
}


text:
class ChangeRewardType < ActiveRecord::Migration
  def up
    add_column :continuous_login_rewards, :reward_1_id, :string
    add_column :continuous_login_rewards, :reward_2_id, :string
    add_column :continuous_login_rewards, :reward_3_id, :string
    change_column :continuous_login_rewards, :reward_1_type, :integer
    change_column :continuous_login_rewards, :reward_2_type, :integer
    change_column :continuous_login_rewards, :reward_3_type, :integer
  end

  def down
    remove_column :continuous_login_rewards, :reward_1_id
    remove_column :continuous_login_rewards, :reward_2_id
    remove_column :continuous_login_rewards, :reward_3_id
    change_column :continuous_login_rewards, :reward_1_type, :string
    change_column :continuous_login_rewards, :reward_2_type, :string
    change_column :continuous_login_rewards, :reward_3_type, :string
  end
end


text:
package com.ibm.g11n.pipeline.maven;

import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;

import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;

/**
 * Class to generate GP instance from the fake broker
 *
 * @author jugudanniesundar
 *
 */
public class GPInstance {

    private static GPInstance gpInstance;

    private Credentials credentials;

    /**
     * @return the credentials
     */
    public Credentials getCredentials() {
        return credentials;
    }

    /**
     * @param credentials the credentials to set
     */
    public void setCredentials(Credentials credentials) {
        this.credentials = credentials;
    }

    /**
     * private constructor to support singleton behaviour
     */
    private GPInstance() {
    }

    /**
     * Generating instance from the fakebroker url
     * @param url The fakebroker url
     * @return Globalization pipeline instance having credentials
     * @throws Exception if connection fails or if the response is not formatted as json
     */
    public static GPInstance getInstance(String url) throws Exception{
        if (gpInstance == null) {
            synchronized (GPInstance.class) {
                if (gpInstance == null) {
                    try {
                        URL fakeBrokerURL = new URL(url);
                        HttpURLConnection request = (HttpURLConnection) fakeBrokerURL.openConnection();
                        request.connect();
                        InputStreamReader reader = new InputStreamReader(request.getInputStream(), StandardCharsets.UTF_8);
                        Gson gson = new Gson();
                        CredentialsExtended credsExt = gson.fromJson(reader, CredentialsExtended.class);
                        gpInstance = new GPInstance();
                        gpInstance.setCredentials(credsExt.getCredentials());
                    } catch (MalformedURLException e) {
                        throw new Exception("Bad URL Exception");
                    } catch (IOException e) {
                        throw new Exception("IO Exception");
                    } catch (JsonSyntaxException e) {
                        throw new Exception("Format Exception");
                    }
                }
            }
        }
        return gpInstance;
    }

}


text:
namespace crypto {

namespace {

ECSignatureCreatorFactory* g_factory_ = nullptr;

}  // namespace

// static
std::unique_ptr<ECSignatureCreator> ECSignatureCreator::Create(
    ECPrivateKey* key) {
  if (g_factory_)
    return g_factory_->Create(key);
  return std::make_unique<ECSignatureCreatorImpl>(key);
}

// static
void ECSignatureCreator::SetFactoryForTesting(
    ECSignatureCreatorFactory* factory) {
  // We should always clear the factory after each test to avoid
  // use-after-free problems.
  DCHECK(!g_factory_ || !factory);
  g_factory_ = factory;
}

}  // namespace crypto


text:
export abstract class AssistMapping {
  // home index
  static zero = [
    'financials',
    'adjustedNetIncome',
    'assistanceYear',
    'childDeduction',
    'deductions',
    'netIncome',
    'numberOfTaxYears',
    'sixtyFiveDeduction',
    'taxYear',
    'totalDeductions',
    'totalNetIncome',
    'uuid'
  ];

  // personal info index
  static one = [
    'attachmentUuids',
    'attachments',
    'applicant',
    'name',
    'birthDate',
    'firstName',
    'lastName',
    'secondName',
    'phn',
    'sin'
  ];

  // spouse index
  static two = [];

  // contact index
  static three = [
    'mailingAddress',
    'addressLine1',
    'addressLine2',
    'addressLine3',
    'city',
    'country',
    'postalCode',
    'provinceOrState',
    'telephone'
  ];

  static get items() {
    return [this.zero, this.one, this.two, this.three];
  }
}


text:
<?php
namespace test\b;
class d { }


text:
IF NOT EXISTS (
  select * from INFORMATION_SCHEMA.COLUMNS
  where TABLE_SCHEMA='dw' and TABLE_NAME='f_virta_jtp_tilasto'
  and COLUMN_NAME='d_julkaisufoorumitaso_vanha_id'
) BEGIN
ALTER TABLE dw.f_virta_jtp_tilasto ADD d_julkaisufoorumitaso_vanha_id int NULL
END

IF NOT EXISTS (
  select * from INFORMATION_SCHEMA.COLUMNS
  where TABLE_SCHEMA='dw' and TABLE_NAME='f_virta_jtp_tilasto'
  and COLUMN_NAME='d_julkaisufoorumitaso_uusi_id'
) BEGIN
ALTER TABLE dw.f_virta_jtp_tilasto ADD d_julkaisufoorumitaso_uusi_id int NULL
END


text:
<!DOCTYPE html>

    {% include meta_tags.html %}
    <title>{{page.title}}{% if page.title_sufix %}{{ page.title_sufix }}{% else %} - Ionic Framework{% endif %}</title>
    <link href="/css/site.css" rel="stylesheet">
    <link href="/css/job.css" rel="stylesheet">

    {% include nav_links.html %}

{{page.title}}

            Want to change the way the world builds mobile apps? Come join the Ionic
            team to empower developers to build high quality, interactive,
            and beautiful mobile apps with web technologies they already know and love.

            We believe the world is missing a huge opportunity to bring the web to mobile, and that
            we can be a major leader in this massive and fast-growing market.

            We are looking for some smart, driven, and independent people to join our growing team
            in Madison, San Francisco, or remotely (for specified positions).

About Us

          Ionic is a well-funded and tight-knit team with a office located right by the state capitol in Madison, WI and with remote employees around the US. The company behind Ionic
          was founded in 2012 with the goal of making incredibly powerful and easy-to-use development tools.

          {{content}}

Madison Office

    {% include footer.html %}

    {% include base_scripts.html %}


text:
package com.dotech_hosting.listahu.services;

import android.app.IntentService;
import android.content.Intent;
import android.util.Log;

import com.dotech_hosting.listahu.support.SyncManager;

/**
 * Created by emilio on 10/30/15.
 */
public class UpdateService extends IntentService {

    private static final String TAG = UpdateService.class.getSimpleName();

    public UpdateService() {
        super("UpdateService");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        Log.d(TAG, "Syncing data");
        new SyncManager(getApplicationContext()).sync();
    }
}


text:
using System;

namespace Schedules.API.Extensions
{
  public static class StringToEnum
  {
    /// <summary>
    /// Turn string into the specified enum, case insensitive
    /// If invalid, return default
    /// </summary>
    /// <returns>The enum.</returns>
    /// <param name="s">S.</param>
    /// <typeparam name="T">The 1st type parameter.</typeparam>
    public static T ToEnum<T>(this string s) where T : struct
    {
      T result;
      Enum.TryParse<T> (s, true, out result);
      return result;
    }
  }
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE606_Unchecked_Loop_Condition__char_environment_61b.c
Label Definition File: CWE606_Unchecked_Loop_Condition.label.xml
Template File: sources-sinks-61b.tmpl.c
*/
/*
 * @description
 * CWE: 606 Unchecked Input For Loop Condition
 * BadSource: environment Read input from an environment variable
 * GoodSource: Input a number less than MAX_LOOP
 * Sinks:
 *    GoodSink: Use data as the for loop variant after checking to see if it is less than MAX_LOOP
 *    BadSink : Use data as the for loop variant without checking its size
 * Flow Variant: 61 Data flow: data returned from one function to another in different source files
 *
 * */

#include "std_testcase.h"

#define MAX_LOOP 10000

#ifndef _WIN32
#include <wchar.h>
#endif

#define ENV_VARIABLE "ADD"

#ifdef _WIN32
#define GETENV getenv
#else
#define GETENV getenv
#endif

#ifndef OMITBAD

char * CWE606_Unchecked_Loop_Condition__char_environment_61b_badSource(char * data)
{
    {
        /* Append input from an environment variable to data */
        size_t dataLen = strlen(data);
        char * environment = GETENV(ENV_VARIABLE);
        /* If there is data in the environment variable */
        if (environment != NULL)
        {
            /* POTENTIAL FLAW: Read data from an environment variable */
            strncat(data+dataLen, environment, 100-dataLen-1);
        }
    }
    return data;
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B() uses the GoodSource with the BadSink */
char * CWE606_Unchecked_Loop_Condition__char_environment_61b_goodG2BSource(char * data)
{
    /* FIX: Set data to a number less than MAX_LOOP */
    strcpy(data, "15");
    return data;
}

/* goodB2G() uses the BadSource with the GoodSink */
char * CWE606_Unchecked_Loop_Condition__char_environment_61b_goodB2GSource(char * data)
{
    {
        /* Append input from an environment variable to data */
        size_t dataLen = strlen(data);
        char * environment = GETENV(ENV_VARIABLE);
        /* If there is data in the environment variable */
        if (environment != NULL)
        {
            /* POTENTIAL FLAW: Read data from an environment variable */
            strncat(data+dataLen, environment, 100-dataLen-1);
        }
    }
    return data;
}

#endif /* OMITGOOD */


text:
import {
  USER_NOT_FOUND,
  PASSWORD_INCORRECT,
} from 'constants/errors/sign-in-errors';

import {useState} from 'react';

import {getMerchantWithFirebaseUid} from 'api';
import {useMerchantContext} from 'components/merchant/contexts/MerchantContext';
import firebaseAuth, {getFirebaseUid} from 'firebase-auth';
import {useForm} from 'react-hook-form';
import {useHistory} from 'react-router-dom';

type SignInData = {
  email: string;
  password: string;
};

/**
 * This custom hook handles all the logic related to Merchant Sign In Form.
 * This includes validating form inputs, disabling submit button when there are
 * invalid inputs and signing in merchant upon clicking 'SIGN IN' button.
 */
const useSignInForm = () => {
  const {formState, handleSubmit, register} = useForm<SignInData>({
    mode: 'onChange',
  });
  const [generalError, setGeneralError] = useState<Error | undefined>();
  const {setMerchant} = useMerchantContext();
  const history = useHistory();

  const validations = {
    email: {
      required: true,
    },
    password: {
      required: true,
    },
  };
  const disabled = !formState.isValid;

  const onSubmit = handleSubmit(async (values: SignInData) => {
    setGeneralError(undefined); // Reset general error message.
    try {
      const {email, password} = values;
      await firebaseAuth.signInWithEmailAndPassword(email, password);
      const firebaseUid = await getFirebaseUid();
      const merchant = await getMerchantWithFirebaseUid(firebaseUid);
      setMerchant(merchant);
      history.push('home');
    } catch (err) {
      switch (err.code) {
        case 'auth/user-not-found':
          err.message = USER_NOT_FOUND;
          break;
        case 'auth/wrong-password':
          err.message = PASSWORD_INCORRECT;
          break;
      }
      setGeneralError(err);
    }
  });

  return {
    disabled,
    errors: {
      form: {},
      general: generalError,
    },
    onSubmit,
    register,
    validations,
  };
};

export default useSignInForm;


text:
define(function() {
    var konyLoggerModule = require('com/konymp/login/konyLogger');
    kony = kony || {};
    kony.logger = new konyLoggerModule("Login Component");
    constants.DEFAULT_MINIMUM_CHAR_LENGTH = 8;
    constants.DEFAULT_MAX_LENGTH = 30;
    constants.USERNAME_VALIDATION_MESSAGE = "Username too small";
    constants.PASSWORD_VALIDATION_MESSAGE = "Password too small";
    constants.DEFAULT_PROVIDER_NAME = "userstore";
    constants.MF_ALERT_MESSAGE = "Please connect to MobileFabric";
    constants.DEFAULT_SUCCESS_MESSAGE = "Login Success";
    constants.DEFAULT_FAILURE_MESSAGE = "Login Failed";
    return {
        /**
         * @constructor constructor
         * @param basicConfig
         * @param layoutConfig
         * @param pspConfig
         */
        constructor: function(basicConfig, layoutConfig, pspConfig) {
            kony.logger.trace("In Component constructor", kony.logger.FUNCTION_ENTRY);
            this._usernameMinimumChar = constants.DEFAULT_MINIMUM_CHAR_LENGTH;
            this._passwordMinimumChar = constants.DEFAULT_MINIMUM_CHAR_LENGTH;
            this._usernameValidationMsg = constants.USERNAME_VALIDATION_MESSAGE;
            this._passwordValidationMsg = constants.PASSWORD_VALIDATION_MESSAGE;
            this._providerName = constants.DEFAULT_PROVIDER_NAME;
            this._encryptCredentials = true;
        },
        /**
         * @function initGettersSetters
         * @description contains getters/setters for custom properties
         */
        initGettersSetters: function() {
            defineGetter(this, "usernameMinimumChar", function() {
                kony.logger.trace("----------Entering usernameMinimumCharacter Getter---------", kony.logger.FUNCTION_ENTRY);
                return this._usernameMinimumChar;
            });

            defineSetter(this, "usernameMinimumChar", function(val) {
                kony.logger.trace("----------Entering usernameMinimumCharacter Setter---------", kony.logger.FUNCTION_ENTRY);
                try {
                    if (val == null || val == undefined) {
                        kony.logger.warn("Username Min Char is undefined");
                        throw {
                            "Error": "LoginComponent",
                            "message": "Username Min Char is undefined"
                        };
                    }
                    if (isNaN(val)) {
                        kony.logger.warn("Invalid datatype for Username Min Characters Property");
                        throw {
                            "Error": "LoginComponent",
                            "message": "Invalid datatype for Username Min Characters Property"
                        };
                    }
                    if (this.usernameMaxChar < val) {
                        kony.logger.warn("usernameMaxChar is less than usernameMinimumChar");
                        throw {
                            "Error": "LoginComponent",
                            "message": "username Max Char is less than Username Min Character propert"
                        };
                    }
                    this._usernameMinimumChar = val;
                } catch (exception) {
                    if (exception["Error"] === "LoginComponent")
                        alert(JSON.stringify(exception));
                }
            });
            defineGetter(this, "passwordMinimumChar", function() {
                kony.logger.trace("----------Entering passwordMinimumCharacter Getter---------", kony.logger.FUNCTION_ENTRY);
                return this._passwordMinimumChar;
            });
            defineSetter(this, "passwordMinimumChar", function(val) {
                kony.logger.trace("----------Entering passwordMinimumCharacter Setter---------", kony.logger.FUNCTION_ENTRY);
                try {
                    if (val == null || val == undefined) {
                        kony.logger.warn("Password Min Char is undefined");
                        throw {
                            "Error": "LoginComponent",
                            "message": "Password Min Char is undefined"
                        };
                    }
                    if (isNaN(val)) {
                        kony.logger.warn("Invalid datatype for Password Min Characters Property");
                        throw {
                            "Error": "LoginComponent",
                            "message": "Invalid datatype for Password Min Characters Property"
                        };
                    }
                    if (this.passwordMaxChar < val) {
                        kony.logger.warn("passwordMaxChar is less than password Min Character");
                        throw {
                            "Error": "LoginComponent",
                            "message": "Password Max Char is less than Password Min Character propert"
                        };
                    }
                    this._passwordMinimumChar = val;
                } catch (exception) {
                    if (exception["Error"] == "LoginComponent") {
                        alert(JSON.stringify(exception));
                    }
                }
            });
            defineGetter(this, "usernameValidationMsg", function() {
                kony.logger.trace("----------Entering usernameValidationMsg Getter---------", kony.logger.FUNCTION_ENTRY);
                return this._usernameValidationMsg;
            });
            defineSetter(this, "usernameValidationMsg", function(val) {
                kony.logger.trace("----------Entering usernameValidationMsg Setter---------", kony.logger.FUNCTION_ENTRY);
                this._usernameValidationMsg = val;
            });
            defineGetter(this, "passwordValidationMsg", function() {
                kony.logger.trace("----------Entering passwordValidationMsg Getter---------", kony.logger.FUNCTION_ENTRY);
                return this._passwordValidationMsg;
            });
            defineSetter(this, "passwordValidationMsg", function(val) {
                kony.logger.trace("----------Entering passwordValidationMsg Setter---------", kony.logger.FUNCTION_ENTRY);
                this._passwordValidationMsg = val;
            });
            defineGetter(this, "providerName", function() {
                kony.logger.trace("----------Entering providerName Getter---------", kony.logger.FUNCTION_ENTRY);
                return this._providerName;
            });
            defineSetter(this, "providerName", function(val) {
                kony.logger.trace("------------Entering providerName Setter---------", kony.logger.FUNCTION_ENTRY);
                this._providerName = val;
            });
            defineGetter(this, "encryptCredentials", function() {
                kony.logger.trace("----------Entering encryptCredentials Getter---------", kony.logger.FUNCTION_ENTRY);
                return this._encryptCredentials;
            });
            defineSetter(this, "encryptCredentials", function(val) {
                kony.logger.trace("------------Entering encryptCredentials Setter---------", kony.logger.FUNCTION_ENTRY);
                this._encryptCredentials = val;
                if (val == true) {
                    this.getRememberMe();
                }
                this.checkTouchIdSupoort();
            });
        },
        /**
         * @function invokeTouch
         * @description This function is used to invoke animation
         * @private
         * @param {string} value
         * @param {string} top
         */
        invokeTouch: function(value, top) {
            kony.logger.trace("---------------Entering invoke touch function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                value.animate(
                    kony.ui.createAnimation({
                        "100": {
                            "left": "5%",
                            "top": top,
                            "stepConfig": {
                                "timingFunction": kony.anim.EASE
                            },
                        }
                    }), {
                        "delay": 0,
                        "iterationCount": 1,
                        "fillMode": kony.anim.FILL_MODE_FORWARDS,
                        "duration": 0.25
                    }, {
                        "animationEnd": this.focus(value, top)
                    });
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting invoke touch function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function focus
         * @description This function is invoked after invokeTouch animation success
         * @private
         * @param {Object} value
         * @param {string} top
         * @callback invokeTouchCallback
         */
        focus: function(value, top) {
            kony.logger.trace("---------------Entering focus function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (value.id == "lblUsername" && top == "-1%") {
                    this.view.tbxUsername.setFocus(true);
                    this.view.flxLblUsername.isVisible = false;
                    this.view.forceLayout();
                    value.skin = "sknAnimate";
                } else if (value.id == "lblPassword" && top == "16%") {
                    this.view.tbxPassword.setFocus(true);
                    this.view.flxLblPassword.isVisible = false;
                    this.view.forceLayout();
                    value.skin = "sknAnimate";
                } else {
                    value.skin = "sknLblAnimate";
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting focus function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function onDoneCredentials
         * @description Common onDone function for username and password textboxes
         * @private
         * @param {Object} view
         * @event usernameOnDone
         * @event passwordOnDone
         */
        onDoneCredentials: function(view) {
            kony.logger.trace("---------------Entering onDoneCredentials function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (view.id == "lblUsername") {
                    this.invokeTouch(this.view.lblPassword, "16%");
                    if (this.view.tbxUsername.text === "") {
                        this.invokeTouch(view, "6%");
                        this.view.flxLblUsername.isVisible = true;

                    }
                    if (this.usernameOnDone !== null && this.usernameOnDone !== undefined) {
                        kony.logger.info("Invoking usernameOnDone event");
                        this.usernameOnDone();
                    } else {
                        this.validateUsername();
                    }
                } else if (view.id == "lblPassword") {
                    if (this.view.tbxPassword.text === "") {
                        this.invokeTouch(view, "23%");
                        this.view.flxLblPassword.isVisible = true;
                    }
                    if (this.passwordOnDone !== null && this.passwordOnDone !== undefined) {
                        kony.logger.info("Invoking passwordOnDone event");
                        this.passwordOnDone();
                    } else {
                        this.validatePassword();
                    }
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting onDoneCredentials function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function getUsername
         * @description Returns username entered by the user
         * @public
         * @return {string} username
         */
        getUsername: function() {
            kony.logger.trace("---------------Entering getUsername api---------------", kony.logger.FUNCTION_ENTRY);
            try {
                return this.view.tbxUsername.text;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
        },
        /**
         * @function getPassword
         * @description Returns password entered by the user
         * @public
         * @return {string} password
         */
        getPassword: function() {
            kony.logger.trace("---------------Entering getPassword api---------------", kony.logger.FUNCTION_ENTRY);
            try {
                return this.view.tbxPassword.text;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
        },
        /**
         * @function invokeIdentityService
         * @description Invokes identity service provided by the user
         * @public
         * @param {string} providername
         */
        invokeIdentityService: function(providername) {
            kony.logger.trace("---------------Entering invokeIdentityService api---------------", kony.logger.FUNCTION_ENTRY);
            if (!kony.net.isNetworkAvailable(constants.NETWORK_TYPE_ANY)) {
                alert("No Internet Connection Available");
                return;
            }
            try {
                var argument = {};
                var authorizationClient = null;
                kony.application.showLoadingScreen(null, "Loading...", constants.LOADING_SCREEN_POSITION_ONLY_CENTER, false, true, {});
                var sdkClient = new kony.sdk.getCurrentInstance();
                if (Object.keys(sdkClient).length !== 0) {
                  authorizationClient = sdkClient.getIdentityService(providername);
                }

                if (authorizationClient === null || authorizationClient === undefined) {
                    kony.application.dismissLoadingScreen();
                    kony.logger.info("Authorization object null - Connect to MF");
                    alert(constants.MF_ALERT_MESSAGE);
                    return;
                }
                if (providername === constants.DEFAULT_PROVIDER_NAME) {
                    kony.store.setItem("inputType", "password");
                    argument.userid = this.getUsername();
                    argument.password = this.getPassword();
                } else {

                    this.view.flxIdentity.isVisible = true;
                    this.view.forceLayout();
                    argument.browserWidget = this.view.brwsrIdentity;
                    kony.application.dismissLoadingScreen();
                }
                kony.logger.info("Network call to MF for identity authentication", kony.logger.SERVICE_CALL);
                authorizationClient.login(argument, this.successWrapper.bind(this), this.failureWrapper.bind(this));
            } catch (exception) {
                kony.application.dismissLoadingScreen();
                alert("raised" + JSON.stringify(exception));
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting invokeIdentityService api---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function successWrapper
         * @description Success callback for invokeIdentityService
         * @private
         * @param {Object} response
         * @callback invokeIdentityServiceCallback
         * @event loginSuccessEvent
         */
        successWrapper: function(response) {
            kony.logger.trace("---------------Entering successWrapper function---------------", kony.logger.FUNCTION_ENTRY);
            kony.logger.info("Invoke identity service success---" + JSON.stringify(response), kony.logger.SUCCESS_CALLBACK);
            try {
                var inputType = kony.store.getItem("inputType");
                kony.application.dismissLoadingScreen();
                if (inputType === "social") {
                    this.view.flxIdentity.isVisible = false;
                    if (this.loginSuccessEvent !== null && this.loginSuccessEvent !== undefined) {
                        this.loginSuccessEvent();
                    }
                }
                if (this.remembermeProperty == true) {
                    this.rememberMe();
                }
                if (this.touchIDProperty == true && (kony.store.getItem("touchID") == false || kony.store.getItem("touchID") == null) && this.getTouchSupport()) {
                    this.enableTouchID();
                } else if (this.loginSuccessEvent !== null && this.loginSuccessEvent !== undefined) {
                    kony.logger.info("Invoking Login Success event");
                    this.loginSuccessEvent();
                } else {
                    alert(constants.DEFAULT_SUCCESS_MESSAGE);
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting successWrapper function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function failureWrapper
         * @description Failure callback for invokeIdentityService
         * @private
         * @param {Object} response
         * @callback invokeIdentityServiceCallback
         * @event loginFailureEvent
         */
        failureWrapper: function(response) {
            kony.logger.trace("---------------Entering failureWrapper function---------------", kony.logger.FUNCTION_ENTRY);
            kony.logger.info("Invoke identity service failure" + JSON.stringify(response), kony.logger.ERROR_CALLBACK);
            try {
                kony.application.dismissLoadingScreen();
                if (this.loginFailureEvent !== null && this.loginFailureEvent !== undefined) {
                    kony.logger.info("Invoking Login Failure event");
                    this.loginFailureEvent();
                } else {
                    alert(constants.DEFAULT_FAILURE_MESSAGE);
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting failureWrapper function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function getTouchSupport
         * @description Return touch ID support for device
         * @private
         * @return {boolean} true/false
         */
        getTouchSupport: function() {
            kony.logger.trace("---------------Entering getTouchSupport function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                //#ifdef winphone8
                alert("Touch ID not supported");
                return false;
                //#endif
                var status = kony.localAuthentication.getStatusForAuthenticationMode(constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID);
                if (status == 5000)
                    return true;
                return false;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting getTouchSupport function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function enableTouchID
         * @description Turns on visibility for Touch ID popup
         * @public
         * @param {string} input
         */
        enableTouchID: function(input) {
            kony.logger.trace("---------------Entering enableTouchID api---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (this.view.flxTouchId.isVisible == true && kony.store.getItem("inputType") === "password") {
                    if (this.loginSuccessEvent !== null && this.loginSuccessEvent !== undefined && input !== true) {
                        this.view.flxPopups.flxEnableTouchIDPopup.btnCancel.onClick = this.touchCancelAction.bind(this, true);
                        this.view.flxPopups.flxEnableTouchIDPopup.btnEnable.onClick = this.touchEnableAction.bind(this, true);
                    }
                    this.view.flxPopups.isVisible = true;
                    this.view.flxEnableTouchIDPopup.isVisible = true;
                    this.view.forceLayout();
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting enableTouchID api---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function touchCancelAction
         * @description Action associated with cancel button of Touch ID popup
         * @private
         * @param {boolean} input
         * @event loginSuccessEvent
         */
        touchCancelAction: function(input) {
            kony.logger.trace("---------------Entering touchCancelAction function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                this.view.flxPopups.isVisible = false;
                this.view.flxPopups.flxEnableTouchIDPopup.isVisible = false;
                if (input == true) {
                    this.loginSuccessEvent();
                } else {
                    alert(constants.DEFAULT_SUCCESS_MESSAGE);
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting touchCancelAction function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function touchEnableAction
         * @description Action associated with enable button of Touch ID popup
         * @private
         * @param {boolean} input
         * @event loginSuccessEvent
         */
        touchEnableAction: function(input) {
            kony.logger.trace("---------------Entering touchEnableAction function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                this.view.flxPopups.isVisible = false;
                this.view.flxPopups.flxEnableTouchIDPopup.isVisible = false;
                kony.store.setItem("touchID", true);
                if (input == true) {
                    kony.logger.info("Invoking Login success event");
                    this.loginSuccessEvent();
                } else {
                    alert(constants.DEFAULT_SUCCESS_MESSAGE);
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting touchEnableAction function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function invokeTouchID
         * @description invokes touch ID for the device
         * @private
         */
        invokeTouchID: function() {
            kony.logger.trace("---------------Entering invokeTouchID function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (kony.store.getItem("touchID") !== true) {
                    alert("Login using Username and Password to enable touch ID");
                    return;
                }
                if (this.touchIDProperty == false) {
                    alert("Enable touch ID");
                    return;
                }
                //#ifdef winphone8
                alert("Touch ID not supported");
                return false;
                //#endif
                var status = kony.localAuthentication.getStatusForAuthenticationMode(constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID);
                if (status == "5000") {
                    //#ifdef android
                    this.view.flxTouchIDPopup.isVisible = true;
                    this.view.flxPopups.isVisible = true;
                    //#endif
                    var configMap = {
                        "promptMessage": "Swipe your finger"
                    };
                    kony.localAuthentication.authenticate(
                        constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID,
                        this.touchAuthenticationCallback.bind(this),
                        configMap);
                } else {
                    alert("Device doesnt support Touch ID");
                }
            } catch (exception) {
                kony.logger.error("Catch  in authenticateThroughTouch : " + JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting invokeTouchID function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function touchAuthenticationCallback
         * @description Callback function for invokeTouch ID
         * @private
         * @param {Object} code
         * @callback invokeTouchIDCallback
         * @event loginSuccessEvent
         */
        touchAuthenticationCallback: function(code) {
            kony.logger.trace("---------------Entering touchAuthenticationCallback function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (code == 5000) {
                    //#ifdef android
                    this.view.flxTouchIDPopup.isVisible = false;
                    this.view.flxPopups.isVisible = false;
                    //#endif
                    if (this.loginSuccessEvent !== null && this.loginSuccessEvent !== undefined) {
                        kony.logger.info("Invoking Login Success event");
                        this.loginSuccessEvent();
                    } else {
                        alert(constants.DEFAULT_SUCCESS_MESSAGE);
                    }
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting touchAuthenticationCallback function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function cancelTouchID
         * @description Action associated with cancel button of Touch ID popup
         * @private
         */
        cancelTouchID: function() {
            kony.logger.trace("---------------Entering cancelTouchID function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                kony.localAuthentication.cancelAuthentication();
                this.view.flxTouchIDPopup.isVisible = false;
                this.view.flxPopups.isVisible = false;
                this.view.forceLayout();
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting cancelTouchID function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function generatePassword
         * @description Generates a random string
         * @private
         * @param {string} length
         * @return {string} retVal
         */
        generatePassword: function(length) {
            kony.logger.trace("---------------Entering generatePassword function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                var charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
                var retVal = "";
                for (var i = 0, n = charset.length; i < length; ++i) {
                    retVal += charset.charAt(Math.floor(Math.random() * n));
                }
                return retVal;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting generatePassword function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function getrememberKey
         * @description Creates a keyobject from the key that is generated by generatePassword
         * @private
         */
        getrememberKey: function() {
            kony.logger.trace("---------------Entering getrememberKey function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (kony.store.getItem("key") === null) {
                    var encryptDecryptKey = kony.crypto.newKey("passphrase", 128, {
                        passphrasetext: [this.generatePassword(32)],
                        subalgo: "aes",
                        passphrasehashalgo: "md5"
                    });
                    var myUniqueIDKey = kony.crypto.saveKey("encryptionKey", encryptDecryptKey);
                    kony.store.setItem("key", myUniqueIDKey);
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting getrememberKey function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function encryptData
         * @description Encrypts data with keyobject
         * @private
         * @param {string} data
         * @return {string} encrpytedData
         */
        encryptData: function(data) {
            kony.logger.trace("---------------Entering encryptData function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (kony.store.getItem("key") === null) {
                    this.getrememberKey();
                }
                var rememberKey = kony.store.getItem("key");
                var myUniqueKey = kony.crypto.readKey(rememberKey);
                var properties = {
                    padding: "pkcs5",
                    mode: "cbc",
                    initializationvector: "1234567890123456"
                };
                var encryptedData = kony.crypto.encrypt("aes", myUniqueKey, data, properties);
                return (kony.convertToBase64(encryptedData));
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting encryptData function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function decryptData
         * @description Decrypts data with keyobject
         * @private
         * @param {string} data
         * @return {string} decryptedData
         */
        decryptData: function(data) {
            kony.logger.trace("---------------Entering decryptData function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (kony.store.getItem("key") === null) {
                    this.getrememberKey();
                }
                var rememberKey = kony.store.getItem("key");
                var myUniqueKey = kony.crypto.readKey(rememberKey);
                var properties = {
                    padding: "pkcs5",
                    mode: "cbc",
                    initializationvector: "1234567890123456"
                };
                var decryptedData = kony.crypto.decrypt("aes", myUniqueKey, kony.convertToRawBytes(data), properties);
                return decryptedData;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting decryptData function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function changeImage
         * @description Invoked when user toggles remember me icon
         * @private
         */
        changeImage: function() {
            kony.logger.trace("---------------Entering changeImage function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (this.view.imgRememberme.isVisible == true) {
                    this.view.imgRememberme.isVisible = false;
                    this.view.imgUnselected.isVisible = true;
                } else {
                    this.view.imgRememberme.isVisible = true;
                    this.view.imgUnselected.isVisible = false;
                }
                this.view.forceLayout();
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting changeImage function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function getRememberMe
         * @description Checks if any user credentials exist already
         * @private
         */
        getRememberMe: function() {
            kony.logger.trace("---------------Entering getRememberMe function---------------", kony.logger.FUNCTION_ENTRY);
            kony.logger.info("Retrieving Username and password locally", kony.logger.DATA_STORE);
            try {
                var Username = "";
                var Password = "";
                Username = kony.store.getItem("loginUsername");
                Password = kony.store.getItem("loginPassword");
                if (Username !== null && Password !== null) {
                    if (Username !== "" && Password !== "") {
                        this.view.lblPassword.top = "16%";
                        this.view.lblPassword.skin = "sknAnimate";
                        this.view.lblUsername.top = "-1%";
                        this.view.lblUsername.skin = "sknAnimate";
                        this.view.flxLblUsername.isVisible = false;
                        this.view.flxLblPassword.isVisible = false;

                    }
                    if (this.encryptCredentials) {
                        //#ifdef android
                        Username = this.decryptData(kony.store.getItem("loginUsername"));
                        Password = this.decryptData(kony.store.getItem("loginPassword"));
                        //#endif

                        //#ifdef iphone
                        Username = this.decryptData(kony.store.getItem("loginUsername"));
                        Password = this.decryptData(kony.store.getItem("loginPassword"));
                        //#endif

                        //#ifdef winphone8
                        Username = kony.store.getItem("loginUsername");
                        Password = kony.store.getItem("loginPassword");
                        //#endif
                    } else {
                        Username = kony.store.getItem("loginUsername");
                        Password = kony.store.getItem("loginPassword");
                    }
                    this.view.tbxUsername.text = Username;
                    this.view.tbxPassword.text = Password;
                } else {
                    this.view.flxLblUsername.isVisibile = true;
                    this.view.flxLblPassword.isVisible = true;
                    this.view.lblPassword.top = "23%";
                    this.view.lblPassword.skin = "sknLblAnimate";
                    this.view.lblUsername.top = "6%";
                    this.view.lblUsername.skin = "sknLblAnimate";
                    this.view.tbxUsername.text = "";
                    this.view.tbxPassword.text = "";
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting getRememberMe function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function rememberMe
         * @description Stores user credentials by encrypting them
         * @public
         */
        rememberMe: function() {
            kony.logger.trace("---------------Entering rememberMe api---------------", kony.logger.FUNCTION_ENTRY);
            kony.logger.info("Storing Username and password locally", kony.logger.DATA_STORE);
            try {
                if (this.view.imgUnselected.isVisible == true) {
                    kony.store.setItem("loginUsername", "");
                    kony.store.setItem("loginPassword", "");
                } else if (kony.store.getItem("inputType") === "password" && this.view.imgRememberme.isVisible == true) {
                    if (this.encryptCredentials) {
                        //#ifdef android
                        kony.store.setItem("loginUsername", this.encryptData(this.getUsername()));
                        kony.store.setItem("loginPassword", this.encryptData(this.getPassword()));
                        //#endif

                        //#ifdef iphone
                        kony.store.setItem("loginUsername", this.encryptData(this.getUsername()));
                        kony.store.setItem("loginPassword", this.encryptData(this.getPassword()));
                        //#endif

                        //#ifdef winphone8
                        kony.store.setItem("loginUsername", this.getUsername());
                        kony.store.setItem("loginPassword", this.getPassword());
                        //#endif
                    } else {
                        kony.store.setItem("loginUsername", this.getUsername());
                        kony.store.setItem("loginPassword", this.getPassword());
                    }
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting rememberMe api---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function invokeButtonClick
         * @description invoked when user clicks on submit button
         * @private
         * @event submitOnClick
         */
        invokeButtonClick: function() {
            kony.logger.trace("---------------Entering invokeButtonClick function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                kony.store.setItem("inputType", "password");
                if (this.submitOnClick !== null && this.submitOnClick !== undefined) {
                    this.submitOnClick();
                } else {
                    if (this.validate()) {
                        if (this.providerName !== null || this.providerName !== undefined || this.providerName !== "") {
                            kony.logger.info("Invoking identity service of providername - - - " + this.providerName);
                            this.invokeIdentityService(this.providerName);
                        } else {
                            this.invokeIdentityService("userstore");
                        }
                    } else {
                        alert("Please enter valid username and password");
                    }
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting invokeButtonClick function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function remembermeSelection
         * @description Event triggered when user sets remember me action event
         * @private
         * @event remembermeOnSelection
         */
        remembermeSelection: function() {
            kony.logger.trace("---------------Entering remembermeSelection function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                this.changeImage();
                if (this.remembermeOnSelection !== null && this.remembermeOnSelection !== undefined) {
                    kony.logger.info("Invoking rememberOnSelection event");
                    this.remembermeOnSelection();
                }
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting remembermeSelection function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function validateUsername
         * @description Validates username entered by the user
         * @private
         * @returns {boolean} true/false
         */
        validateUsername: function() {
            kony.logger.trace("---------------Entering validateUsername function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (parseInt(this.usernameMinimumChar) > this.getUsername().length) {
                    alert(this._usernameValidationMsg);
                    return false;
                }
                return true;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting validateUsername function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function validatePassword
         * @description Validates password entered by the user
         * @private
         * @returns {boolean} true/false
         */
        validatePassword: function() {
            kony.logger.trace("---------------Entering validatePassword function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (parseInt(this.passwordMinimumCharacter) > this.getPassword().length) {
                    alert(this._passwordValidationMsg);
                    return false;
                }
                return true;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting validatePassword function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function validate
         * @description validates username and password
         * @private
         * @return {boolean} true/false
         */
        validate: function() {
            kony.logger.trace("---------------Entering validate function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                if (this.getUsername() !== "" && this.getUsername() !== null && this.getPassword() !== null && this.getPassword() !== "" && this.validateUsername() !== false && this.validatePassword !== false) {
                    return true;
                }
                return false;
            } catch (exception) {
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting validate function---------------", kony.logger.FUNCTION_EXIT);
        },
        /**
         * @function checkTouchIdSupoort
         * @description validates username and password
         * @private
         * @return {boolean} true/false
         */
        checkTouchIdSupoort: function() {
            kony.logger.trace("---------------Entering checkTouchIdSupoort function---------------", kony.logger.FUNCTION_ENTRY);
            try {
                //#ifdef winphone8
                this.touchIDProperty = false;
                this.view.flxOr.isVisible = false;
                //#endif
                //#ifdef android
                var status = kony.localAuthentication.getStatusForAuthenticationMode(constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID);
                if (status != "5006" && status != "5008") {
                    if (this.touchIDProperty == true) {
                        this.touchIDProperty = true;
                        this.view.forceLayout();

                    } else {
                        this.touchIDProperty = false;
                        this.view.flxOr.isVisible = false;
                        this.view.forceLayout();
                    }
                } else {
                    this.touchIDProperty = false;
                    this.view.flxOr.isVisible = false;
                }
                //#endif
                //#ifdef iphone
                var status = kony.localAuthentication.getStatusForAuthenticationMode(constants.LOCAL_AUTHENTICATION_MODE_TOUCH_ID);
                if (status != "5006" && status != "5008") {
                    if (this.touchIDProperty == true) {
                        this.touchIDProperty = true;
                    } else {
                        this.touchIDProperty = false;
                        this.view.flxOr.isVisible = false;
                    }
                } else {
                    this.touchIDProperty = false;
                    this.view.flxOr.isVisible = false;
                }
                //#endif
            } catch (exception) {
                alert(JSON.stringify(exception));
                kony.logger.error(JSON.stringify(exception), kony.logger.EXCEPTION);
            }
            kony.logger.trace("---------------Exiting checkTouchIdSupoort function---------------", kony.logger.FUNCTION_ENTRY);
        }
    };
});


text:
/**
 * @fileOverview Defines the {@link CKFinder.lang} object, for the Danish
 *		language. This is the base file for all translations.
*/

/**
 * Constains the dictionary of language entries.
 * @namespace
 */
CKFinder.lang['da'] =
{
	appTitle : 'CKFinder',

	// Common messages and labels.
	common :
	{
		// Put the voice-only part of the label in the span.
		unavailable		: '%1, ikke tilgængelig',
		confirmCancel	: 'Nogle af indstillingerne er blevet ændret. Er du sikker på at lukke dialogen?',
		ok				: 'OK',
		cancel			: 'Annuller',
		confirmationTitle	: 'Bekræftelse',
		messageTitle	: 'Information',
		inputTitle		: 'Spørgsmål',
		undo			: 'Fortryd',
		redo			: 'Annuller fortryd',
		skip			: 'Skip',
		skipAll			: 'Skip alle',
		makeDecision	: 'Hvad skal der foretages?',
		rememberDecision: 'Husk denne indstilling'
	},

	dir : 'ltr',
	HelpLang : 'en',
	LangCode : 'da',

	// Date Format
	//		d    : Day
	//		dd   : Day (padding zero)
	//		m    : Month
	//		mm   : Month (padding zero)
	//		yy   : Year (two digits)
	//		yyyy : Year (four digits)
	//		h    : Hour (12 hour clock)
	//		hh   : Hour (12 hour clock, padding zero)
	//		H    : Hour (24 hour clock)
	//		HH   : Hour (24 hour clock, padding zero)
	//		M    : Minute
	//		MM   : Minute (padding zero)
	//		a    : Firt char of AM/PM
	//		aa   : AM/PM
	DateTime : 'dd-mm-yyyy HH:MM',
	DateAmPm : ['AM', 'PM'],

	// Folders
	FoldersTitle	: 'Mapper',
	FolderLoading	: 'Indlæser...',
	FolderNew		: 'Skriv navnet på den nye mappe: ',
	FolderRename	: 'Skriv det nye navn på mappen: ',
	FolderDelete	: 'Er du sikker på, at du vil slette mappen "%1" ?',
	FolderRenaming	: ' (Omdøber...)',
	FolderDeleting	: ' (Sletter...)',

	// Files
	FileRename		: 'Skriv navnet på den nye fil: ',
	FileRenameExt	: 'Er du sikker på, at du vil ændre filtypen? Filen kan muligvis ikke bruges bagefter.',
	FileRenaming	: '(Omdøber...)',
	FileDelete		: 'Er du sikker på, at du vil slette filen "%1" ?',
	FilesLoading	: 'Indlæser...',
	FilesEmpty		: 'Tom mappe',
	FilesMoved		: 'Filen %1 flyttet til %2:%3',
	FilesCopied		: 'Filen %1 kopieret til %2:%3',

	// Basket
	BasketFolder		: 'Kurv',
	BasketClear			: 'Tøm kurv',
	BasketRemove		: 'Fjern fra kurv',
	BasketOpenFolder	: 'Åben overordnet mappe',
	BasketTruncateConfirm : 'Er du sikker på at du vil tømme kurven?',
	BasketRemoveConfirm	: 'Er du sikker på at du vil slette filen "%1" fra kurven?',
	BasketEmpty			: 'Ingen filer i kurven, brug musen til at trække filer til kurven.',
	BasketCopyFilesHere	: 'Kopier Filer fra kurven',
	BasketMoveFilesHere	: 'Flyt Filer fra kurven',

	BasketPasteErrorOther	: 'Fil fejl: %e',
	BasketPasteMoveSuccess	: 'Følgende filer blev flyttet: %s',
	BasketPasteCopySuccess	: 'Følgende filer blev kopieret: %s',

	// Toolbar Buttons (some used elsewhere)
	Upload		: 'Upload',
	UploadTip	: 'Upload ny fil',
	Refresh		: 'Opdatér',
	Settings	: 'Indstillinger',
	Help		: 'Hjælp',
	HelpTip		: 'Hjælp',

	// Context Menus
	Select			: 'Vælg',
	SelectThumbnail : 'Vælg thumbnail',
	View			: 'Vis',
	Download		: 'Download',

	NewSubFolder	: 'Ny undermappe',
	Rename			: 'Omdøb',
	Delete			: 'Slet',

	CopyDragDrop	: 'Kopier hertil',
	MoveDragDrop	: 'Flyt hertil',

	// Dialogs
	RenameDlgTitle		: 'Omdøb',
	NewNameDlgTitle		: 'Nyt navn',
	FileExistsDlgTitle	: 'Filen eksisterer allerede',
	SysErrorDlgTitle : 'System fejl',

	FileOverwrite	: 'Overskriv',
	FileAutorename	: 'Auto-omdøb',

	// Generic
	OkBtn		: 'OK',
	CancelBtn	: 'Annullér',
	CloseBtn	: 'Luk',

	// Upload Panel
	UploadTitle			: 'Upload ny fil',
	UploadSelectLbl		: 'Vælg den fil, som du vil uploade',
	UploadProgressLbl	: '(Uploader, vent venligst...)',
	UploadBtn			: 'Upload filen',
	UploadBtnCancel		: 'Annuller',

	UploadNoFileMsg		: 'Vælg en fil på din computer',
	UploadNoFolder		: 'Venligst vælg en mappe før upload startes.',
	UploadNoPerms		: 'Upload er ikke tilladt.',
	UploadUnknError		: 'Fejl ved upload.',
	UploadExtIncorrect	: 'Denne filtype er ikke tilladt i denne mappe.',

	// Settings Panel
	SetTitle		: 'Indstillinger',
	SetView			: 'Vis:',
	SetViewThumb	: 'Thumbnails',
	SetViewList		: 'Liste',
	SetDisplay		: 'Thumbnails:',
	SetDisplayName	: 'Filnavn',
	SetDisplayDate	: 'Dato',
	SetDisplaySize	: 'Størrelse',
	SetSort			: 'Sortering:',
	SetSortName		: 'efter filnavn',
	SetSortDate		: 'efter dato',
	SetSortSize		: 'efter størrelse',

	// Status Bar
	FilesCountEmpty : '<tom mappe>',
	FilesCountOne	: '1 fil',
	FilesCountMany	: '%1 filer',

	// Size and Speed
	Kb				: '%1 kB',
	KbPerSecond		: '%1 kB/s',

	// Connector Error Messages.
	ErrorUnknown	: 'Det var ikke muligt at fuldføre handlingen. (Fejl: %1)',
	Errors :
	{
	 10 : 'Ugyldig handling.',
	 11 : 'Ressourcetypen blev ikke angivet i anmodningen.',
	 12 : 'Ressourcetypen er ikke gyldig.',
	102 : 'Ugyldig fil eller mappenavn.',
	103 : 'Det var ikke muligt at fuldføre handlingen på grund af en begrænsning i rettigheder.',
	104 : 'Det var ikke muligt at fuldføre handlingen på grund af en begrænsning i filsystem rettigheder.',
	105 : 'Ugyldig filtype.',
	109 : 'Ugyldig anmodning.',
	110 : 'Ukendt fejl.',
	115 : 'En fil eller mappe med det samme navn eksisterer allerede.',
	116 : 'Mappen blev ikke fundet. Opdatér listen eller prøv igen.',
	117 : 'Filen blev ikke fundet. Opdatér listen eller prøv igen.',
	118 : 'Originalplacering og destination er ens',
	201 : 'En fil med det samme filnavn eksisterer allerede. Den uploadede fil er blevet omdøbt til "%1"',
	202 : 'Ugyldig fil.',
	203 : 'Ugyldig fil. Filstørrelsen er for stor.',
	204 : 'Den uploadede fil er korrupt.',
	205 : 'Der er ikke en midlertidig mappe til upload til rådighed på serveren.',
	206 : 'Upload annulleret af sikkerhedsmæssige årsager. Filen indeholder HTML-lignende data.',
	207 : 'Den uploadede fil er blevet omdøbt til "%1"',
	300 : 'Flytning af fil(er) fejlede.',
	301 : 'Kopiering af fil(er) fejlede.',
	500 : 'Filbrowseren er deaktiveret af sikkerhedsmæssige årsager. Kontakt systemadministratoren eller kontrollér CKFinders konfigurationsfil.',
	501 : 'Understøttelse af thumbnails er deaktiveret.'
	},

	// Other Error Messages.
	ErrorMsg :
	{
		FileEmpty		: 'Filnavnet må ikke være tomt',
		FileExists		: 'Fil %erne eksisterer allerede',
		FolderEmpty		: 'Mappenavnet må ikke være tomt',

		FileInvChar		: 'Filnavnet må ikke indeholde et af følgende tegn: \n\\ / : * ? " < > |',
		FolderInvChar	: 'Mappenavnet må ikke indeholde et af følgende tegn: \n\\ / : * ? " < > |',

		PopupBlockView	: 'Det var ikke muligt at åbne filen i et nyt vindue. Kontrollér konfigurationen i din browser, og deaktivér eventuelle popup-blokkere for denne hjemmeside.'
	},

	// Imageresize plugin
	Imageresize :
	{
		dialogTitle		: 'Rediger størrelse %s',
		sizeTooBig		: 'Kan ikke ændre billedets højde eller bredde til en værdi større end dets originale størrelse (%size).',
		resizeSuccess	: 'Størrelsen er nu ændret.',
		thumbnailNew	: 'Opret ny thumbnail',
		thumbnailSmall	: 'Lille (%s)',
		thumbnailMedium	: 'Mellem (%s)',
		thumbnailLarge	: 'Stor (%s)',
		newSize			: 'Rediger størrelse',
		width			: 'Bredde',
		height			: 'Højde',
		invalidHeight	: 'Ugyldig højde.',
		invalidWidth	: 'Ugyldig bredde.',
		invalidName		: 'Ugyldigt filenavn.',
		newImage		: 'Opret nyt billede.',
		noExtensionChange : 'Filtypen kan ikke ændres.',
		imageSmall		: 'Originalfilen er for lille',
		contextMenuName	: 'Rediger størrelse'
	},

	// Fileeditor plugin
	Fileeditor :
	{
		save			: 'Gem',
		fileOpenError	: 'Filen kan ikke åbnes.',
		fileSaveSuccess	: 'Filen er nu gemt.',
		contextMenuName	: 'Rediger',
		loadingFile		: 'Henter fil, vent venligst...'
	}
};


text:
using System;

namespace NJasmine.Core.NativeWrappers
{
    public interface INativeTest
    {
        TestName Name { get; }
        void AddCategory(string category);
        void AddChild(INativeTest test);
        void MarkTestIgnored(string reasonIgnored);
        void MarkTestInvalid(string reason);
        void MarkTestFailed(Exception exception);
        object GetNative();
    }
}


text:
struct DepthMaterial {
    CBV_SRV_UAV *m_pTransparency = NULL;
    std::map<std::string, std::string> m_defines;
};

struct DepthPrimitives {
    UINT m_NumIndices;
    D3D12_INDEX_BUFFER_VIEW m_IBV;
    std::vector<D3D12_VERTEX_BUFFER_VIEW> m_VBV;

    DepthMaterial *m_pMaterial = NULL;

    Microsoft::WRL::ComPtr<ID3D12RootSignature>    m_RootSignature;
    Microsoft::WRL::ComPtr<ID3D12PipelineState>    m_PipelineRender;
    SAMPLER                                    *m_sampler;
};

struct DepthMesh {
    std::vector<DepthPrimitives> m_pPrimitives;
};

class GltfDepthPass : public GltfTechnique {
  public:
    struct per_batch {
        DirectX::XMMATRIX mViewProj;
    };

    bool OnCreate(
        ID3D12Device* pDevice,
        UploadHeapDX12* pUploadHeap,
        ResourceViewHeapsDX12 *pHeaps,
        DynamicBufferRingDX12 *pDynamicBufferRing,
        StaticBufferPoolDX12 *pStaticBufferPool,
        GLTFCommon *pGLTFData, void *pluginManager, void *msghandler);

    void OnDestroy();
    GltfDepthPass::per_batch *SetPerBatchConstants();

  private:
    std::vector<TextureDX12> m_textures;
    std::vector<DepthMesh> m_meshes;

    SAMPLER m_sampler;

    D3D12_GPU_DESCRIPTOR_HANDLE m_perBatchDesc;
    void DrawMesh(ID3D12GraphicsCommandList* pCommandList, int meshIndex, DirectX::XMMATRIX worldMatrix);
    bool CreateGeometry(tfAccessor indexBuffer, std::vector<tfAccessor> vertexBuffers, DepthPrimitives *pPrimitive);
    void CreatePipeline(ID3D12Device* pDevice, UINT node, std::vector<std::string> semanticNames, std::vector<D3D12_INPUT_ELEMENT_DESC> layout, DepthPrimitives *pPrimitive);
};


text:
'use strict';

var
  asserters = require('./asserters'),
  helpers   = require('./helpers')
;

module.exports = function CommonApi() {

  for (var method in helpers) {
    this[method] = helpers[method];
  }

  for (var method in asserters) {
    this[method] = asserters[method];
  }

  return this;
};