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

<title>TriggerExecutor (apache-cassandra API)</title>
<meta name="date" content="2014-09-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.triggers

Class TriggerExecutor

java.lang.Object

org.apache.cassandra.triggers.TriggerExecutor

public class TriggerExecutor
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field and Description

static TriggerExecutor
instance

Method Summary

Methods

Modifier and Type
Method and Description

ColumnFamily
execute(java.nio.ByteBuffer key,
       ColumnFamily updates)

java.util.Collection<Mutation>
execute(java.util.Collection<? extends IMutation> mutations)

ITrigger
loadTriggerInstance(java.lang.String triggerName)

void
reloadClasses()

Reload the triggers which is already loaded, Invoking this will update
 the class loader so new jars can be loaded.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

instance

public static final TriggerExecutor instance

Method Detail

reloadClasses

public void reloadClasses()

Reload the triggers which is already loaded, Invoking this will update
 the class loader so new jars can be loaded.

execute

public ColumnFamily execute(java.nio.ByteBuffer key,
                   ColumnFamily updates)
                     throws InvalidRequestException

Throws:

InvalidRequestException

execute

public java.util.Collection<Mutation> execute(java.util.Collection<? extends IMutation> mutations)
                                       throws InvalidRequestException

Throws:

InvalidRequestException

loadTriggerInstance

public ITrigger loadTriggerInstance(java.lang.String triggerName)
                             throws java.lang.Exception

Throws:

java.lang.Exception

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2014 The Apache Software Foundation


text:
console.log("loading index.js...");

var genny = angular.module('genny', ['onsen', 'random-name-generator', 'x2js', 'uuid']).

constant('version', {
    full: '0.1.0',
    major: '0',
    minor: '1',
    dot: '3',
    codeName: "..."
}).

service('dice', function diceCalculator() {
    this.roll = window.dice.roll;
    this.stringify = window.dice.stringify;
    this.statistics = window.dice.statistics;
}).

controller('TabbarCtrl', function TabbarCtrl($scope, version) {
    $scope.genny = { version: version };
}).

controller('HomePageCtrl', ['$scope', function HomePageCtrl($scope) {

}]).

controller('DiceBagCtrl', function($scope, dice) {
    var d4 = "d4", d6 = "d6", d8 = "d8", d10 = "d10", d12 = "d12", d20 = "d20", d100 = "d100";
    var validDice = [d4, d6, d8, d10, d12, d20, d100];
    var darkDice = true;

    function die2fontChar(dieType, dieFace) {
        dieFace = parseInt(dieFace, 10);
        if (dieType == d4)
            dieFace = (dieFace * 3) - (Math.floor(Math.random() * (3)));

        if (validDice.indexOf(dieType, 0) >= 0) {
            if (dieType == d100) {
                var tens = Math.floor(dieFace / 10) % 10;
                var ones = dieFace % 10;
                dieFace = String.fromCharCode(75 + tens, 65 + ones);
            }
            else {
                if (dieType == d10) dieFace = (dieFace % 10) +1;
                dieFace = String.fromCharCode(64+dieFace);
            }
        }
        else {
            dieFace = dieType + ":" + dieFace;
        }
        return darkDice ? dieFace : dieFace.toLowerCase();
    }

    function buildDiceObj(diceString) {
        var regexp = /([\+\-\*\/])|(\d+\b)|((\d+)d(?:\d*\.\.)?(\d+):\[((?:\d\,?\s?)+)\])/g;
        var diceRoll = [];
        var match;
        var op = "";
        while (match = regexp.exec(diceString)) {
            if (match[1]) {
                diceRoll.push(["op", match[1], match[1]]);
            }
            else if (match[2]) {
                diceRoll.push(["", match[2], match[2]]);
            }
            else if (match[3]) {
                var rolls = match[6].toString().split(", ");
                for (var i = 0; i < match[4]; i++) {
                    diceRoll.push(["d" + match[5], rolls[i], die2fontChar("d" + match[5], rolls[i])]);
                }
            }
        }
        return diceRoll;
    }

    $scope.diceRoll = {
        string: "",
        scope: {},
        result: "",
        resultString: "",
        roll: []
    };

    $scope.rollIt = function() {
        var res;
        try {
            res = dice.roll($scope.diceRoll.string, $scope.diceRoll.scope);
            $scope.diceRoll.result = res;
            $scope.diceRoll.resultString = dice.stringify(res);
            $scope.diceRoll.roll = buildDiceObj(dice.stringify(res));
        } catch(e) {
            console.warn("tried to roll \"" + $scope.diceRoll.string + "\"");
            $scope.diceRoll.result = "";
            $scope.diceRoll.resultString = "";
            $scope.diceRoll.roll = [["","","Bad Roll"]];
            console.log(e);
        }
    };
}).

controller('CharacterPageCtrl', function($scope, dice, nameGenerator, x2js, uuid) {
    $scope.data = {};

    $scope.characters = [
        {name: 'Alice', id: 0},
        {name: 'Bob', id: 1}
    ];

    $scope.newCharacter = function() { console.log("New Character!") };

    var loadData = function(data) {
        $scope.data = data;
        console.log(data);
    };

    var initPage = function(event) {
        if (event.index == 2) {
            x2js.init({
//            escapeMode :                true,   //true|false - Escaping XML characters. Default is true from v1.1.0+
//            attributePrefix :           "_",    //"<string>" - Prefix for XML attributes in JSon model. Default is "_"
//            arrayAccessForm :           "none", //"none"|"property" - The array access form (none|property). Use this property if you want X2JS generates additional property _asArray to access in array form for any XML element. Default is none from v1.1.0+
//            emptyNodeForm :             "text", //"text"|"object" - Handling empty nodes (text|object) mode. When X2JS found empty node like it will be transformed to test : '' for 'text' mode, or to Object for 'object' mode. Default is 'text'
//            enableToStringFunc :        true,   //true|false - Enable/disable an auxiliary function in generated JSON objects to print text nodes with text/cdata. Default is true
//            arrayAccessFormPaths :      [],     //[] - Array access paths - use this option to configure paths to XML elements always in "array form". You can configure beforehand paths to all your array elements based on XSD or your knowledge. Every path could be a simple string (like 'parent.child1.child2'), a regex (like /.*.child2/), or a custom function. Default is empty
//            skipEmptyTextNodesForObj :  false,  //true|false - Skip empty text tags for nodes with children. Default is true.
//            stripWhitespaces :          true,   //true|false - Strip whitespaces (trimming text nodes). Default is true.
//            datetimeAccessFormPaths :   [],     //[] - DateTime access paths. Use this option to configure paths to XML elements for XML datetime elements. You can configure beforehand paths to all your datetime elements based on XSD or your knowledge. Every path could be a simple string (like 'parent.child1.child2'), a regex (like /.*.child2/), or a custom function. Default is empty.
//            useDoubleQuotes :           false,  //true|false - Use double quotes for output XML formatting. Default is false.
//            xmlElementsFilter :         [],     //[] - Filter incoming XML elements. You can pass a stringified path (like 'parent.child1.child2'), regexp or function
//            jsonPropertiesFilter :      [],     //[] - Filter JSON properties for output XML. You can pass a stringified path (like 'parent.child1.child2'), regexp or function
            keepCData :                 true   //true|false - If this property defined as false and an XML element has only CData node it will be converted to text without additional property "__cdata". Default is false.
        });
            x2js.get('./data/Full Compendium.xml', loadData);
            tabbar.off('postchange', initPage);
            console.log(uuid.generate());
        }
    };
    ons.ready(function() {
        tabbar.on('postchange', initPage);
    });
}).

controller('NameListsCtrl', function($scope, nameGenerator) {
    nameGenerator.initialize('components/random-name-generator/dist/names.json');
    $scope.name = "";
    $scope.getName = function() {
        var fi = String.fromCharCode(Math.floor(Math.random() * (26))+64);
        var li = String.fromCharCode(Math.floor(Math.random() * (26))+64);
        var g = Math.floor(Math.random() * 2) ? 'male' : 'female';
        nameGenerator.generateName(fi,li,g).
            then(function(response){
                if (response.search(/undefined/) == -1) {
                    $scope.name = response;
                } else {
                    $scope.getName();
                }
            },function(reason){
                console.log(reason);
            });
    };
})
;

//function rad62(num) {
//    if (num === NaN) throw {message: num + "is not a number", name: "UserException"};
//    var chars = [];
//    for (var i = 0; i < 10; chars.push(String(i++)));
//    for (var i = 0; i < 26; chars.push(String.fromCharCode(++i + 64)));
//    for (var i = 0; i < 26; chars.push(String.fromCharCode(++i + 96)));
//
//    var str = "";
//    while (num > 0) {
//        console.log(num);
//        str = chars[num % 62] + str;
//        num = Math.floor(num/62);
//    }
//    return str;
//}
//

redpajama_set_name: RedPajamaGithub


text:
"""add enrolling status

Revision ID: 2be6f6d054e8
Revises: f17f0686ea6b
Create Date: 2018-03-21 13:57:41.685020

"""
import model.utils
import sqlalchemy as sa
from alembic import op

from rdr_service.model.site_enums import EnrollingStatus

# revision identifiers, used by Alembic.
revision = "2be6f6d054e8"
down_revision = "f17f0686ea6b"
branch_labels = None
depends_on = None

def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()

def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()

def upgrade_rdr():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("site", sa.Column("enrolling_status", model.utils.Enum(EnrollingStatus), nullable=True))
    # ### end Alembic commands ###

def downgrade_rdr():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("site", "enrolling_status")
    # ### end Alembic commands ###

def upgrade_metrics():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

def downgrade_metrics():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


text:
[Home](./index.md) > [puppeteer](./puppeteer.md) > [FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md)

## FrameWaitForFunctionOptions interface

Signature:

```typescript
export interface FrameWaitForFunctionOptions
```

## Properties

|  Property | Type | Description |
|  --- | --- | --- |
|  [polling](./puppeteer.framewaitforfunctionoptions.polling.md) | string \| number | An interval at which the pageFunction is executed, defaults to raf. If polling is a number, then it is treated as an interval in milliseconds at which the function would be executed. If polling is a string, then it can be one of the following values:- raf - to constantly execute pageFunction in requestAnimationFrame callback. This is the tightest polling mode which is suitable to observe styling changes.- mutation - to execute pageFunction on every DOM mutation. |
|  [timeout](./puppeteer.framewaitforfunctionoptions.timeout.md) | number | Maximum time to wait in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable the timeout. Puppeteer's default timeout can be changed using [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md). |


text:
package quizleague.util

package object collection {
  def Desc[T : Ordering] = implicitly[Ordering[T]].reverse
  def Asc[T : Ordering] = implicitly[Ordering[T]]
}


text:
source ./build-info.sh
export METEOR_SETTINGS=$(cat settings.json)
meteor add rocketchat:livechat
meteor add rocketchat:hubot
meteor add-platform ios
meteor build --server https://demo.rocket.chat --directory /var/www/rocket.chat
cd /var/www/rocket.chat/bundle/programs/server
npm install
cd /var/www/rocket.chat/current
pm2 startOrRestart /var/www/rocket.chat/current/pm2.json


text:
require 'test_helper'

class MapboxTest < GeocoderTestCase

  def setup
    Geocoder.configure(lookup: :mapbox)
    set_api_key!(:mapbox)
  end

  def test_url_contains_api_key
    Geocoder.configure(mapbox: {api_key: "abc123"})
    query = Geocoder::Query.new("Leadville, CO")
    assert_equal "https://api.mapbox.com/geocoding/v5/mapbox.places/Leadville%2C+CO.json?access_token=abc123", query.url
  end

  def test_result_components
    result = Geocoder.search("Madison Square Garden, New York, NY").first
    assert_equal [-73.991566, 40.749688], result.coordinates
    assert_equal "Madison Square Garden", result.place_name
    assert_equal "4 Penn Plz", result.street
    assert_equal "New York", result.city
    assert_equal "New York", result.state
    assert_equal "10001", result.postal_code
    assert_equal "United States", result.country
    assert_equal "Garment District", result.neighborhood
    assert_equal "10001", result.postal_code
    assert_equal "Madison Square Garden, 4 Penn Plz, New York, New York, 10001, United States", result.address
  end

  def test_no_results
    assert_equal [], Geocoder.search("no results")
  end

  def test_raises_exception_with_invalid_api_key
    Geocoder.configure(always_raise: [Geocoder::InvalidApiKey])
    assert_raises Geocoder::InvalidApiKey do
      Geocoder.search("invalid api key")
    end
  end
end


text:
package com.atlassian.plugin.servlet;

import com.atlassian.plugin.servlet.util.ClassLoaderStack;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Enumeration;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;

/**
 * Wraps a HttpSession for consumption by OSGi plugins in order to workaround Weblogic problems caused by setting
 * different Context ClassLoaders.
 * See https://studio.atlassian.com/browse/PLUG-515
 *
 * @since 2.3.9
 */
public class PluginHttpSessionWrapper implements HttpSession
{
    private HttpSession delegate;
    private static final Logger log = LoggerFactory.getLogger(PluginHttpSessionWrapper.class);

    public PluginHttpSessionWrapper(final HttpSession session)
    {
        this.delegate = session;
    }

    public Object getAttribute(final String name)
    {
        // Trick WLS by putting the WebAppClassLoader back into this thread's ContextClassLoader for the duration of the
        //  getAttribute() call. See PLUG-515.
        ClassLoader classLoader = ClassLoaderStack.pop();
        try
        {
            if (log.isDebugEnabled())
            {
                log.debug("getAttribute('" + name + "') Popping ClassLoader: " + classLoader + " .New ContextClassLoader: " + Thread.currentThread().getContextClassLoader());
            }
            return delegate.getAttribute(name);
        }
        finally
        {
            // Reset to the Plugins ClassLoader and let OSGi continue to do its ClassLoader voodoo.
            ClassLoaderStack.push(classLoader);
        }
    }

    public void setAttribute(final String name, final Object value)
    {
        // Trick WLS by putting the WebAppClassLoader back into this thread's ContextClassLoader for the duration of the
        // method call. See PLUG-515.
        ClassLoader classLoader = ClassLoaderStack.pop();
        try
        {
            delegate.setAttribute(name, value);
        }
        finally
        {
            // Reset to the Plugins ClassLoader and let OSGi continue to do its ClassLoader voodoo.
            ClassLoaderStack.push(classLoader);
        }
    }

    public Object getValue(final String name)
    {
        // Trick WLS by putting the WebAppClassLoader back into this thread's ContextClassLoader for the duration of the
        // method call. See PLUG-515.
        ClassLoader classLoader = ClassLoaderStack.pop();
        try
        {
            //noinspection deprecation
            return delegate.getValue(name);
        }
        finally
        {
            // Reset to the Plugins ClassLoader and let OSGi continue to do its ClassLoader voodoo.
            ClassLoaderStack.push(classLoader);
        }
    }

    public void putValue(final String name, final Object value)
    {
        // Trick WLS by putting the WebAppClassLoader back into this thread's ContextClassLoader for the duration of the
        // method call. See PLUG-515.
        ClassLoader classLoader = ClassLoaderStack.pop();
        try
        {
            //noinspection deprecation
            delegate.putValue(name, value);
        }
        finally
        {
            // Reset to the Plugins ClassLoader and let OSGi continue to do its ClassLoader voodoo.
            ClassLoaderStack.push(classLoader);
        }
    }

    public long getCreationTime()
    {
        return delegate.getCreationTime();
    }

    public String getId()
    {
        return delegate.getId();
    }

    public long getLastAccessedTime()
    {
        return delegate.getLastAccessedTime();
    }

    public ServletContext getServletContext()
    {
        return delegate.getServletContext();
    }

    public void setMaxInactiveInterval(final int interval)
    {
        delegate.setMaxInactiveInterval(interval);
    }

    public int getMaxInactiveInterval()
    {
        return delegate.getMaxInactiveInterval();
    }

    @SuppressWarnings ({ "deprecation" })
    public javax.servlet.http.HttpSessionContext getSessionContext()
    {
        return delegate.getSessionContext();
    }

    public Enumeration getAttributeNames()
    {
        return delegate.getAttributeNames();
    }

    @SuppressWarnings ({ "deprecation" })
    public String[] getValueNames()
    {
        return delegate.getValueNames();
    }

    public void removeAttribute(final String name)
    {
        delegate.removeAttribute(name);
    }

    @SuppressWarnings ({ "deprecation" })
    public void removeValue(final String name)
    {
        delegate.removeValue(name);
    }

    public void invalidate()
    {
        delegate.invalidate();
    }

    public boolean isNew()
    {
        return delegate.isNew();
    }
}


text:
package org.owasp.dependencycheck.data.update;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import javax.annotation.concurrent.ThreadSafe;
import org.apache.commons.io.IOUtils;
import org.owasp.dependencycheck.Engine;
import org.owasp.dependencycheck.data.update.exception.UpdateException;
import org.owasp.dependencycheck.utils.InvalidSettingException;
import org.owasp.dependencycheck.utils.Settings;
import org.owasp.dependencycheck.utils.URLConnectionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Checks the gh-pages dependency-check site to determine the current released
 * version number. If the released version number is greater than the running
 * version number a warning is printed recommending that an upgrade be
 * performed.
 *
 * @author Jeremy Long
 */
@ThreadSafe
public class RetireJSDataSource implements CachedWebDataSource {

    /**
     * Static logger.
     */
    private static final Logger LOGGER = LoggerFactory.getLogger(RetireJSDataSource.class);
    /**
     * The property key indicating when the last update occurred.
     */
    public static final String RETIREJS_UPDATED_ON = "RetireJSUpdatedOn";
    /**
     * The configured settings.
     */
    private Settings settings;
    /**
     * The default URL to the RetireJS JavaScript repository.
     */
    private static final String DEFAULT_JS_URL = "https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json";

    /**
     * Constructs a new engine version check utility for testing.
     *
     * @param settings the configured settings
     */
    protected RetireJSDataSource(Settings settings) {
        this.settings = settings;
    }

    /**
     * Constructs a new engine version check utility.
     */
    public RetireJSDataSource() {
    }

    /**
     * Downloads the current RetireJS data source.
     *
     * @throws UpdateException thrown if the update failed
     */
    @Override
    public void update(Engine engine) throws UpdateException {
        this.settings = engine.getSettings();
        String url = null;
        try {
            final boolean autoupdate = settings.getBoolean(Settings.KEYS.AUTO_UPDATE, true);
            final boolean enabled = settings.getBoolean(Settings.KEYS.ANALYZER_RETIREJS_ENABLED, true);
            final File repoFile = new File(settings.getDataDirectory(), "jsrepository.json");
            final boolean proceed = enabled && autoupdate && shouldUpdagte(repoFile);
            if (proceed) {
                LOGGER.debug("Begin RetireJS Update");
                url = settings.getString(Settings.KEYS.ANALYZER_RETIREJS_REPO_JS_URL, DEFAULT_JS_URL);
                initializeRetireJsRepo(settings, new URL(url));
            }
        } catch (InvalidSettingException ex) {
            throw new UpdateException("Unable to determine if autoupdate is enabled", ex);
        } catch (MalformedURLException ex) {
            throw new UpdateException(String.format("Inavlid URL for RetireJS repository (%s)", url), ex);
        } catch (IOException ex) {
            throw new UpdateException("Unable to get the data directory", ex);
        }
    }

    /**
     * Determines if the we should update the RetireJS database.
     *
     * @param repo the retire JS repository.
     * @return true if an updated to the RetireJS database should
     * be performed; otherwise false
     * @throws NumberFormatException thrown if an invalid value is contained in
     * the database properties
     */
    protected boolean shouldUpdagte(File repo) throws NumberFormatException {
        boolean proceed = true;
        if (repo != null && repo.isFile()) {
            final int validForHours = settings.getInt(Settings.KEYS.ANALYZER_RETIREJS_REPO_VALID_FOR_HOURS, 0);
            final long lastUpdatedOn = repo.lastModified();
            final long now = System.currentTimeMillis();
            LOGGER.debug("Last updated: {}", lastUpdatedOn);
            LOGGER.debug("Now: {}", now);
            final long msValid = validForHours * 60L * 60L * 1000L;
            proceed = (now - lastUpdatedOn) > msValid;
            if (!proceed) {
                LOGGER.info("Skipping RetireJS update since last update was within {} hours.", validForHours);
            }
        }
        return proceed;
    }

    /**
     * Initializes the local RetireJS repository
     *
     * @param settings a reference to the dependency-check settings
     * @param repoUrl the URL to the RetireJS repo to use
     * @throws UpdateException thrown if there is an exception during
     * initialization
     */
    private void initializeRetireJsRepo(Settings settings, URL repoUrl) throws UpdateException {
        try {
            final File dataDir = settings.getDataDirectory();
            final File tmpDir = settings.getTempDirectory();
            boolean useProxy = false;
            if (null != settings.getString(Settings.KEYS.PROXY_SERVER)) {
                useProxy = true;
                LOGGER.debug("Using proxy");
            }
            LOGGER.debug("RetireJS Repo URL: {}", repoUrl.toExternalForm());
            final URLConnectionFactory factory = new URLConnectionFactory(settings);
            final HttpURLConnection conn = factory.createHttpURLConnection(repoUrl, useProxy);
            final String filename = repoUrl.getFile().substring(repoUrl.getFile().lastIndexOf("/") + 1, repoUrl.getFile().length());
            if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
                final File tmpFile = new File(tmpDir, filename);
                final File repoFile = new File(dataDir, filename);
                try (InputStream inputStream = conn.getInputStream();
                        FileOutputStream outputStream = new FileOutputStream(tmpFile)) {
                    IOUtils.copy(inputStream, outputStream);
                }
                //using move fails if target and destination are on different disks which does happen (see #1394 and #1404)
                Files.copy(tmpFile.toPath(), repoFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
                if (!tmpFile.delete()) {
                    tmpFile.deleteOnExit();
                }
            }
        } catch (IOException e) {
            throw new UpdateException("Failed to initialize the RetireJS repo", e);
        }
    }
}


text:
lftpd
=====

The transportation daemon based on `lftp` - Sophisticated file transfer program.

Purpose
======
Two systems e.g. ERP inside the private office network and E-Commerce Shop on the Internet must exchange information.
* Let's send plain text (XML, JSON, CSV, etc) files back and forth
* Let's ERP be **master** and Internet Shop be **slave**. I.e. master has transportation program on its side. Slave has file transfer service (ftpd, sftpd or httpd) on its side. Thus local network (through all possible NATs, proxies, etc) can be simply connected via internet service of the slave.

This way two systems are connected in such a way that any files being put into master's local directory by **master** are transferred to the **slave** (its local income). Any files being put into slave's local (master's remote) directory are transferred to the master's income local directory.

Events of incoming data for both systems are non empty local income directories with file which extentions are like in config **$DATAEXT**. Successful transfer can be signaled by some external tools or by periodic check for files in corresponded directories by systems themselves.

Internal structure of transferred information is due of agreement of ERP and Shop developers.

All files are guaranteed to be available in whole. Any network problems, continuation of upload or download are handled by `lftp`.

Any of available protocols in `lftp` can be used: ftp, ftps, http, https, hftp, fish, sftp and file.

Example config with description how to exchange files is in **app.conf**.


text:
module MrWizard
  module Routing
    def wizard(map, name, *args)
      options = args.pop if args.last.kind_of? Hash
      options ||= Hash.new

      path_template = args.pop
      path_template ||= "/#{name}"

      controller = options[:controller] || name

      map.with_options(:controller => controller, :defaults => { :step => nil }) do |w|
        w.named_route(name.to_s, "#{path_template}/:step",
                      :action => 'show',
                      :conditions => { :method => :get })
        w.named_route("#{name}_form", "#{path_template}/:step",
                      :action => 'create',
                      :conditions => { :method => :post })
      end
    end
  end
end


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.frostwire.jlibtorrent.swig;

public class torrent_status {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected torrent_status(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(torrent_status obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        libtorrent_jni.delete_torrent_status(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public torrent_status() {
    this(libtorrent_jni.new_torrent_status__SWIG_0(), true);
  }

  public torrent_status(torrent_status arg0) {
    this(libtorrent_jni.new_torrent_status__SWIG_1(torrent_status.getCPtr(arg0), arg0), true);
  }

  public boolean op_eq(torrent_status st) {
    return libtorrent_jni.torrent_status_op_eq(swigCPtr, this, torrent_status.getCPtr(st), st);
  }

  public void setHandle(torrent_handle value) {
    libtorrent_jni.torrent_status_handle_set(swigCPtr, this, torrent_handle.getCPtr(value), value);
  }

  public torrent_handle getHandle() {
    long cPtr = libtorrent_jni.torrent_status_handle_get(swigCPtr, this);
    return (cPtr == 0) ? null : new torrent_handle(cPtr, false);
  }

  public void setErrc(error_code value) {
    libtorrent_jni.torrent_status_errc_set(swigCPtr, this, error_code.getCPtr(value), value);
  }

  public error_code getErrc() {
    long cPtr = libtorrent_jni.torrent_status_errc_get(swigCPtr, this);
    return (cPtr == 0) ? null : new error_code(cPtr, false);
  }

  public void setError_file(int value) {
    libtorrent_jni.torrent_status_error_file_set(swigCPtr, this, value);
  }

  public int getError_file() {
    return libtorrent_jni.torrent_status_error_file_get(swigCPtr, this);
  }

  public static int getError_file_none() {
    return libtorrent_jni.torrent_status_error_file_none_get();
  }

  public static int getError_file_ssl_ctx() {
    return libtorrent_jni.torrent_status_error_file_ssl_ctx_get();
  }

  public static int getError_file_metadata() {
    return libtorrent_jni.torrent_status_error_file_metadata_get();
  }

  public static int getError_file_exception() {
    return libtorrent_jni.torrent_status_error_file_exception_get();
  }

  public static int getError_file_partfile() {
    return libtorrent_jni.torrent_status_error_file_partfile_get();
  }

  public void setSave_path(String value) {
    libtorrent_jni.torrent_status_save_path_set(swigCPtr, this, value);
  }

  public String getSave_path() {
    return libtorrent_jni.torrent_status_save_path_get(swigCPtr, this);
  }

  public void setName(String value) {
    libtorrent_jni.torrent_status_name_set(swigCPtr, this, value);
  }

  public String getName() {
    return libtorrent_jni.torrent_status_name_get(swigCPtr, this);
  }

  public void setCurrent_tracker(String value) {
    libtorrent_jni.torrent_status_current_tracker_set(swigCPtr, this, value);
  }

  public String getCurrent_tracker() {
    return libtorrent_jni.torrent_status_current_tracker_get(swigCPtr, this);
  }

  public void setTotal_download(long value) {
    libtorrent_jni.torrent_status_total_download_set(swigCPtr, this, value);
  }

  public long getTotal_download() {
    return libtorrent_jni.torrent_status_total_download_get(swigCPtr, this);
  }

  public void setTotal_upload(long value) {
    libtorrent_jni.torrent_status_total_upload_set(swigCPtr, this, value);
  }

  public long getTotal_upload() {
    return libtorrent_jni.torrent_status_total_upload_get(swigCPtr, this);
  }

  public void setTotal_payload_download(long value) {
    libtorrent_jni.torrent_status_total_payload_download_set(swigCPtr, this, value);
  }

  public long getTotal_payload_download() {
    return libtorrent_jni.torrent_status_total_payload_download_get(swigCPtr, this);
  }

  public void setTotal_payload_upload(long value) {
    libtorrent_jni.torrent_status_total_payload_upload_set(swigCPtr, this, value);
  }

  public long getTotal_payload_upload() {
    return libtorrent_jni.torrent_status_total_payload_upload_get(swigCPtr, this);
  }

  public void setTotal_failed_bytes(long value) {
    libtorrent_jni.torrent_status_total_failed_bytes_set(swigCPtr, this, value);
  }

  public long getTotal_failed_bytes() {
    return libtorrent_jni.torrent_status_total_failed_bytes_get(swigCPtr, this);
  }

  public void setTotal_redundant_bytes(long value) {
    libtorrent_jni.torrent_status_total_redundant_bytes_set(swigCPtr, this, value);
  }

  public long getTotal_redundant_bytes() {
    return libtorrent_jni.torrent_status_total_redundant_bytes_get(swigCPtr, this);
  }

  public void setPieces(piece_index_bitfield value) {
    libtorrent_jni.torrent_status_pieces_set(swigCPtr, this, piece_index_bitfield.getCPtr(value), value);
  }

  public piece_index_bitfield getPieces() {
    long cPtr = libtorrent_jni.torrent_status_pieces_get(swigCPtr, this);
    return (cPtr == 0) ? null : new piece_index_bitfield(cPtr, false);
  }

  public void setVerified_pieces(piece_index_bitfield value) {
    libtorrent_jni.torrent_status_verified_pieces_set(swigCPtr, this, piece_index_bitfield.getCPtr(value), value);
  }

  public piece_index_bitfield getVerified_pieces() {
    long cPtr = libtorrent_jni.torrent_status_verified_pieces_get(swigCPtr, this);
    return (cPtr == 0) ? null : new piece_index_bitfield(cPtr, false);
  }

  public void setTotal_done(long value) {
    libtorrent_jni.torrent_status_total_done_set(swigCPtr, this, value);
  }

  public long getTotal_done() {
    return libtorrent_jni.torrent_status_total_done_get(swigCPtr, this);
  }

  public void setTotal(long value) {
    libtorrent_jni.torrent_status_total_set(swigCPtr, this, value);
  }

  public long getTotal() {
    return libtorrent_jni.torrent_status_total_get(swigCPtr, this);
  }

  public void setTotal_wanted_done(long value) {
    libtorrent_jni.torrent_status_total_wanted_done_set(swigCPtr, this, value);
  }

  public long getTotal_wanted_done() {
    return libtorrent_jni.torrent_status_total_wanted_done_get(swigCPtr, this);
  }

  public void setTotal_wanted(long value) {
    libtorrent_jni.torrent_status_total_wanted_set(swigCPtr, this, value);
  }

  public long getTotal_wanted() {
    return libtorrent_jni.torrent_status_total_wanted_get(swigCPtr, this);
  }

  public void setAll_time_upload(long value) {
    libtorrent_jni.torrent_status_all_time_upload_set(swigCPtr, this, value);
  }

  public long getAll_time_upload() {
    return libtorrent_jni.torrent_status_all_time_upload_get(swigCPtr, this);
  }

  public void setAll_time_download(long value) {
    libtorrent_jni.torrent_status_all_time_download_set(swigCPtr, this, value);
  }

  public long getAll_time_download() {
    return libtorrent_jni.torrent_status_all_time_download_get(swigCPtr, this);
  }

  public void setAdded_time(long value) {
    libtorrent_jni.torrent_status_added_time_set(swigCPtr, this, value);
  }

  public long getAdded_time() {
    return libtorrent_jni.torrent_status_added_time_get(swigCPtr, this);
  }

  public void setCompleted_time(long value) {
    libtorrent_jni.torrent_status_completed_time_set(swigCPtr, this, value);
  }

  public long getCompleted_time() {
    return libtorrent_jni.torrent_status_completed_time_get(swigCPtr, this);
  }

  public void setLast_seen_complete(long value) {
    libtorrent_jni.torrent_status_last_seen_complete_set(swigCPtr, this, value);
  }

  public long getLast_seen_complete() {
    return libtorrent_jni.torrent_status_last_seen_complete_get(swigCPtr, this);
  }

  public void setStorage_mode(storage_mode_t value) {
    libtorrent_jni.torrent_status_storage_mode_set(swigCPtr, this, value.swigValue());
  }

  public storage_mode_t getStorage_mode() {
    return storage_mode_t.swigToEnum(libtorrent_jni.torrent_status_storage_mode_get(swigCPtr, this));
  }

  public void setProgress(float value) {
    libtorrent_jni.torrent_status_progress_set(swigCPtr, this, value);
  }

  public float getProgress() {
    return libtorrent_jni.torrent_status_progress_get(swigCPtr, this);
  }

  public void setProgress_ppm(int value) {
    libtorrent_jni.torrent_status_progress_ppm_set(swigCPtr, this, value);
  }

  public int getProgress_ppm() {
    return libtorrent_jni.torrent_status_progress_ppm_get(swigCPtr, this);
  }

  public void setDownload_rate(int value) {
    libtorrent_jni.torrent_status_download_rate_set(swigCPtr, this, value);
  }

  public int getDownload_rate() {
    return libtorrent_jni.torrent_status_download_rate_get(swigCPtr, this);
  }

  public void setUpload_rate(int value) {
    libtorrent_jni.torrent_status_upload_rate_set(swigCPtr, this, value);
  }

  public int getUpload_rate() {
    return libtorrent_jni.torrent_status_upload_rate_get(swigCPtr, this);
  }

  public void setDownload_payload_rate(int value) {
    libtorrent_jni.torrent_status_download_payload_rate_set(swigCPtr, this, value);
  }

  public int getDownload_payload_rate() {
    return libtorrent_jni.torrent_status_download_payload_rate_get(swigCPtr, this);
  }

  public void setUpload_payload_rate(int value) {
    libtorrent_jni.torrent_status_upload_payload_rate_set(swigCPtr, this, value);
  }

  public int getUpload_payload_rate() {
    return libtorrent_jni.torrent_status_upload_payload_rate_get(swigCPtr, this);
  }

  public void setNum_seeds(int value) {
    libtorrent_jni.torrent_status_num_seeds_set(swigCPtr, this, value);
  }

  public int getNum_seeds() {
    return libtorrent_jni.torrent_status_num_seeds_get(swigCPtr, this);
  }

  public void setNum_peers(int value) {
    libtorrent_jni.torrent_status_num_peers_set(swigCPtr, this, value);
  }

  public int getNum_peers() {
    return libtorrent_jni.torrent_status_num_peers_get(swigCPtr, this);
  }

  public void setNum_complete(int value) {
    libtorrent_jni.torrent_status_num_complete_set(swigCPtr, this, value);
  }

  public int getNum_complete() {
    return libtorrent_jni.torrent_status_num_complete_get(swigCPtr, this);
  }

  public void setNum_incomplete(int value) {
    libtorrent_jni.torrent_status_num_incomplete_set(swigCPtr, this, value);
  }

  public int getNum_incomplete() {
    return libtorrent_jni.torrent_status_num_incomplete_get(swigCPtr, this);
  }

  public void setList_seeds(int value) {
    libtorrent_jni.torrent_status_list_seeds_set(swigCPtr, this, value);
  }

  public int getList_seeds() {
    return libtorrent_jni.torrent_status_list_seeds_get(swigCPtr, this);
  }

  public void setList_peers(int value) {
    libtorrent_jni.torrent_status_list_peers_set(swigCPtr, this, value);
  }

  public int getList_peers() {
    return libtorrent_jni.torrent_status_list_peers_get(swigCPtr, this);
  }

  public void setConnect_candidates(int value) {
    libtorrent_jni.torrent_status_connect_candidates_set(swigCPtr, this, value);
  }

  public int getConnect_candidates() {
    return libtorrent_jni.torrent_status_connect_candidates_get(swigCPtr, this);
  }

  public void setNum_pieces(int value) {
    libtorrent_jni.torrent_status_num_pieces_set(swigCPtr, this, value);
  }

  public int getNum_pieces() {
    return libtorrent_jni.torrent_status_num_pieces_get(swigCPtr, this);
  }

  public void setDistributed_full_copies(int value) {
    libtorrent_jni.torrent_status_distributed_full_copies_set(swigCPtr, this, value);
  }

  public int getDistributed_full_copies() {
    return libtorrent_jni.torrent_status_distributed_full_copies_get(swigCPtr, this);
  }

  public void setDistributed_fraction(int value) {
    libtorrent_jni.torrent_status_distributed_fraction_set(swigCPtr, this, value);
  }

  public int getDistributed_fraction() {
    return libtorrent_jni.torrent_status_distributed_fraction_get(swigCPtr, this);
  }

  public void setDistributed_copies(float value) {
    libtorrent_jni.torrent_status_distributed_copies_set(swigCPtr, this, value);
  }

  public float getDistributed_copies() {
    return libtorrent_jni.torrent_status_distributed_copies_get(swigCPtr, this);
  }

  public void setBlock_size(int value) {
    libtorrent_jni.torrent_status_block_size_set(swigCPtr, this, value);
  }

  public int getBlock_size() {
    return libtorrent_jni.torrent_status_block_size_get(swigCPtr, this);
  }

  public void setNum_uploads(int value) {
    libtorrent_jni.torrent_status_num_uploads_set(swigCPtr, this, value);
  }

  public int getNum_uploads() {
    return libtorrent_jni.torrent_status_num_uploads_get(swigCPtr, this);
  }

  public void setNum_connections(int value) {
    libtorrent_jni.torrent_status_num_connections_set(swigCPtr, this, value);
  }

  public int getNum_connections() {
    return libtorrent_jni.torrent_status_num_connections_get(swigCPtr, this);
  }

  public void setUploads_limit(int value) {
    libtorrent_jni.torrent_status_uploads_limit_set(swigCPtr, this, value);
  }

  public int getUploads_limit() {
    return libtorrent_jni.torrent_status_uploads_limit_get(swigCPtr, this);
  }

  public void setConnections_limit(int value) {
    libtorrent_jni.torrent_status_connections_limit_set(swigCPtr, this, value);
  }

  public int getConnections_limit() {
    return libtorrent_jni.torrent_status_connections_limit_get(swigCPtr, this);
  }

  public void setUp_bandwidth_queue(int value) {
    libtorrent_jni.torrent_status_up_bandwidth_queue_set(swigCPtr, this, value);
  }

  public int getUp_bandwidth_queue() {
    return libtorrent_jni.torrent_status_up_bandwidth_queue_get(swigCPtr, this);
  }

  public void setDown_bandwidth_queue(int value) {
    libtorrent_jni.torrent_status_down_bandwidth_queue_set(swigCPtr, this, value);
  }

  public int getDown_bandwidth_queue() {
    return libtorrent_jni.torrent_status_down_bandwidth_queue_get(swigCPtr, this);
  }

  public void setSeed_rank(int value) {
    libtorrent_jni.torrent_status_seed_rank_set(swigCPtr, this, value);
  }

  public int getSeed_rank() {
    return libtorrent_jni.torrent_status_seed_rank_get(swigCPtr, this);
  }

  public void setState(torrent_status.state_t value) {
    libtorrent_jni.torrent_status_state_set(swigCPtr, this, value.swigValue());
  }

  public torrent_status.state_t getState() {
    return torrent_status.state_t.swigToEnum(libtorrent_jni.torrent_status_state_get(swigCPtr, this));
  }

  public void setNeed_save_resume(boolean value) {
    libtorrent_jni.torrent_status_need_save_resume_set(swigCPtr, this, value);
  }

  public boolean getNeed_save_resume() {
    return libtorrent_jni.torrent_status_need_save_resume_get(swigCPtr, this);
  }

  public void setIs_seeding(boolean value) {
    libtorrent_jni.torrent_status_is_seeding_set(swigCPtr, this, value);
  }

  public boolean getIs_seeding() {
    return libtorrent_jni.torrent_status_is_seeding_get(swigCPtr, this);
  }

  public void setIs_finished(boolean value) {
    libtorrent_jni.torrent_status_is_finished_set(swigCPtr, this, value);
  }

  public boolean getIs_finished() {
    return libtorrent_jni.torrent_status_is_finished_get(swigCPtr, this);
  }

  public void setHas_metadata(boolean value) {
    libtorrent_jni.torrent_status_has_metadata_set(swigCPtr, this, value);
  }

  public boolean getHas_metadata() {
    return libtorrent_jni.torrent_status_has_metadata_get(swigCPtr, this);
  }

  public void setHas_incoming(boolean value) {
    libtorrent_jni.torrent_status_has_incoming_set(swigCPtr, this, value);
  }

  public boolean getHas_incoming() {
    return libtorrent_jni.torrent_status_has_incoming_get(swigCPtr, this);
  }

  public void setMoving_storage(boolean value) {
    libtorrent_jni.torrent_status_moving_storage_set(swigCPtr, this, value);
  }

  public boolean getMoving_storage() {
    return libtorrent_jni.torrent_status_moving_storage_get(swigCPtr, this);
  }

  public void setAnnouncing_to_trackers(boolean value) {
    libtorrent_jni.torrent_status_announcing_to_trackers_set(swigCPtr, this, value);
  }

  public boolean getAnnouncing_to_trackers() {
    return libtorrent_jni.torrent_status_announcing_to_trackers_get(swigCPtr, this);
  }

  public void setAnnouncing_to_lsd(boolean value) {
    libtorrent_jni.torrent_status_announcing_to_lsd_set(swigCPtr, this, value);
  }

  public boolean getAnnouncing_to_lsd() {
    return libtorrent_jni.torrent_status_announcing_to_lsd_get(swigCPtr, this);
  }

  public void setAnnouncing_to_dht(boolean value) {
    libtorrent_jni.torrent_status_announcing_to_dht_set(swigCPtr, this, value);
  }

  public boolean getAnnouncing_to_dht() {
    return libtorrent_jni.torrent_status_announcing_to_dht_get(swigCPtr, this);
  }

  public void setInfo_hash(sha1_hash value) {
    libtorrent_jni.torrent_status_info_hash_set(swigCPtr, this, sha1_hash.getCPtr(value), value);
  }

  public sha1_hash getInfo_hash() {
    long cPtr = libtorrent_jni.torrent_status_info_hash_get(swigCPtr, this);
    return (cPtr == 0) ? null : new sha1_hash(cPtr, false);
  }

  public void setFlags(torrent_flags_t value) {
    libtorrent_jni.torrent_status_flags_set(swigCPtr, this, torrent_flags_t.getCPtr(value), value);
  }

  public torrent_flags_t getFlags() {
    long cPtr = libtorrent_jni.torrent_status_flags_get(swigCPtr, this);
    return (cPtr == 0) ? null : new torrent_flags_t(cPtr, false);
  }

  public torrent_info torrent_file_ptr() {
    long cPtr = libtorrent_jni.torrent_status_torrent_file_ptr(swigCPtr, this);
    return (cPtr == 0) ? null : new torrent_info(cPtr, false);
  }

  public long get_next_announce() {
    return libtorrent_jni.torrent_status_get_next_announce(swigCPtr, this);
  }

  public long get_last_upload() {
    return libtorrent_jni.torrent_status_get_last_upload(swigCPtr, this);
  }

  public long get_last_download() {
    return libtorrent_jni.torrent_status_get_last_download(swigCPtr, this);
  }

  public long get_active_duration() {
    return libtorrent_jni.torrent_status_get_active_duration(swigCPtr, this);
  }

  public long get_finished_duration() {
    return libtorrent_jni.torrent_status_get_finished_duration(swigCPtr, this);
  }

  public long get_seeding_duration() {
    return libtorrent_jni.torrent_status_get_seeding_duration(swigCPtr, this);
  }

  public int get_queue_position() {
    return libtorrent_jni.torrent_status_get_queue_position(swigCPtr, this);
  }

  public final static class state_t {
    public final static torrent_status.state_t checking_files = new torrent_status.state_t("checking_files", libtorrent_jni.torrent_status_checking_files_get());
    public final static torrent_status.state_t downloading_metadata = new torrent_status.state_t("downloading_metadata");
    public final static torrent_status.state_t downloading = new torrent_status.state_t("downloading");
    public final static torrent_status.state_t finished = new torrent_status.state_t("finished");
    public final static torrent_status.state_t seeding = new torrent_status.state_t("seeding");
    public final static torrent_status.state_t checking_resume_data = new torrent_status.state_t("checking_resume_data", libtorrent_jni.torrent_status_checking_resume_data_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static state_t swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + state_t.class + " with value " + swigValue);
    }

    private state_t(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private state_t(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private state_t(String swigName, state_t swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static state_t[] swigValues = { checking_files, downloading_metadata, downloading, finished, seeding, checking_resume_data };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}


text:
package org.apache.geode.internal.cache;

import static org.junit.Assert.*;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;

import org.apache.logging.log4j.Logger;
import org.junit.Test;

import org.apache.geode.cache.AttributesFactory;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.Operation;
import org.apache.geode.cache.RegionAttributes;
import org.apache.geode.cache.Scope;
import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.internal.cache.versions.VersionTag;
import org.apache.geode.internal.logging.LogService;
import org.apache.geode.test.fake.Fakes;

public abstract class AbstractDistributedRegionJUnitTest {

  protected static final Logger logger = LogService.getLogger();

  private RegionAttributes createRegionAttributes(boolean isConcurrencyChecksEnabled) {
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    factory.setConcurrencyChecksEnabled(isConcurrencyChecksEnabled); //
    RegionAttributes ra = factory.create();
    return ra;
  }

  private EventID createDummyEventID() {
    byte[] memId = {1, 2, 3};
    EventID eventId = new EventID(memId, 11, 12, 13);
    return eventId;
  }

  private EntryEventImpl createDummyEvent(DistributedRegion region) {
    // create a dummy event id
    EventID eventId = createDummyEventID();
    String key = "key1";
    String value = "Value1";

    // create an event
    EntryEventImpl event = EntryEventImpl.create(region, Operation.CREATE, key, value, null,
        false /* origin remote */, null, false /* generateCallbacks */, eventId);
    // avoid calling invokeCallbacks
    event.callbacksInvoked(true);

    return event;
  }

  private VersionTag createVersionTag(boolean validVersionTag) {
    InternalDistributedMember remotemember = mock(InternalDistributedMember.class);
    VersionTag tag = VersionTag.create(remotemember);
    if (validVersionTag) {
      tag.setRegionVersion(1);
      tag.setEntryVersion(1);
    }
    return tag;
  }

  private void doTest(DistributedRegion region, EntryEventImpl event, int cnt) {
    // do the virtualPut test
    verifyDistributeUpdate(region, event, cnt);

    // do the basicDestroy test
    verifyDistributeDestroy(region, event, cnt);

    // do the basicInvalidate test
    verifyDistributeInvalidate(region, event, cnt);

    // do the basicUpdateEntryVersion test
    verifyDistributeUpdateEntryVersion(region, event, cnt);
  }

  protected abstract void setInternalRegionArguments(InternalRegionArguments ira);

  protected abstract DistributedRegion createAndDefineRegion(boolean isConcurrencyChecksEnabled,
      RegionAttributes ra, InternalRegionArguments ira, GemFireCacheImpl cache);

  protected abstract void verifyDistributeUpdate(DistributedRegion region, EntryEventImpl event,
      int cnt);

  protected abstract void verifyDistributeDestroy(DistributedRegion region, EntryEventImpl event,
      int cnt);

  protected abstract void verifyDistributeInvalidate(DistributedRegion region, EntryEventImpl event,
      int cnt);

  protected abstract void verifyDistributeUpdateEntryVersion(DistributedRegion region,
      EntryEventImpl event, int cnt);

  protected DistributedRegion prepare(boolean isConcurrencyChecksEnabled,
      boolean testHasSeenEvent) {
    GemFireCacheImpl cache = Fakes.cache();

    // create region attributes and internal region arguments
    RegionAttributes ra = createRegionAttributes(isConcurrencyChecksEnabled);
    InternalRegionArguments ira = new InternalRegionArguments();

    setInternalRegionArguments(ira);

    // create a region object
    DistributedRegion region = createAndDefineRegion(isConcurrencyChecksEnabled, ra, ira, cache);
    if (isConcurrencyChecksEnabled) {
      region.enableConcurrencyChecks();
    }

    doNothing().when(region).notifyGatewaySender(any(), any());
    if (!testHasSeenEvent) {
      doReturn(true).when(region).hasSeenEvent(any(EntryEventImpl.class));
    }
    return region;
  }

  @Test
  public void testConcurrencyFalseTagNull() {
    // case 1: concurrencyCheckEanbled = false, version tag is null: distribute
    DistributedRegion region = prepare(false, false);
    EntryEventImpl event = createDummyEvent(region);
    assertNull(event.getVersionTag());
    doTest(region, event, 1);
  }

  @Test
  public void testConcurrencyTrueTagNull() {
    // case 2: concurrencyCheckEanbled = true, version tag is null: not to distribute
    DistributedRegion region = prepare(true, false);
    EntryEventImpl event = createDummyEvent(region);
    assertNull(event.getVersionTag());
    doTest(region, event, 0);
  }

  @Test
  public void testConcurrencyTrueTagInvalid() {
    // case 3: concurrencyCheckEanbled = true, version tag is invalid: not to distribute
    DistributedRegion region = prepare(true, false);
    EntryEventImpl event = createDummyEvent(region);
    VersionTag tag = createVersionTag(false);
    event.setVersionTag(tag);
    assertFalse(tag.hasValidVersion());
    doTest(region, event, 0);
  }

  @Test
  public void testConcurrencyTrueTagValid() {
    // case 4: concurrencyCheckEanbled = true, version tag is valid: distribute
    DistributedRegion region = prepare(true, false);
    EntryEventImpl event = createDummyEvent(region);
    VersionTag tag = createVersionTag(true);
    event.setVersionTag(tag);
    assertTrue(tag.hasValidVersion());
    doTest(region, event, 1);
  }
}


text:
package kademlia.dht;

import java.util.Objects;
import kademlia.node.KademliaId;

/**
 * Keeps track of data for a Content stored in the DHT
 * Used by the StorageEntryManager class
 *
 * @author Joshua Kissoon
 * @since 20140226
 */
public class StorageEntryMetadata implements KademliaStorageEntryMetadata
{

    private final KademliaId key;
    private final String ownerId;
    private final String type;
    private final int contentHash;
    private final long updatedTs;

    /* This value is the last time this content was last updated from the network */
    private long lastRepublished;

    public StorageEntryMetadata(KadContent content)
    {
        this.key = content.getKey();
        this.ownerId = content.getOwnerId();
        this.type = content.getType();
        this.contentHash = content.hashCode();
        this.updatedTs = content.getLastUpdatedTimestamp();

        this.lastRepublished = System.currentTimeMillis() / 1000L;
    }

    @Override
    public KademliaId getKey()
    {
        return this.key;
    }

    @Override
    public String getOwnerId()
    {
        return this.ownerId;
    }

    @Override
    public String getType()
    {
        return this.type;
    }

    @Override
    public int getContentHash()
    {
        return this.contentHash;
    }

    @Override
    public long getLastUpdatedTimestamp()
    {
        return this.updatedTs;
    }

    /**
     * When a node is looking for content, he sends the search criteria in a GetParameter object
     * Here we take this GetParameter object and check if this StorageEntry satisfies the given parameters
     *
     * @param params
     *
     * @return boolean Whether this content satisfies the parameters
     */
    @Override
    public boolean satisfiesParameters(GetParameter params)
    {
        /* Check that owner id matches */
        if ((params.getOwnerId() != null) && (!params.getOwnerId().equals(this.ownerId)))
        {
            return false;
        }

        /* Check that type matches */
        if ((params.getType() != null) && (!params.getType().equals(this.type)))
        {
            return false;
        }

        /* Check that key matches */
        if ((params.getKey() != null) && (!params.getKey().equals(this.key)))
        {
            return false;
        }

        return true;
    }

    @Override
    public long lastRepublished()
    {
        return this.lastRepublished;
    }

    /**
     * Whenever we republish a content or get this content from the network, we update the last republished time
     */
    @Override
    public void updateLastRepublished()
    {
        this.lastRepublished = System.currentTimeMillis() / 1000L;
    }

    @Override
    public boolean equals(Object o)
    {
        if (o instanceof KademliaStorageEntryMetadata)
        {
            return this.hashCode() == o.hashCode();
        }

        return false;
    }

    @Override
    public int hashCode()
    {
        int hash = 3;
        hash = 23 * hash + Objects.hashCode(this.key);
        hash = 23 * hash + Objects.hashCode(this.ownerId);
        hash = 23 * hash + Objects.hashCode(this.type);
        return hash;
    }

    @Override
    public String toString()
    {
        StringBuilder sb = new StringBuilder("[StorageEntry: ");

        sb.append("{Key: ");
        sb.append(this.key);
        sb.append("} ");
        sb.append("{Owner: ");
        sb.append(this.ownerId);
        sb.append("} ");
        sb.append("{Type: ");
        sb.append(this.type);
        sb.append("} ");
        sb.append("]");

        return sb.toString();
    }
}


text:
    x

            <input type="checkbox" ng-model="label.visible" />{{label.label}}


text:
package thrift

import (
	"errors"
	"io"
)

var errTransportInterrupted = errors.New("Transport Interrupted")

// Flusher is the interface that wraps the basic Flush method
type Flusher interface {
	Flush() (err error)
}

// ReadSizeProvider is the interface that wraps the basic RemainingBytes method
type ReadSizeProvider interface {
	RemainingBytes() (numBytes uint64)
}

// Transport is an encapsulation of the I/O layer
type Transport interface {
	io.ReadWriteCloser
	Flusher
	ReadSizeProvider

	// Opens the transport for communication
	Open() error

	// Returns true if the transport is open
	IsOpen() bool
}

type stringWriter interface {
	WriteString(s string) (n int, err error)
}

// RichTransport is an "enhanced" transport with extra capabilities.
// You need to use one of these to construct protocol.
// Notably, Socket does not implement this interface, and it is always a mistake to use
// Socket directly in protocol.
type RichTransport interface {
	io.ReadWriter
	io.ByteReader
	io.ByteWriter
	stringWriter
	Flusher
	ReadSizeProvider
}

// UnknownRemaining is used by transports that can not return a real answer
// for RemainingBytes()
const UnknownRemaining = ^uint64(0)


text:
#include "cl_3a_image_processor.h"
#include "cl_context.h"
#include "cl_blc_handler.h"
#include "cl_demosaic_handler.h"
#include "cl_csc_handler.h"
#include "cl_hdr_handler.h"
#include "cl_denoise_handler.h"
#include "cl_gamma_handler.h"
#include "cl_3a_stats_calculator.h"
#include "cl_wb_handler.h"
#include "cl_snr_handler.h"
#include "cl_macc_handler.h"
#include "cl_tnr_handler.h"
#include "cl_ee_handler.h"
#include "cl_dpc_handler.h"
#include "cl_bnr_handler.h"

#define XCAM_CL_3A_IMAGE_MAX_POOL_SIZE 6

namespace XCam {

CL3aImageProcessor::CL3aImageProcessor ()
    : CLImageProcessor ("CL3aImageProcessor")
    , _output_fourcc (V4L2_PIX_FMT_NV12)
    , _out_smaple_type (OutSampleYuv)
    , _hdr_mode (0)
    , _tnr_mode (0)
    , _enable_gamma (true)
    , _enable_macc (true)
    , _snr_mode (XCAM_DENOISE_TYPE_SIMPLE | XCAM_DENOISE_TYPE_EE)
{
    XCAM_LOG_DEBUG ("CL3aImageProcessor constructed");
}

CL3aImageProcessor::~CL3aImageProcessor ()
{
    XCAM_LOG_DEBUG ("CL3aImageProcessor destructed");
}

void
CL3aImageProcessor::set_stats_callback (const SmartPtr<StatsCallback> &callback)
{
    XCAM_ASSERT (callback.ptr ());
    _stats_callback = callback;
}

bool
CL3aImageProcessor::set_output_format (uint32_t fourcc)
{
    switch (fourcc) {
    case XCAM_PIX_FMT_RGBA64:
    case V4L2_PIX_FMT_XBGR32:
    case V4L2_PIX_FMT_ABGR32:
    case V4L2_PIX_FMT_BGR32:
    case V4L2_PIX_FMT_RGB32:
    case V4L2_PIX_FMT_ARGB32:
    case V4L2_PIX_FMT_XRGB32:
        _out_smaple_type = OutSampleRGB;
        break;
    case V4L2_PIX_FMT_NV12:
        _out_smaple_type = OutSampleYuv;
        break;
    default:
        XCAM_LOG_WARNING (
            "cl 3a processor doesn't support output format:%s",
            xcam_fourcc_to_string(fourcc));
        return false;
    }

    _output_fourcc = fourcc;
    return true;
}

bool
CL3aImageProcessor::can_process_result (SmartPtr<X3aResult> &result)
{
    if (result.ptr() == NULL)
        return false;

    switch (result->get_type ()) {
    case XCAM_3A_RESULT_WHITE_BALANCE:
    case XCAM_3A_RESULT_BLACK_LEVEL:
    case XCAM_3A_RESULT_R_GAMMA:
    case XCAM_3A_RESULT_G_GAMMA:
    case XCAM_3A_RESULT_B_GAMMA:
    case XCAM_3A_RESULT_RGB2YUV_MATRIX:
    case XCAM_3A_RESULT_DEFECT_PIXEL_CORRECTION:
    case XCAM_3A_RESULT_MACC:
    case XCAM_3A_RESULT_BAYER_NOISE_REDUCTION:
        return true;

    default:
        return false;
    }

    return false;
}

XCamReturn
CL3aImageProcessor::apply_3a_results (X3aResultList &results)
{
    XCamReturn ret = XCAM_RETURN_NO_ERROR;

    for (X3aResultList::iterator iter = results.begin (); iter != results.end (); ++iter)
    {
        SmartPtr<X3aResult> &result = *iter;
        ret = apply_3a_result (result);
        if (ret != XCAM_RETURN_NO_ERROR)
            break;
    }
    return ret;
}

XCamReturn
CL3aImageProcessor::apply_3a_result (SmartPtr<X3aResult> &result)
{
    STREAM_LOCK;

    if (result.ptr() == NULL)
        return XCAM_RETURN_BYPASS;

    uint32_t res_type = result->get_type ();

    switch (res_type) {
    case XCAM_3A_RESULT_WHITE_BALANCE: {
        SmartPtr<X3aWhiteBalanceResult> wb_res = result.dynamic_cast_ptr<X3aWhiteBalanceResult> ();
        XCAM_ASSERT (wb_res.ptr ());
        if (!_wb.ptr())
            break;
        _wb->set_wb_config (wb_res->get_standard_result ());
        break;
    }

    case XCAM_3A_RESULT_BLACK_LEVEL: {
        SmartPtr<X3aBlackLevelResult> bl_res = result.dynamic_cast_ptr<X3aBlackLevelResult> ();
        XCAM_ASSERT (bl_res.ptr ());
        if (!_black_level.ptr())
            break;
        _black_level->set_blc_config (bl_res->get_standard_result ());
        break;
    }

    case XCAM_3A_RESULT_DEFECT_PIXEL_CORRECTION: {
        SmartPtr<X3aDefectPixelResult> def_res = result.dynamic_cast_ptr<X3aDefectPixelResult> ();
        XCAM_ASSERT (def_res.ptr ());
        if (!_dpc.ptr())
            break;
        _dpc->set_dpc_config (def_res->get_standard_result ());
        break;
    }

    case XCAM_3A_RESULT_RGB2YUV_MATRIX: {
        SmartPtr<X3aColorMatrixResult> csc_res = result.dynamic_cast_ptr<X3aColorMatrixResult> ();
        XCAM_ASSERT (csc_res.ptr ());
        if (!_csc.ptr())
            break;
        _csc->set_rgbtoyuv_matrix (csc_res->get_standard_result ());
        break;
    }

    case XCAM_3A_RESULT_MACC: {
        SmartPtr<X3aMaccMatrixResult> macc_res = result.dynamic_cast_ptr<X3aMaccMatrixResult> ();
        XCAM_ASSERT (macc_res.ptr ());
        if (!_macc.ptr())
            break;
        _macc->set_macc_table (macc_res->get_standard_result ());
        break;
    }
    case XCAM_3A_RESULT_R_GAMMA:
    case XCAM_3A_RESULT_B_GAMMA:
        break;

    case XCAM_3A_RESULT_G_GAMMA:
    case XCAM_3A_RESULT_Y_GAMMA: {
        SmartPtr<X3aGammaTableResult> gamma_res = result.dynamic_cast_ptr<X3aGammaTableResult> ();
        XCAM_ASSERT (gamma_res.ptr ());
        if (!_gamma.ptr())
            break;
        _gamma->set_gamma_table (gamma_res->get_standard_result ());
        break;
    }

    case XCAM_3A_RESULT_TEMPORAL_NOISE_REDUCTION: {
        SmartPtr<X3aNoiseReductionResult> tnr_res = result.dynamic_cast_ptr<X3aNoiseReductionResult> ();
        XCAM_ASSERT (tnr_res.ptr ());
        if (!_tnr_yuv.ptr())
            break;
        float gain = ((XCam3aResultNoiseReduction)tnr_res->get_standard_result()).gain;
        float thr_y = ((XCam3aResultNoiseReduction)tnr_res->get_standard_result()).threshold1;
        float thr_uv = ((XCam3aResultNoiseReduction)tnr_res->get_standard_result()).threshold2;
        _tnr_yuv->set_gain (gain);
        _tnr_yuv->set_threshold (thr_y, thr_uv);
        break;
    }

    case XCAM_3A_RESULT_EDGE_ENHANCEMENT: {
        SmartPtr<X3aEdgeEnhancementResult> ee_ee_res = result.dynamic_cast_ptr<X3aEdgeEnhancementResult> ();
        XCAM_ASSERT (ee_ee_res.ptr ());
        if (!_ee.ptr())
            break;
        _ee->set_ee_config_ee (ee_ee_res->get_standard_result ());
        SmartPtr<X3aNoiseReductionResult> ee_nr_res = result.dynamic_cast_ptr<X3aNoiseReductionResult> ();
        XCAM_ASSERT (ee_nr_res.ptr ());
        if (!_ee.ptr())
            break;
        _ee->set_ee_config_nr (ee_nr_res->get_standard_result ());
        break;
    }

    case XCAM_3A_RESULT_BAYER_NOISE_REDUCTION: {
        SmartPtr<X3aBayerNoiseReduction> bnr_res = result.dynamic_cast_ptr<X3aBayerNoiseReduction> ();
        XCAM_ASSERT (bnr_res.ptr ());
        if (!_bnr.ptr())
            break;
        _bnr->set_bnr_config (bnr_res->get_standard_result ());
        break;
    }

    default:
        XCAM_LOG_WARNING ("CL3aImageProcessor unknow 3a result:%d", res_type);
        break;
    }

    return XCAM_RETURN_NO_ERROR;
}

XCamReturn
CL3aImageProcessor::create_handlers ()
{
    SmartPtr<CLImageHandler> image_handler;
    SmartPtr<CLContext> context = get_cl_context ();

    XCAM_ASSERT (context.ptr ());

    /* black leve as first */
    image_handler = create_cl_blc_image_handler (context);
    _black_level = image_handler.dynamic_cast_ptr<CLBlcImageHandler> ();;
    XCAM_FAIL_RETURN (
        WARNING,
        image_handler.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create blc handler failed");
    add_handler (image_handler);

    image_handler = create_cl_dpc_image_handler (context);
    _dpc = image_handler.dynamic_cast_ptr<CLDpcImageHandler> ();;
    XCAM_FAIL_RETURN (
        WARNING,
        image_handler.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create dpc handler failed");
    add_handler (image_handler);

    image_handler = create_cl_bnr_image_handler (context);
    _bnr = image_handler.dynamic_cast_ptr<CLBnrImageHandler> ();;
    XCAM_FAIL_RETURN (
        WARNING,
        _bnr.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create bnr handler failed");
    _bnr->set_kernels_enable (XCAM_DENOISE_TYPE_BNR & _snr_mode);
    add_handler (image_handler);

    image_handler = create_cl_3a_stats_image_handler (context);
    _x3a_stats_calculator = image_handler.dynamic_cast_ptr<CL3AStatsCalculator> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _x3a_stats_calculator.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create 3a stats calculator failed");
    _x3a_stats_calculator->set_stats_callback (_stats_callback);
    add_handler (image_handler);

    image_handler = create_cl_wb_image_handler (context);
    _wb = image_handler.dynamic_cast_ptr<CLWbImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _wb.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create whitebalance handler failed");
    add_handler (image_handler);

    /* gamma */
    image_handler = create_cl_gamma_image_handler (context);
    _gamma = image_handler.dynamic_cast_ptr<CLGammaImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _gamma.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create gamma handler failed");
    _gamma->set_kernels_enable (_enable_gamma);
    add_handler (image_handler);

    /* hdr */
    image_handler = create_cl_hdr_image_handler (context, CL_HDR_DISABLE);
    _hdr = image_handler.dynamic_cast_ptr<CLHdrImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _hdr.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create hdr handler failed");
    if(_hdr_mode == CL_HDR_TYPE_RGB)
        _hdr->set_mode (_hdr_mode);
    add_handler (image_handler);

    /* demosaic */
    image_handler = create_cl_demosaic_image_handler (context);
    _demosaic = image_handler.dynamic_cast_ptr<CLBayer2RGBImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _demosaic.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create demosaic handler failed");
    image_handler->set_pool_size (XCAM_CL_3A_IMAGE_MAX_POOL_SIZE);
    add_handler (image_handler);

    /* hdr-lab*/
    image_handler = create_cl_hdr_image_handler (context, CL_HDR_DISABLE);
    _hdr = image_handler.dynamic_cast_ptr<CLHdrImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _hdr.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create hdr handler failed");
    if(_hdr_mode == CL_HDR_TYPE_LAB)
        _hdr->set_mode (_hdr_mode);
    add_handler (image_handler);

    /* bilateral noise reduction */
    image_handler = create_cl_denoise_image_handler (context);
    _binr = image_handler.dynamic_cast_ptr<CLDenoiseImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _binr.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create denoise handler failed");
    _binr->set_kernels_enable (XCAM_DENOISE_TYPE_BILATERAL & _snr_mode);
    image_handler->set_pool_size (XCAM_CL_3A_IMAGE_MAX_POOL_SIZE);
    add_handler (image_handler);

    /* Temporal Noise Reduction (RGB domain) */
    image_handler = create_cl_tnr_image_handler(context, CL_TNR_TYPE_RGB);
    _tnr_rgb = image_handler.dynamic_cast_ptr<CLTnrImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _tnr_rgb.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create tnr handler failed");
    _tnr_rgb->set_mode (CL_TNR_TYPE_RGB & _tnr_mode);
    add_handler (image_handler);

    /* simple noise reduction */
    image_handler = create_cl_snr_image_handler (context);
    _snr = image_handler.dynamic_cast_ptr<CLSnrImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _snr.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create snr handler failed");
    _snr->set_kernels_enable (XCAM_DENOISE_TYPE_SIMPLE & _snr_mode);
    add_handler (image_handler);

    /* macc */
    image_handler = create_cl_macc_image_handler (context);
    _macc = image_handler.dynamic_cast_ptr<CLMaccImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _macc.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create macc handler failed");
    _macc->set_kernels_enable (_enable_macc);
    add_handler (image_handler);

    /* color space conversion */
    image_handler = create_cl_csc_image_handler (context, CL_CSC_TYPE_RGBATONV12);
    _csc = image_handler.dynamic_cast_ptr<CLCscImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _csc .ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create csc handler failed");
    image_handler->set_pool_type (CLImageHandler::DrmBoPoolType);
    add_handler (image_handler);

    /* Temporal Noise Reduction (YUV domain) */
    image_handler = create_cl_tnr_image_handler(context, CL_TNR_TYPE_YUV);
    _tnr_yuv = image_handler.dynamic_cast_ptr<CLTnrImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _tnr_yuv.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create tnr handler failed");
    _tnr_yuv->set_mode (CL_TNR_TYPE_YUV & _tnr_mode);
    image_handler->set_pool_type (CLImageHandler::DrmBoPoolType);
    add_handler (image_handler);

    /* ee */
    image_handler = create_cl_ee_image_handler (context);
    _ee = image_handler.dynamic_cast_ptr<CLEeImageHandler> ();
    XCAM_FAIL_RETURN (
        WARNING,
        _ee.ptr (),
        XCAM_RETURN_ERROR_CL,
        "CL3aImageProcessor create ee handler failed");
    _ee->set_kernels_enable (XCAM_DENOISE_TYPE_EE & _snr_mode);
    image_handler->set_pool_type (CLImageHandler::DrmBoPoolType);
    image_handler->set_pool_size (XCAM_CL_3A_IMAGE_MAX_POOL_SIZE);
    add_handler (image_handler);

    if (_out_smaple_type == OutSampleRGB) {
        image_handler = create_cl_csc_image_handler (context, CL_CSC_TYPE_NV12TORGBA);
        _csc = image_handler.dynamic_cast_ptr<CLCscImageHandler> ();
        XCAM_FAIL_RETURN (
            WARNING,
            _csc .ptr (),
            XCAM_RETURN_ERROR_CL,
            "CL3aImageProcessor create csc handler failed");
        image_handler->set_pool_type (CLImageHandler::DrmBoPoolType);
        image_handler->set_pool_size (XCAM_CL_3A_IMAGE_MAX_POOL_SIZE);
        add_handler (image_handler);
    }

    return XCAM_RETURN_NO_ERROR;
}

bool
CL3aImageProcessor::set_hdr (uint32_t mode)
{
    _hdr_mode = mode;

    STREAM_LOCK;

    if (_hdr.ptr ())
        return _hdr->set_mode (mode);

    return true;
}

bool
CL3aImageProcessor::set_gamma (bool enable)
{
    _enable_gamma = enable;

    STREAM_LOCK;

    if (_gamma.ptr ())
        return _gamma->set_kernels_enable (enable);

    return true;
}

bool
CL3aImageProcessor::set_denoise (uint32_t mode)
{
    _snr_mode = mode;

    STREAM_LOCK;

    if (_snr.ptr ())
        _snr->set_kernels_enable (XCAM_DENOISE_TYPE_SIMPLE & _snr_mode);
    if (_binr.ptr ())
        _binr->set_kernels_enable (XCAM_DENOISE_TYPE_BILATERAL & _snr_mode);
    if (_ee.ptr ())
        _ee->set_kernels_enable (XCAM_DENOISE_TYPE_EE & _snr_mode);
    if (_bnr.ptr ())
        _bnr->set_kernels_enable (XCAM_DENOISE_TYPE_BNR & _snr_mode);

    return true;
}

bool
CL3aImageProcessor::set_macc (bool enable)
{
    _enable_macc = enable;

    STREAM_LOCK;

    if (_macc.ptr ())
        return _macc->set_kernels_enable (enable);
    return true;
}

bool
CL3aImageProcessor::set_tnr (uint32_t mode, uint8_t level)
{
    _tnr_mode = mode;

    STREAM_LOCK;
    //TODO: map denoise level to threshold & gain
    XCAM_UNUSED(level);
    bool ret = false;
    if (_tnr_rgb.ptr ())
        ret = _tnr_rgb->set_kernels_enable (mode & CL_TNR_TYPE_RGB);
    if (_tnr_yuv.ptr ())
        ret = _tnr_yuv->set_kernels_enable (mode & CL_TNR_TYPE_YUV);

    return ret;
}
};


text:
#ifndef __OPENSPACE_UI_LAUNCHER___FILESYSTEMACCESS___H__
#define __OPENSPACE_UI_LAUNCHER___FILESYSTEMACCESS___H__

#include <QFileSystemModel>

class FileSystemAccess {
public:
    /**
     * Constructor for filesystemAccess class
     *
     * \param fileExtension string that defines the filter used to find files. Only
     *                      files with this extension will be recognized (e.g. '.xml')
     * \param hideFileExtensions if true then file extensions will be removed from the
     *                           listed files in the output
     * \param useCheckboxes if true then the text output format will contain a '0' as
     *                      the first character in the line (this first character is
     *                      used to represent checked ('1'), uncheck ('0') or doesn't
     *                      exist in filesystem ('x') states.
     */
    FileSystemAccess(std::string fileExtension, bool hideFileExtensions,
        bool useCheckboxes);

    /**
     * Function that uses the #QtFileSystemModel class to search the given directory
     *
     * \param dir The directory from which to start the search from
     */
    std::string useQtFileSystemModelToTraverseDir(std::string dir,
        bool usersAssets = false);

private:
    void parseChildDirElements(QFileInfo item, std::string space, int level,
        std::vector<std::string>& dirNames, std::vector<std::string>& output,
        bool userAssets);
    void parseChildFile(std::string res, bool& hasDirHeaderBeenAdded,
        std::vector<std::string>& dirNames, std::vector<std::string>& output);

    QFileSystemModel _filesystemModel;
    QDir::Filters _fileFilterOptions = QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot;
    std::string _fileExtension;
    std::vector<std::string> _approvedPaths;
    bool _hideFileExtensions = true;
    bool _useCheckboxes = false;
};

#endif // __OPENSPACE_UI_LAUNCHER___FILESYSTEMACCESS___H__


text:
package com.github.keaume.amigo.obd;

public enum ObdConnectionState {
    DISCONNECTED,
    CONNECTED,
    CONNECTING_FAILED,
    CONNECTING_FAILED_BT_NOT_SUPPORTED,
    CONNECTING_FAILED_BT_IS_DISABLED,
    CONNECTING_FAILED_BT_NO_DEVICE_SELECTED,
    CONNECTION_LOST
}


text:
<?php

namespace Ei\einstitutBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * EticketRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class EticketRepository extends EntityRepository
{
}


text:
namespace Google.Cloud.BigQuery.DataPolicies.V1Beta1.Snippets
{
    // [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_async]
    using Google.Api.Gax.ResourceNames;
    using Google.Cloud.BigQuery.DataPolicies.V1Beta1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedDataPolicyServiceClientSnippets
    {
        /// <summary>Snippet for CreateDataPolicyAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public async Task CreateDataPolicyRequestObjectAsync()
        {
            // Create client
            DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
            // Initialize request argument(s)
            CreateDataPolicyRequest request = new CreateDataPolicyRequest
            {
                ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
                DataPolicy = new DataPolicy(),
            };
            // Make the request
            DataPolicy response = await dataPolicyServiceClient.CreateDataPolicyAsync(request);
        }
    }
    // [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_async]
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.07.15 at 10:07:27 AM PDT
//

package org.yeastrc.proxl_import.api.xml_dto;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{}visible_psm_annotations"/>
 *         <element ref="{}visible_psm_per_peptide_annotations" minOccurs="0"/>
 *         <element ref="{}visible_reported_peptide_annotations" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "visiblePsmAnnotations",
    "visiblePsmPerPeptideAnnotations",
    "visibleReportedPeptideAnnotations"
})
@XmlRootElement(name = "default_visible_annotations")
public class DefaultVisibleAnnotations {

    @XmlElement(name = "visible_psm_annotations", required = true)
    protected VisiblePsmAnnotations visiblePsmAnnotations;
    @XmlElement(name = "visible_psm_per_peptide_annotations")
    protected VisiblePsmPerPeptideAnnotations visiblePsmPerPeptideAnnotations;
    @XmlElement(name = "visible_reported_peptide_annotations")
    protected VisibleReportedPeptideAnnotations visibleReportedPeptideAnnotations;

    /**
     * Gets the value of the visiblePsmAnnotations property.
     *
     * @return
     *     possible object is
     *     {@link VisiblePsmAnnotations }
     *
     */
    public VisiblePsmAnnotations getVisiblePsmAnnotations() {
        return visiblePsmAnnotations;
    }

    /**
     * Sets the value of the visiblePsmAnnotations property.
     *
     * @param value
     *     allowed object is
     *     {@link VisiblePsmAnnotations }
     *
     */
    public void setVisiblePsmAnnotations(VisiblePsmAnnotations value) {
        this.visiblePsmAnnotations = value;
    }

    /**
     * Optional. The PSM-level annotations that are associated individual with each peptide (for example, each separate peptide in a cross-link) that should be visible by default when viewing PSM-level data.
     *
     * @return
     *     possible object is
     *     {@link VisiblePsmPerPeptideAnnotations }
     *
     */
    public VisiblePsmPerPeptideAnnotations getVisiblePsmPerPeptideAnnotations() {
        return visiblePsmPerPeptideAnnotations;
    }

    /**
     * Sets the value of the visiblePsmPerPeptideAnnotations property.
     *
     * @param value
     *     allowed object is
     *     {@link VisiblePsmPerPeptideAnnotations }
     *
     */
    public void setVisiblePsmPerPeptideAnnotations(VisiblePsmPerPeptideAnnotations value) {
        this.visiblePsmPerPeptideAnnotations = value;
    }

    /**
     * Optional. The peptide-level annotations that are visible by default.
     *
     * @return
     *     possible object is
     *     {@link VisibleReportedPeptideAnnotations }
     *
     */
    public VisibleReportedPeptideAnnotations getVisibleReportedPeptideAnnotations() {
        return visibleReportedPeptideAnnotations;
    }

    /**
     * Sets the value of the visibleReportedPeptideAnnotations property.
     *
     * @param value
     *     allowed object is
     *     {@link VisibleReportedPeptideAnnotations }
     *
     */
    public void setVisibleReportedPeptideAnnotations(VisibleReportedPeptideAnnotations value) {
        this.visibleReportedPeptideAnnotations = value;
    }

}


text:
@interface WKStoryListHeadView : UIView

@property (strong, nonatomic) IBOutlet UIImageView *icon;
@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
@property (strong, nonatomic) IBOutlet UILabel *TLabel;

@property (strong, nonatomic) IBOutlet UILabel *timeLabel;
@property (strong, nonatomic) IBOutlet UIView *view;

- (instancetype)initWithFrame:(CGRect)frame;

- (void)initializeData;

@end


text:
using System;
using System.Linq;
using System.Collections.Generic;

namespace Duality.IO
{
	/// <summary>
	/// Defines static methods for performing common file system operations on directories.
	/// </summary>
	public static class DirectoryOp
	{
		/// <summary>
		/// Returns whether the specified path refers to an existing directory.
		/// </summary>
		/// <param name="path"></param>
		public static bool Exists(string path)
		{
			if (string.IsNullOrWhiteSpace(path)) return false;
			PathOp.CheckInvalidPathChars(path);
			return DualityApp.SystemBackend.FileSystem.DirectoryExists(path);
		}
		/// <summary>
		/// Creates a directory tree matching the specified directory path.
		/// </summary>
		/// <param name="path"></param>
		public static void Create(string path)
		{
			if (string.IsNullOrWhiteSpace(path)) throw new ArgumentException("The specified path is null or whitespace-only.");
			PathOp.CheckInvalidPathChars(path);
			DualityApp.SystemBackend.FileSystem.CreateDirectory(path);
		}
		/// <summary>
		/// Deletes the directory that is referred to by the specified path.
		/// </summary>
		/// <param name="path"></param>
		public static void Delete(string path)
		{
			if (string.IsNullOrWhiteSpace(path)) return;
			PathOp.CheckInvalidPathChars(path);
			DualityApp.SystemBackend.FileSystem.DeleteDirectory(path);
		}
		/// <summary>
		/// Enumerates all files that are located within the specified path.
		/// </summary>
		/// <param name="path"></param>
		/// <param name="recursive">If true, the specified path will be searched recursively and yield all descendant file paths.</param>
		public static IEnumerable<string> GetFiles(string path, bool recursive = false)
		{
			if (string.IsNullOrWhiteSpace(path)) return Enumerable.Empty<string>();
			PathOp.CheckInvalidPathChars(path);
			return DualityApp.SystemBackend.FileSystem.GetFiles(path, recursive);
		}
		/// <summary>
		/// Enumerates all directories that are located within the specified path.
		/// </summary>
		/// <param name="path"></param>
		/// <param name="recursive">If true, the specified path will be searched recursively and yield all descendant directory paths.</param>
		public static IEnumerable<string> GetDirectories(string path, bool recursive = false)
		{
			if (string.IsNullOrWhiteSpace(path)) return Enumerable.Empty<string>();
			PathOp.CheckInvalidPathChars(path);
			return DualityApp.SystemBackend.FileSystem.GetDirectories(path, recursive);
		}
	}
}


text:
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))

require 'pathname'
require 'puppet/util/filetype'

require 'puppet_x/elastic/es_versioning'

Puppet::Type.type(:elasticsearch_service_file).provide(:ruby) do
  desc <<-ENDHEREDOC
    Provides management of elasticsearch service files.
  ENDHEREDOC

  mk_resource_methods

  def initialize(value = {})
    super(value)
    @property_flush = {}
  end

  def self.services
    [
      '/usr/lib/systemd/system/elasticsearch-',
      '/lib/systemd/system/elasticsearch-',
      '/etc/init.d/elasticsearch.',
      '/etc/init.d/elasticsearch-',
      '/etc/rc.d/elasticsearch_'
    ].map do |path|
      Pathname.glob(path + '*').map do |service|
        {
          :name => service.to_s,
          :ensure => :present,
          :provider => :ruby,
          :content => Puppet::Util::FileType.filetype(:flat).new(service.to_s).read
        }
      end
    end.flatten.compact
  end

  def self.instances
    services.map do |instance|
      new instance
    end
  end

  def self.prefetch(resources)
    instances.each do |prov|
      if (resource = resources[prov.name])
        resource.provider = prov
      end
    end
  end

  def create
    @property_flush[:ensure] = :present
  end

  def exists?
    @property_hash[:ensure] == :present
  end

  def destroy?
    @property_flush[:ensure] = :absent
  end

  def flush
    begin
      opt_flag, opt_flags = Puppet_X::Elastic::EsVersioning.opt_flags(
        resource[:package_name], resource.catalog
      )
    rescue ElasticsearchPackageNotFoundError
      # If the Elasticsearch package is not present at all, we don't know what
      # version is present, so we just set these as empty values for the
      # template.
      opt_flag = ''
      opt_flags = []
    end

    # This should only be present on systemd systems.
    opt_flags.delete('--quiet') unless resource[:name].include?('systemd')

    template = ERB.new(resource[:content], 0, '-')
    result = template.result(binding)

    Puppet::Util::FileType.filetype(:flat).new(resource[:name]).write(result)

    @property_hash = self.class.services.detect do |t|
      t[:name] == resource[:name]
    end
  end
end # of .provide


text:
require_dependency 'nodes/application_controller'

module Nodes
  class NodesController < ApplicationController
    before_action :set_node, only: [:show, :edit, :update, :destroy]

    def index
      @nodes = Node.all
    end

    def show
    end

    def new
      @node = Node.new
    end

    def edit
    end

    def create
      @node = Node.new(node_params)

      if @node.save
        redirect_to @node, notice: I18n.t(:node_was_created)
      else
        render :new
      end
    end

    def update
      if @node.update(node_params)
        redirect_to @node, notice: I18n.t(:node_was_updated)
      else
        render :edit
      end
    end

    def destroy
      @node.destroy
      redirect_to nodes_url, notice: I18n.t(:node_was_destroyed)
    end

    private
      def set_node
        @node = Node.find(params[:id])
      end
      def node_params
        params.require(:node).permit(:name)
      end

  end
end


text:
angular.module('palava-portal').directive('webrtcStream', function(){
    return {
      restrict: 'E',
      replace: true,
      scope: {
        peer: "=",
      },
      link: function($scope, $elem, $attrs){
        palava.browser.registerFullscreen($elem, 'dblclick');
        $scope.$watch('peer.getStream()', function(val){
          palava.browser.attachMediaStream($elem, val);
        });
      },
      template: '<video autoplay muted class="plv-video-like" ng-class="{\'plv-local-video\': peer.isLocal() }" />'
    };
});


text:
<?php
function register_session(){
  if(!session_id())
    session_start();
}
add_action('init','register_session');


text:
package com.braintreegateway;

import com.braintreegateway.util.NodeWrapper;

import java.lang.reflect.InvocationTargetException;
import java.util.Map;

public class Result<T> {

    private CreditCardVerification creditCardVerification;
    private Transaction transaction;
    private Subscription subscription;
    private ValidationErrors errors;
    private Map<String, String> parameters;
    private String message;
    private T target;

    public static <T> T newInstanceFromNode(Class<T> klass, NodeWrapper node) {
        Throwable cause = null;
        try {
            return klass.getConstructor(NodeWrapper.class).newInstance(node);
        }
        catch (InstantiationException e) { cause = e; }
        catch (IllegalAccessException e) { cause = e; }
        catch (InvocationTargetException e) { cause = e;  }
        catch (NoSuchMethodException e) { cause = e; }

        throw new IllegalArgumentException("Unknown klass: " + klass, cause);
    }

    public Result() {
    }

    public Result(NodeWrapper node, Class<T> klass) {
        if (node.isSuccess()) {
            this.target = newInstanceFromNode(klass, node);
        } else {
            this.errors = new ValidationErrors(node);

            NodeWrapper verificationNode = node.findFirst("verification");
            if (verificationNode != null) {
                this.creditCardVerification = new CreditCardVerification(verificationNode);
            }

            NodeWrapper transactionNode = node.findFirst("transaction");
            if (transactionNode != null) {
                this.transaction = new Transaction(transactionNode);
            }
            NodeWrapper subscriptionNode = node.findFirst("subscription");
            if (subscriptionNode != null) {
                this.subscription = new Subscription(subscriptionNode);
            }
            this.parameters = node.findFirst("params").getFormParameters();
            this.message = node.findString("message");
        }
    }

    public CreditCardVerification getCreditCardVerification() {
        return creditCardVerification;
    }

    public Subscription getSubscription() {
        return subscription;
    }

    public Transaction getTransaction() {
        return transaction;
    }

    public ValidationErrors getErrors() {
        return errors;
    }

    public Map<String, String> getParameters() {
        return parameters;
    }

    public T getTarget() {
        return target;
    }

    public boolean isSuccess() {
        return errors == null;
    }

    public String getMessage() {
        return message;
    }
}


text:
from django.apps import apps
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import SearchVectorField
from django.db import models
from django.db.models.functions import Cast
from django.utils.translation import gettext_lazy as _

from wagtail.search.index import class_is_indexed

from .utils import get_descendants_content_types_pks

class TextIDGenericRelation(GenericRelation):
    auto_created = True

    def get_content_type_lookup(self, alias, remote_alias):
        field = self.remote_field.model._meta.get_field(
            self.content_type_field_name)
        return field.get_lookup('in')(
            field.get_col(remote_alias),
            get_descendants_content_types_pks(self.model))

    def get_object_id_lookup(self, alias, remote_alias):
        from_field = self.remote_field.model._meta.get_field(
            self.object_id_field_name)
        to_field = self.model._meta.pk
        return from_field.get_lookup('exact')(
            from_field.get_col(remote_alias),
            Cast(to_field.get_col(alias), from_field))

    def get_extra_restriction(self, where_class, alias, remote_alias):
        cond = where_class()
        cond.add(self.get_content_type_lookup(alias, remote_alias), 'AND')
        cond.add(self.get_object_id_lookup(alias, remote_alias), 'AND')
        return cond

    def resolve_related_fields(self):
        return []

class IndexEntry(models.Model):
    content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
    # We do not use an IntegerField since primary keys are not always integers.
    object_id = models.TextField()
    content_object = GenericForeignKey()

    # TODO: Add per-object boosting.
    autocomplete = SearchVectorField()
    title = SearchVectorField()
    # This field stores the "Title Normalisation Factor"
    # This factor is multiplied onto the the rank of the title field.
    # This allows us to apply a boost to results with shorter titles
    # elevating more specific matches to the top.
    title_norm = models.FloatField(default=1.0)
    body = SearchVectorField()

    class Meta:
        unique_together = ('content_type', 'object_id')
        verbose_name = _('index entry')
        verbose_name_plural = _('index entries')
        indexes = [GinIndex(fields=['autocomplete']),
                   GinIndex(fields=['title']),
                   GinIndex(fields=['body'])]

    def __str__(self):
        return '%s: %s' % (self.content_type.name, self.content_object)

    @property
    def model(self):
        return self.content_type.model

    @classmethod
    def add_generic_relations(cls):
        for model in apps.get_models():
            if class_is_indexed(model):
                TextIDGenericRelation(cls).contribute_to_class(model,
                                                               'index_entries')


text:
namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// User-defined filters to return data which will be purged from the
    /// table.
    /// </summary>
    public partial class ComponentPurgeBodyFilters
    {
        /// <summary>
        /// Initializes a new instance of the ComponentPurgeBodyFilters class.
        /// </summary>
        public ComponentPurgeBodyFilters()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the ComponentPurgeBodyFilters class.
        /// </summary>
        /// <param name="column">The column of the table over which the given
        /// query should run</param>
        /// <param name="operatorProperty">A query operator to evaluate over
        /// the provided column and value(s).</param>
        /// <param name="value">the value for the operator to function over.
        /// This can be a number (e.g., > 100), a string (timestamp >=
        /// '2017-09-01') or array of values.</param>
        /// <param name="key">When filtering over custom dimensions, this key
        /// will be used as the name of the custom dimension.</param>
        public ComponentPurgeBodyFilters(string column = default(string), string operatorProperty = default(string), object value = default(object), string key = default(string))
        {
            Column = column;
            OperatorProperty = operatorProperty;
            Value = value;
            Key = key;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the column of the table over which the given query
        /// should run
        /// </summary>
        [JsonProperty(PropertyName = "column")]
        public string Column { get; set; }

        /// <summary>
        /// Gets or sets a query operator to evaluate over the provided column
        /// and value(s).
        /// </summary>
        [JsonProperty(PropertyName = "operator")]
        public string OperatorProperty { get; set; }

        /// <summary>
        /// Gets or sets the value for the operator to function over. This can
        /// be a number (e.g., &gt; 100), a string (timestamp &gt;=
        /// '2017-09-01') or array of values.
        /// </summary>
        [JsonProperty(PropertyName = "value")]
        public object Value { get; set; }

        /// <summary>
        /// Gets or sets when filtering over custom dimensions, this key will
        /// be used as the name of the custom dimension.
        /// </summary>
        [JsonProperty(PropertyName = "key")]
        public string Key { get; set; }

    }
}