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

package com.google.devtools.build.lib.buildeventstream;

import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.BuildEventId;
import java.util.Collection;

/** Interface for {@link BuildEvent}s with order constraints. */
public interface BuildEventWithOrderConstraint extends BuildEvent {
  /**
   * Specify events that need to come first.
   *
   * <p>Specify events by their {@link BuildEventId} that need to be posted on the build event
   * stream before this event. In doing so, the event promises that the events to be waited for are
   * already generated, so that the event does not have to be buffered for an extended time.
   */
  Collection<BuildEventId> postedAfter();
}


text:
CodeTA
======

A tool for automated source code grading.

Quick-start
===========
To install everything

> sudo ./deploy.sh all

Run unit tests

> python tests.py

Deployment Options
==================

To update server configuration from github

> sudo ./deploy.sh puppet

To install only the bootstrap puppet scripts

> sudo ./deploy.sh server

To install only the webapp

> sudo ./deploy.sh webapp

redpajama_set_name: RedPajamaGithub


text:
"""Test all DataStore implementations
"""
from copy import deepcopy

import numpy as np
from pytest import fixture, mark, param, raises
from smif.data_layer.data_array import DataArray
from smif.data_layer.database_interface import DbDataStore
from smif.data_layer.file.file_data_store import CSVDataStore, ParquetDataStore
from smif.data_layer.memory_interface import MemoryDataStore
from smif.exception import SmifDataNotFoundError
from smif.metadata import Spec

@fixture(
    params=[
        'memory',
        'file_csv',
        'file_parquet',
        param('database', marks=mark.skip)]
    )
def handler(request, setup_empty_folder_structure):
    if request.param == 'memory':
        handler = MemoryDataStore()
    elif request.param == 'file_csv':
        base_folder = setup_empty_folder_structure
        handler = CSVDataStore(base_folder)
    elif request.param == 'file_parquet':
        base_folder = setup_empty_folder_structure
        handler = ParquetDataStore(base_folder)
    elif request.param == 'database':
        handler = DbDataStore()
        raise NotImplementedError

    return handler

class TestDataArray():
    """Read and write DataArray
    """
    def test_read_write_data_array(self, handler, scenario):
        spec_config = deepcopy(scenario['provides'][0])
        spec_config['dims'] = ['timestep'] + spec_config['dims']
        spec_config['coords']['timestep'] = [{'name': 2010}]
        spec = Spec.from_dict(spec_config)
        data = np.array([[0, 1]], dtype='float')
        da = DataArray(spec, data)
        handler.write_scenario_variant_data('mortality.csv', da)

        spec_config = deepcopy(scenario['provides'][0])
        spec = Spec.from_dict(spec_config)
        data = np.array([0, 1], dtype='float')
        expected = DataArray(spec, data)

        actual = handler.read_scenario_variant_data('mortality.csv', spec, 2010)
        assert actual == expected
        np.testing.assert_array_equal(actual.as_ndarray(), expected.as_ndarray())

    def test_read_write_data_array_all(self, handler, scenario):
        spec = Spec.from_dict(deepcopy(scenario['provides'][0]))

        spec_with_t = scenario['provides'][0]
        spec_with_t['dims'].insert(0, 'timestep')
        spec_with_t['coords']['timestep'] = [2010, 2015]
        spec_with_t = Spec.from_dict(spec_with_t)
        da = DataArray(spec_with_t, np.array([[0, 1], [2, 3]], dtype='float'))

        handler.write_scenario_variant_data('mortality.csv', da)
        actual = handler.read_scenario_variant_data('mortality.csv', spec_with_t)
        expected = np.array([[0, 1], [2, 3]], dtype='float')
        np.testing.assert_array_equal(actual.as_ndarray(), expected)

        da_2010 = handler.read_scenario_variant_data('mortality.csv', spec, 2010)
        expected = np.array([0, 1], dtype='float')
        np.testing.assert_array_equal(da_2010.as_ndarray(), expected)

        da_2015 = handler.read_scenario_variant_data('mortality.csv', spec, 2015)
        expected = np.array([2, 3], dtype='float')
        np.testing.assert_array_equal(da_2015.as_ndarray(), expected)

    def test_read_zero_d_from_timeseries(self, handler):
        """Read a single value
            timestep,param
            2010,0
            2015,1
        """
        # write data for multiple timesteps by adding 'timestep' dim to the spec
        data = np.array([0, 1], dtype=float)
        write_spec = Spec(
            name='param',
            dims=['timestep'],
            coords={'timestep': [2010, 2015]},
            dtype='float'
        )
        da = DataArray(write_spec, data)
        handler.write_scenario_variant_data('param', da)

        read_spec = Spec(
            name='param',
            dims=[],
            coords={},
            dtype='float'
        )
        actual = handler.read_scenario_variant_data('param', read_spec, 2010).data
        assert actual == np.array(0.0)
        actual = handler.read_scenario_variant_data('param', read_spec, 2015).data
        assert actual == np.array(1.0)

    def test_read_data_array_missing_timestep(self, handler, scenario):
        data = np.array([[0, 1]], dtype=float)
        spec_config = deepcopy(scenario['provides'][0])
        spec_config['dims'] = ['timestep'] + spec_config['dims']
        spec_config['coords']['timestep'] = [{'name': 2010}]
        spec = Spec.from_dict(spec_config)

        da = DataArray(spec, data)

        handler.write_scenario_variant_data('mortality.csv', da)
        msg = "not found for timestep 2011"
        with raises(SmifDataNotFoundError) as ex:
            handler.read_scenario_variant_data('mortality.csv', spec, 2011)
        assert msg in str(ex.value)

    def test_string_data(self, handler):
        spec = Spec(
            name='string_data',
            dims=['timestep', 'zones'],
            coords={'timestep': [2010], 'zones': ['a', 'b', 'c']},
            dtype='object'
        )
        data = np.array([['alpha', 'beta', 'γάμμα']], dtype='object')
        expected = DataArray(spec, data)

        handler.write_scenario_variant_data('key', expected)
        actual = handler.read_scenario_variant_data('key', spec)
        assert actual == expected

class TestInitialConditions():
    """Read and write initial conditions
    """
    def test_read_write_initial_conditions(self, handler, initial_conditions):

        expected = initial_conditions

        handler.write_initial_conditions('initial_conditions.csv', initial_conditions)
        actual = handler.read_initial_conditions(['initial_conditions.csv'])

        assert actual == expected

class TestInterventions():
    """Read and write interventions
    """
    def test_read_write_interventions(self, handler, interventions):

        expected = interventions
        handler.write_interventions('my_intervention.csv', interventions)
        actual = handler.read_interventions(['my_intervention.csv'])

        assert actual == expected

class TestState():
    """Read and write state
    """
    def test_read_write_state(self, handler, state):
        expected = state
        modelrun_name = 'test_modelrun'
        timestep = 2020
        decision_iteration = None

        handler.write_state(expected, modelrun_name, timestep, decision_iteration)
        actual = handler.read_state(modelrun_name, timestep, decision_iteration)
        assert actual == expected

    def test_read_write_empty_state(self, handler):
        expected = []
        modelrun_name = 'test_modelrun'
        timestep = 2020
        decision_iteration = None

        handler.write_state(expected, modelrun_name, timestep, decision_iteration)
        actual = handler.read_state(modelrun_name, timestep, decision_iteration)
        assert actual == expected

class TestCoefficients():
    """Read/write conversion coefficients
    """
    def test_read_write_coefficients(self, handler):

        with raises(SmifDataNotFoundError):
            handler.read_coefficients('from_dim_name', 'to_dim_name')

        expected = np.array([[2]])
        handler.write_coefficients('from_dim_name', 'to_dim_name', expected)

        actual = handler.read_coefficients('from_dim_name', 'to_dim_name')
        np.testing.assert_equal(actual, expected)

class TestResults():
    """Read/write results and prepare warm start
    """
    def test_read_write_results(self, handler, sample_results):
        output_spec = sample_results.spec
        modelrun_name = 'test_modelrun'
        model_name = 'energy'
        timestep = 2010

        handler.write_results(sample_results, modelrun_name, model_name, timestep)
        results_out = handler.read_results(modelrun_name, model_name, output_spec, timestep)

        assert results_out == sample_results

    def test_available_results(self, handler, sample_results):
        """Available results should return an empty list if none are available
        develop
        """
        assert handler.available_results('test_modelrun') == []
        handler.write_results(sample_results, 'test_modelrun', 'energy', 2010, 0)
        handler.write_results(sample_results, 'test_modelrun', 'energy', 2015, 0)
        handler.write_results(sample_results, 'test_modelrun', 'energy', 2015, 1)

        # keys should be (timestep, decision_iteration, model_name, output_name)
        assert sorted(handler.available_results('test_modelrun')) == [
            (2010, 0, 'energy', sample_results.spec.name),
            (2015, 0, 'energy', sample_results.spec.name),
            (2015, 1, 'energy', sample_results.spec.name)
        ]

        # delete one
        handler.delete_results('test_modelrun', 'energy', sample_results.spec.name, 2010, 0)
        assert sorted(handler.available_results('test_modelrun')) == [
            (2015, 0, 'energy', sample_results.spec.name),
            (2015, 1, 'energy', sample_results.spec.name)
        ]

        # clear all (no error if re-deleting)
        handler.delete_results('test_modelrun', 'energy', sample_results.spec.name, 2010, 0)
        handler.delete_results('test_modelrun', 'energy', sample_results.spec.name, 2015, 0)
        handler.delete_results('test_modelrun', 'energy', sample_results.spec.name, 2015, 1)
        assert not handler.available_results('test_modelrun')

    def test_read_results_raises(self, handler, sample_results):
        modelrun_name = 'test_modelrun'
        model_name = 'energy'
        timestep = 2010
        output_spec = sample_results.spec

        handler.write_results(sample_results, modelrun_name, model_name, timestep=timestep)

        with raises(SmifDataNotFoundError):
            handler.read_results(modelrun_name, model_name, output_spec, 2020)

class TestDataExists():
    """Check that model run data exists
    """
    def test_strategy_data_exists(self, handler, strategies):
        for strategy in strategies:
            if strategy['type'] == 'pre-specified-planning':
                new_strategy = {'filename': 'strategy'}
                assert not handler.strategy_data_exists(new_strategy)
                handler.write_strategy_interventions(new_strategy, strategy['interventions'])

                assert handler.strategy_data_exists(new_strategy)

    def test_scenario_variant_data_exists(self, handler, sample_scenario_data):
        assert not handler.scenario_variant_data_exists('scenario_variant_data')

        key = next(iter(sample_scenario_data))
        scenario_name, variant_name, variable = key
        scenario_variant_data = sample_scenario_data[key]
        handler.write_scenario_variant_data('scenario_variant_data', scenario_variant_data)

        assert handler.scenario_variant_data_exists('scenario_variant_data')

    def test_narrative_variant_data_exists(self, handler, sample_narrative_data):
        assert not handler.narrative_variant_data_exists('narrative_variant_data')
        # pick out single sample
        key = (
            'energy',
            'technology',
            'high_tech_dsm',
            'smart_meter_savings'
        )
        sos_model_name, narrative_name, variant_name, param_name = key
        narrative_variant_data = sample_narrative_data[key]
        handler.write_narrative_variant_data('narrative_variant_data', narrative_variant_data)

        assert handler.narrative_variant_data_exists('narrative_variant_data')

    def test_model_parameter_default_data_exists(self, handler, get_multidimensional_param):
        assert not handler.model_parameter_default_data_exists('parameter_default')
        param_data = get_multidimensional_param
        handler.write_model_parameter_default('parameter_default', param_data)

        assert handler.model_parameter_default_data_exists('parameter_default')

    def test_interventions_data_exists(self, handler, interventions):
        assert not handler.interventions_data_exists('interventions')
        handler.write_interventions('interventions', interventions)

        assert handler.interventions_data_exists('interventions')

    def test_initial_conditions_data_exists(self, handler, initial_conditions):
        assert not handler.initial_conditions_data_exists('initial_conditions')
        handler.write_initial_conditions('initial_conditions', initial_conditions)

        assert handler.initial_conditions_data_exists('initial_conditions')


text:
<?php

return [
    /*
     * Namespaces used by the generator.
     */
    'namespace' => [
        /*
         * Base namespace/directory to create the new file.
         * This is appended on default Laravel namespace.
         * Usage: php artisan datatables:make User
         * Output: App\DataTables\UserDataTable
         * With Model: App\User (default model)
         * Export filename: users_timestamp
         */
        'base' => 'DataTables',

        /*
         * Base namespace/directory where your model's are located.
         * This is appended on default Laravel namespace.
         * Usage: php artisan datatables:make Post --model
         * Output: App\DataTables\PostDataTable
         * With Model: App\Post
         * Export filename: posts_timestamp
         */
        'model' => '',
    ],

    /*
     * Set Custom stub folder
     */
    //'stub' => '/resources/custom_stub',

    /*
     * PDF generator to be used when converting the table to pdf.
     * Available generators: excel, snappy
     * Snappy package: barryvdh/laravel-snappy
     * Excel package: maatwebsite/excel
     */
    'pdf_generator' => 'snappy',

    /*
     * Snappy PDF options.
     */
    'snappy' => [
        'options' => [
            'no-outline'    => true,
            'margin-left'   => '0',
            'margin-right'  => '0',
            'margin-top'    => '10mm',
            'margin-bottom' => '10mm',
        ],
        'orientation' => 'landscape',
    ],

    /*
     * Default html builder parameters.
     */
    'parameters' => [
        'dom'     => 'Bfrtip',
        'order'   => [[0, 'desc']],
        'buttons' => [
            'create',
            'export',
            'print',
            'reset',
            'reload',
        ],
    ],
];


text:
/*Avis
Lobo/Degue*/

package com.degueLobo.app.Entities.Autos;

import com.degueLobo.app.Entities.DAO;
import com.degueLobo.app.Entities.Utils.Colors;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author mjdegue
 */
public class AutoBaseDAO extends DAO<AutoBaseDTO>{

    public AutoBaseDAO(Connection conn)
    {
        super(conn, "vehiculo_base");
    }

    @Override
    public List<AutoBaseDTO> getAll() throws SQLException
    {
        List<AutoBaseDTO> baseList = new ArrayList<AutoBaseDTO>();
        PreparedStatement st = null;
        try
        {

            st = this.conn.prepareStatement("SELECT * FROM " + TABLE_NAME);
            st.executeQuery();
            try
            {
                //Should be only one
                ResultSet results = st.getResultSet();
                while(results.next()) {
                    ModelDTO model = new ModelDAO(conn).find(results.getInt(3));
                    if(model != null) {
                        AutoBaseDTO base = new AutoBaseDTO();
                        base.setId(results.getInt(1));
                        base.setDescripcion(results.getString(2));
                        base.setModel(model);
                        base.setColor(Colors.getById(results.getInt(4)));
                        baseList.add(base);
                    }
                }
                return baseList;
            }
            catch(SQLException e)
            {
                System.err.println("Couldn't retrieve user's id");
                throw e;
            }
        } catch (SQLException e)
        {
            System.err.println("Couldn't insert new user");
            throw e;
        }
    }

    @Override
    public AutoBaseDTO create(AutoBaseDTO model) throws SQLException
    {
        AutoBaseDTO newModel = null;
        PreparedStatement st = null;
        try
        {
            st = this.conn.prepareStatement("INSERT INTO " + TABLE_NAME + "(descripcion, modelo, color) VALUES (?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
            st.setString(1, model.getDescripcion());
            st.setInt(2, model.getModel().getId());
            st.setInt(3, model.getColor().getId());
            st.executeUpdate();
            try
            {
                ResultSet results = st.getGeneratedKeys();
                results.next();
                model.setId(results.getInt(1));
                newModel = model;
            }
            catch(SQLException e)
            {
                System.err.println("Couldn't retrieve user's id");
                throw e;
            }
        } catch (SQLException e)
        {
            System.err.println("Couldn't insert new user");
            throw e;
        }
        return newModel;
    }

    @Override
    public void update(AutoBaseDTO model) throws SQLException
    {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public AutoBaseDTO find(Integer id) throws SQLException
    {
        AutoBaseDTO base = null;
        PreparedStatement st = null;
        try
        {
            st = this.conn.prepareStatement("SELECT * FROM " + TABLE_NAME + " WHERE id = (?)");
            st.setInt(1, id);
            st.executeQuery();
            try
            {
                //Should be only one
                ResultSet results = st.getResultSet();
                if(results.next()) {
                    ModelDTO model = new ModelDAO(conn).find(results.getInt(3));
                    if(model != null) {
                        base = new AutoBaseDTO();
                        base.setId(results.getInt(1));
                        base.setDescripcion(results.getString(2));
                        base.setModel(model);
                        base.setColor(Colors.getById(results.getInt(4)));
                    }
                }
                return base;
            }
            catch(SQLException e)
            {
                System.err.println("Couldn't retrieve user's id");
                throw e;
            }
        } catch (SQLException e)
        {
            System.err.println("Couldn't insert new user");
            throw e;
        }
    }
}


text:
<?php
$language['DELETE_READED']='Delete';
$language['USER_LANGUE']='Language';
$language['USER_STYLE']='Style';
$language['CURRENTLY_PEER']='You’re currently seeding or leeching some torrent.';
$language['STOP_PEER']='You must stop your client.';
$language['USER_PWD_AGAIN']='Repeat password';
$language['EMAIL_FAILED']='Sending email has failed!';
$language['NO_SUBJECT']='No subject';
$language['MUST_ENTER_PASSWORD']='
You must enter your password to change the settings above.';
$language['ERR_PASS_WRONG']='Password empty or incorrect, cannot update profile.';
$language['MSG_DEL_ALL_PM']='If you select PMs which are not read, they will not be deleted';
$language['ERR_PM_GUEST']='Sorry you can’t send PM to guest or to yourself!';
?>


text:
require 'mspec/matchers'
require 'mspec/expectations'
require 'mspec/mocks'
require 'mspec/runner'
require 'mspec/guards'
require 'mspec/helpers'

require 'mspec/utils/script'
require 'mspec/version'

# If the implementation on which the specs are run cannot
# load pp from the standard library, add a pp.rb file that
# defines the #pretty_inspect method on Object or Kernel.
begin
  require 'pp'
rescue LoadError
  module Kernel
    def pretty_inspect
      inspect
    end
  end
end

class SpecRunner < MSpecScript
  def initialize
    super
    config[:files] = []

    #MSpec.guard
    app_folder = Rho::RhoFSConnector.get_app_path('app')
    app_folder.gsub!(/\\/, '/')

    specs = app_folder + "**/*_spec" + RHO_RB_EXT
    Dir.glob(specs) { |file|
      file.gsub!(app_folder,"")

      if RHO_RB_EXT == '.rb'
        file.gsub!(/\.rb/,"")
      else
        file.gsub!(/\.iseq/,"")
      end

      config[:files] << file
    }

  end

  def run

    MSpec.register_files config[:files]

    MSpec.process
    MSpec.exit_code
  end
end


text:
package org.red5.client.net.rtmpt;

import java.util.Map;

import org.apache.mina.core.buffer.IoBuffer;
import org.red5.client.net.rtmp.BaseRTMPClientHandler;
import org.red5.client.net.rtmp.OutboundHandshake;
import org.red5.server.net.rtmp.RTMPConnection;
import org.red5.server.net.rtmp.codec.RTMP;
import org.red5.server.net.rtmp.codec.RTMPProtocolDecoder;
import org.red5.server.net.rtmp.codec.RTMPProtocolEncoder;
import org.red5.server.net.rtmp.message.Constants;
import org.red5.server.net.rtmp.message.Packet;
import org.red5.server.net.rtmpt.codec.RTMPTCodecFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * RTMPT client object
 *
 * @author Anton Lebedevich
 */
public class RTMPTClient extends BaseRTMPClientHandler {

    private static final Logger log = LoggerFactory.getLogger(RTMPTClient.class);

    // guarded by this
    protected RTMPTClientConnector connector;

    protected RTMPTCodecFactory codecFactory;

    public RTMPTClient() {
        protocol = "rtmpt";
        codecFactory = new RTMPTCodecFactory();
        codecFactory.init();
    }

    @Override
    public Map<String, Object> makeDefaultConnectionParams(String server, int port, String application) {
        Map<String, Object> params = super.makeDefaultConnectionParams(server, port, application);
        if (!params.containsKey("tcUrl")) {
            params.put("tcUrl", protocol + "://" + server + ':' + port + '/' + application);
        }
        return params;
    }

    @Override
    protected synchronized void startConnector(String server, int port) {
        connector = new RTMPTClientConnector(server, port, this);
        log.debug("Created connector {}", connector);
        connector.start();
    }

    /**
     * Received message object router.
     *
     * @param message
     *            an IoBuffer or Packet
     */
    public void messageReceived(Object message) {
        if (message instanceof Packet) {
            try {
                messageReceived(conn, (Packet) message);
            } catch (Exception e) {
                log.warn("Exception on packet receive", e);
            }
        } else {
            // raw buffer handling
            IoBuffer in = (IoBuffer) message;
            // filter based on current connection state
            RTMP rtmp = conn.getState();
            final byte connectionState = conn.getStateCode();
            log.trace("connectionState: {}", RTMP.states[connectionState]);
            // get the handshake
            OutboundHandshake handshake = (OutboundHandshake) conn.getAttribute(RTMPConnection.RTMP_HANDSHAKE);
            switch (connectionState) {
                case RTMP.STATE_CONNECT:
                    log.debug("Handshake - client phase 1 - size: {}", in.remaining());
                    in.get(); // 0x01
                    byte handshakeType = in.get(); // usually 0x03 (rtmp)
                    log.debug("Handshake - byte type: {}", handshakeType);
                    // copy out 1536 bytes
                    byte[] s1 = new byte[Constants.HANDSHAKE_SIZE];
                    in.get(s1);
                    // decode s1
                    IoBuffer out = handshake.decodeServerResponse1(IoBuffer.wrap(s1));
                    if (out != null) {
                        // set state to indicate we're waiting for S2
                        rtmp.setState(RTMP.STATE_HANDSHAKE);
                        conn.writeRaw(out);
                        // if we got S0S1+S2 continue processing
                        if (in.remaining() >= Constants.HANDSHAKE_SIZE) {
                            log.debug("Handshake - client phase 2 - size: {}", in.remaining());
                            if (handshake.decodeServerResponse2(in)) {
//                                conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
//                                conn.setStateCode(RTMP.STATE_CONNECTED);
//                                connectionOpened(conn);
                            } else {
                                log.warn("Handshake failed on S2 processing");
                                //conn.close();
                            }
                            // open regardless of server type
                            conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
                            conn.setStateCode(RTMP.STATE_CONNECTED);
                            connectionOpened(conn);
                        }
                    } else {
                        log.warn("Handshake failed on S0S1 processing");
                        conn.close();
                    }
                    break;
                case RTMP.STATE_HANDSHAKE:
                    log.debug("Handshake - client phase 2 - size: {}", in.remaining());
                    if (handshake.decodeServerResponse2(in)) {
//                        conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
//                        conn.setStateCode(RTMP.STATE_CONNECTED);
//                        connectionOpened(conn);
                    } else {
                        log.warn("Handshake failed on S2 processing");
                        //conn.close();
                    }
                    // open regardless of server type
                    conn.removeAttribute(RTMPConnection.RTMP_HANDSHAKE);
                    conn.setStateCode(RTMP.STATE_CONNECTED);
                    connectionOpened(conn);
                    break;
                default:
                    throw new IllegalStateException("Invalid RTMP state: " + connectionState);
            }
        }
    }

    @Override
    public synchronized void disconnect() {
        if (connector != null) {
            connector.setStopRequested(true);
            connector.interrupt();
        }
        super.disconnect();
    }

    public RTMPProtocolDecoder getDecoder() {
        return codecFactory.getRTMPDecoder();
    }

    public RTMPProtocolEncoder getEncoder() {
        return codecFactory.getRTMPEncoder();
    }

}


text:
// Provides the base class for all drag and drop configurations.
sap.ui.define([
	'sap/base/Log',
	'../Element',
	'../library',
	'./DragAndDrop'
], function(Log, Element /*, library, DragAndDrop */) {
	"use strict";

	/**
	 * Constructor for a new DragDropBase.
	 *
	 * @param {string} [sId] ID for the new control, generated automatically if no ID is given
	 * @param {object} [mSettings] Initial settings for the new control
	 *
	 * @abstract
	 * @class
	 * Provides the base class for all drag-and-drop configurations.
	 * This feature enables a native HTML5 drag-and-drop API for the controls, therefore it is limited to browser support.
	 *
Restrictions

	 *

	 *
There is no accessible alternative for drag and drop. Applications which use the drag-and-drop functionality must provide an
	 *   accessible alternative UI (for example, action buttons or menus) to perform the same operations.

	 *
Transparency of the drag ghost element and the cursor during drag-and-drop operations depends on the browser implementation.

	 *
Constraining a drag position is not possible, therefore there is no snap-to-grid or snap-to-element feature possible.

	 *
Texts in draggable controls cannot be selected.

	 *
The text of input fields in draggable controls can be selected, but not dragged.

	 *

	 *
	 * @see {@link topic:3ddb6cde6a8d416598ac8ced3f5d82d5 Drag and Drop}
	 *
	 * @extends sap.ui.core.Element
	 * @author SAP SE
	 * @version ${version}
	 *
	 * @public
	 * @since 1.52
	 * @alias sap.ui.core.dnd.DragDropBase
	 */
	var DragDropBase = Element.extend("sap.ui.core.dnd.DragDropBase", /** @lends sap.ui.core.dnd.DragDropBase.prototype */ {
		metadata: {
			"abstract": true,
			library: "sap.ui.core",
			properties: {
				/**
				 * Defines the name of the group to which this object belongs. If groupName is specified, then this object will only interacts with other drag-and-drop objects within the same group.
				 */
				groupName: {type: "string", defaultValue: null, invalidate: false},

				/**
				 * Indicates whether this configuration is active or not.
				 * @since 1.56
				 */
				enabled: {type: "boolean", defaultValue: true, invalidate: false}
			}
		}
	});

	/**
	 * This private flag determines whether or not to check dnd metadata settings.
	 * @private
	 * @ui5-restricted sap.ui.mdc
	 */
	DragDropBase.prototype.bIgnoreMetadataCheck = false;

	/**
	 * @abstract
	 */
	DragDropBase.prototype.isDraggable = function(oControl) {
		return false;
	};

	/**
	 * @abstract
	 */
	DragDropBase.prototype.isDroppable = function(oControl, oEvent) {
		return false;
	};

	/**
	 * Checks control metadata restrictions.
	 */
	DragDropBase.prototype.checkMetadata = function(oControl, sAggregation, sRestriction) {
		if (this.bIgnoreMetadataCheck) {
			return true;
		}

		var oMetadata = oControl.getMetadata().getDragDropInfo(sAggregation);
		if (!oMetadata[sRestriction]) {
			Log.warning((sAggregation ? sAggregation + " aggregation of " : "") + oControl + " is not configured to be " + sRestriction);
			return false;
		}

		return true;
	};

	/*
	 * Suppress invalidation when the invalidate attribute of the property metadata is "false".
	 */
	DragDropBase.prototype.setProperty = function(sProperty, vValue, bSuppressInvalidate) {
		bSuppressInvalidate = (bSuppressInvalidate == undefined) ? (this.getMetadata().getProperty(sProperty).appData || {}).invalidate === false : bSuppressInvalidate;
		return Element.prototype.setProperty.call(this, sProperty, vValue, bSuppressInvalidate);
	};

	return DragDropBase;

});


text:
package com.banjocreek.riverbed.builder.json.kernel;

import javax.json.JsonArrayBuilder;
import javax.json.JsonObjectBuilder;

final class BooleanOp implements JsonOp {

    private final boolean value;

    public BooleanOp(final boolean value) {
        this.value = value;
    }

    @Override
    public void apply(final JsonArrayBuilder jbuf) {
        jbuf.add(this.value);
    }

    @Override
    public void apply(final String key, final JsonObjectBuilder jbuf) {
        jbuf.add(key, this.value);
    }
}


text:
package com.woorea.openstack.quantum.model;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonUnwrapped;
import org.codehaus.jackson.map.annotate.JsonRootName;

@SuppressWarnings("serial")
@JsonRootName("port")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Port implements Serializable {

    public static final class Ip implements Serializable {

        @JsonProperty("ip_address")
        private String address;

        @JsonProperty("subnet_id")
        private String subnetId;

        /**
         * @return the address
         */
        public String getAddress() {
            return address;
        }

        /**
         * @param address
         *            the address to set
         */
        public void setAddress(String address) {
            this.address = address;
        }

        /**
         * @return the subnetId
         */
        public String getSubnetId() {
            return subnetId;
        }

        /**
         * @param subnetId
         *            the subnetId to set
         */
        public void setSubnetId(String subnetId) {
            this.subnetId = subnetId;
        }

        @Override
        public String toString() {
            return "ip_addresses [ip_address=" + address + ", subnet_id=" + subnetId + "]";
        }

    }

    public static final class Binding {

        /**
         * The host on which the port will be allocated.
         */
        @JsonProperty("binding:host_id")
        private String hostId;

        /**
         * The vif type for the specific port.
         */
        @JsonProperty("binding:vif_type")
        private String vifType;

        /**
         * The type of vnic that this port should be attached to
         */
        @JsonProperty("binding:vnic_type")
        private String vnicType;

        /**
         * A map containing additional information needed by the interface driver
         */
        @JsonProperty("binding:vif_details")
        private Map<String, String> vifDetails;

        /**
         * A map to enable applications running on the specific host to pass and receive vif port specific information
         * to the plugin.
         */
        @JsonProperty("binding:profile")
        private Map<String, String> profile;

        public String getHostId() {
            return hostId;
        }

        public void setHostId(String hostId) {
            this.hostId = hostId;
        }

        public String getVifType() {
            return vifType;
        }

        public void setVifType(String vifType) {
            this.vifType = vifType;
        }

        public String getVnicType() {
            return vnicType;
        }

        public void setVnicType(String vnicType) {
            this.vnicType = vnicType;
        }

        public Map<String, String> getVifDetails() {
            return vifDetails;
        }

        public void setVifDetails(Map<String, String> vifDetails) {
            this.vifDetails = vifDetails;
        }

        public Map<String, String> getProfile() {
            return profile;
        }

        public void setProfile(Map<String, String> profile) {
            this.profile = profile;
        }

        @Override
        public String toString() {
            return "Binding [hostId=" + hostId
                    + ", vifType=" + vifType +
                    ", vnicType=" + vnicType +
                    ", vifDetails=" + vifDetails +
                    ", profile=" + profile + "]";
        }
    }

    @JsonProperty("admin_state_up")
    private Boolean adminStateUp;

    @JsonProperty("device_id")
    private String deviceId;

    @JsonProperty("device_owner")
    private String deviceOwner;

    @JsonProperty("fixed_ips")
    private List<Ip> list;

    private String id;

    @JsonProperty("mac_address")
    private String macAddress;

    private String name;

    @JsonProperty("network_id")
    private String networkId;

    private String status;

    @JsonProperty("tenant_id")
    private String tenantId;

    @JsonProperty("security_groups")
    private List<String> securityGroups;

    @JsonUnwrapped
    private Binding binding;

    /**
     * @return the adminStateUp
     */
    public Boolean getAdminStateUp() {
        return adminStateUp;
    }

    /**
     * @param adminStateUp
     *            the adminStateUp to set
     */
    public void setAdminStateUp(Boolean adminStateUp) {
        this.adminStateUp = adminStateUp;
    }

    /**
     * @return the deviceId
     */
    public String getDeviceId() {
        return deviceId;
    }

    /**
     * @param deviceId
     *            the deviceId to set
     */
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    /**
     * @return the deviceOwner
     */
    public String getDeviceOwner() {
        return deviceOwner;
    }

    /**
     * @param deviceOwner
     *            the deviceOwner to set
     */
    public void setDeviceOwner(String deviceOwner) {
        this.deviceOwner = deviceOwner;
    }

    /**
     * @return the list
     */
    public List<Ip> getList() {
        return list;
    }

    /**
     * @param list
     *            the list to set
     */
    public void setList(List<Ip> list) {
        this.list = list;
    }

    /**
     * @return the id
     */
    @JsonIgnore
    public String getId() {
        return id;
    }

    /**
     * @param id
     *            the id to set
     */
    @JsonProperty
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the macAddress
     */
    public String getMacAddress() {
        return macAddress;
    }

    /**
     * @param macAddress
     *            the macAddress to set
     */
    public void setMacAddress(String macAddress) {
        this.macAddress = macAddress;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name
     *            the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the networkId
     */
    public String getNetworkId() {
        return networkId;
    }

    /**
     * @param networkId
     *            the networkId to set
     */
    public void setNetworkId(String networkId) {
        this.networkId = networkId;
    }

    /**
     * @return the status
     */
    @JsonIgnore
    public String getStatus() {
        return status;
    }

    /**
     * @param status
     *            the status to set
     */
    @JsonProperty
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * @return the tenantId
     */
    public String getTenantId() {
        return tenantId;
    }

    /**
     * @param tenantId
     *            the tenantId to set
     */
    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    /**
     * @return the associated security group IDs
     */
    public List<String> getSecurityGroups() {
        return securityGroups;
    }

    /**
     * @param securityGroups
     *            IDs of security groups to associate to the port
     */
    public void setSecurityGroups(List<String> securityGroups) {
        this.securityGroups = securityGroups;
    }

    /**
     * @return the binding of the port
     */
    public Binding getBinding() {
        return binding;
    }

    /**
     * @param binding
     *            The port bindings by which the port is bind to network on host
     */
    public void setBinding(Binding binding) {
        this.binding = binding;
    }

    @Override
    public String toString() {
        return "Port [id=" + id + ", name=" + name + ", mac_address="
                + macAddress + ", admin_state_up=" + adminStateUp + ", device_id=" + deviceId
                + ", device_owner=" + deviceOwner + ", fixed_ips=" + list
                + ", network_id=" + networkId + ", status=" + status
                + ", tenant_id=" + tenantId
                + ", securityGroups=" + securityGroups
                + ", binding=" + binding + "]";
    }
}


text:
package org.cleartk.feature.syntax;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.uima.jcas.JCas;
import org.cleartk.ml.Feature;
import org.cleartk.ml.feature.extractor.NamedFeatureExtractor1;
import org.cleartk.syntax.constituent.type.TreebankNode;
import org.apache.uima.fit.util.JCasUtil;

/**
 *

 * Copyright (c) 2007-2008, Regents of the University of Colorado

 * All rights reserved.
 *
 *
 * @author Philipp Wetzler
 */

public class SubCategorizationExtractor implements NamedFeatureExtractor1<TreebankNode> {
  private String featureName;

  public SubCategorizationExtractor(String name) {
    this.featureName = Feature.createName(name, "SubCategorization");
  }

  public SubCategorizationExtractor() {
    this(null);
  }

  @Override
  public String getFeatureName() {
    return this.featureName;
  }

  public List<Feature> extract(JCas jCas, TreebankNode node)
      throws UnsupportedOperationException {

    TreebankNode parent = node.getParent();
    if (parent == null)
      return new ArrayList<Feature>();

    StringBuffer buffer = new StringBuffer();
    buffer.append(parent.getNodeType() + "->");
    boolean first = true;
    for (TreebankNode child : JCasUtil.select(parent.getChildren(), TreebankNode.class)) {
      if (!first)
        buffer.append("-");
      buffer.append(child.getNodeType());
      first = false;
    }

    return Collections.singletonList(new Feature(this.featureName, buffer));
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Boletus haedinus Berk. & Broome

### Remarks
null


text:
package com.xinyou.frame.response;

import java.util.List;

import com.xinyou.frame.domain.entities.BIZ_SYS;
import com.xinyou.frame.domain.models.SYS_DM;

public class BizSysResponse {

	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getInfo() {
		return info;
	}
	public void setInfo(String info) {
		this.info = info;
	}
	public BIZ_SYS getBizSysData() {
		return bizSysData;
	}
	public void setBizSysData(BIZ_SYS bizSysData) {
		this.bizSysData = bizSysData;
	}
	public List<BIZ_SYS> getBizSysListData() {
		return bizSysListData;
	}
	public void setBizSysListData(List<BIZ_SYS> bizSysListData) {
		this.bizSysListData = bizSysListData;
	}
	public SYS_DM getBizSysDMData() {
		return bizSysDMData;
	}
	public void setBizSysDMData(SYS_DM bizSysDMData) {
		this.bizSysDMData = bizSysDMData;
	}
	private String status;
	private String info;
	private BIZ_SYS bizSysData;
	private List<BIZ_SYS> bizSysListData;
	private SYS_DM bizSysDMData;

}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the MIT license.  See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.Formatting;

namespace Microsoft.NetCore.Analyzers.Performance
{
    /// <summary>
    /// CA1827: Do not use Count()/LongCount() when Any() can be used.
    /// CA1828: Do not use CountAsync()/LongCountAsync() when AnyAsync() can be used.
    /// </summary>
    public abstract class DoNotUseCountWhenAnyCanBeUsedFixer : CodeFixProvider
    {
        private const string AsyncMethodName = "AnyAsync";
        private const string SyncMethodName = "Any";

        /// <summary>
        /// A list of diagnostic IDs that this provider can provider fixes for.
        /// </summary>
        /// <value>The fixable diagnostic ids.</value>
        public override ImmutableArray<string> FixableDiagnosticIds { get; } =
            ImmutableArray.Create(
                UseCountProperlyAnalyzer.CA1827,
                UseCountProperlyAnalyzer.CA1828);

        /// <summary>
        /// Gets an optional <see cref="FixAllProvider" /> that can fix all/multiple occurrences of diagnostics fixed by this code fix provider.
        /// Return null if the provider doesn't support fix all/multiple occurrences.
        /// Otherwise, you can return any of the well known fix all providers from <see cref="WellKnownFixAllProviders" /> or implement your own fix all provider.
        /// </summary>
        /// <returns>FixAllProvider.</returns>
        public sealed override FixAllProvider GetFixAllProvider()
        {
            // See https://github.com/dotnet/roslyn/blob/main/docs/analyzers/FixAllProvider.md for more information on Fix All Providers
            return WellKnownFixAllProviders.BatchFixer;
        }

        /// <summary>
        /// Computes one or more fixes for the specified <see cref="CodeFixContext" />.
        /// </summary>
        /// <param name="context">A <see cref="CodeFixContext" /> containing context information about the diagnostics to fix.
        /// The context must only contain diagnostics with a <see cref="Diagnostic.Id" /> included in the <see cref="CodeFixProvider.FixableDiagnosticIds" />
        /// for the current provider.</param>
        /// <returns>A <see cref="Task" /> that represents the asynchronous operation.</returns>
        public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
        {
            var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
            var node = root.FindNode(context.Span);
            var properties = context.Diagnostics[0].Properties;
            var shouldNegateKey = properties.ContainsKey(UseCountProperlyAnalyzer.ShouldNegateKey);
            var isAsync = properties.ContainsKey(UseCountProperlyAnalyzer.IsAsyncKey) ||
                context.Diagnostics[0].Id == UseCountProperlyAnalyzer.CA1828;

            if (node is object &&
                properties.TryGetValue(UseCountProperlyAnalyzer.OperationKey, out var operation) &&
                this.TryGetFixer(node, operation, isAsync, out var expression, out var arguments))
            {
                context.RegisterCodeFix(
                    new DoNotUseCountWhenAnyCanBeUsedCodeAction(isAsync, context.Document, node, expression, arguments, shouldNegateKey),
                    context.Diagnostics);
            }
        }

        /// <summary>
        /// Tries to get a fixer for the specified <paramref name="node" />.
        /// </summary>
        /// <param name="node">The node to get a fixer for.</param>
        /// <param name="operation">The operation to get the fixer from.</param>
        /// <param name="isAsync"><see langword="true" /> if it's an asynchronous method; <see langword="false" /> otherwise.</param>
        /// <param name="expression">If this method returns <see langword="true" />, contains the expression to be used to invoke <c>Any</c>.</param>
        /// <param name="arguments">If this method returns <see langword="true" />, contains the arguments from <c>Any</c> to be used on <c>Count</c>.</param>
        /// <returns><see langword="true" /> if a fixer was found., <see langword="false" /> otherwise.</returns>
        protected abstract bool TryGetFixer(
            SyntaxNode node,
            string operation,
            bool isAsync,
            [NotNullWhen(returnValue: true)] out SyntaxNode? expression,
            [NotNullWhen(returnValue: true)] out IEnumerable<SyntaxNode>? arguments);

        private class DoNotUseCountWhenAnyCanBeUsedCodeAction : CodeAction
        {
            private readonly bool _isAsync;
            private readonly Document _document;
            private readonly SyntaxNode _pattern;
            private readonly SyntaxNode _expression;
            private readonly IEnumerable<SyntaxNode> _arguments;
            private readonly bool _shouldNegateKey;

            public DoNotUseCountWhenAnyCanBeUsedCodeAction(
                bool isAsync,
                Document document,
                SyntaxNode pattern,
                SyntaxNode expression,
                IEnumerable<SyntaxNode> arguments,
                bool shouldNegateKey)
            {
                this._isAsync = isAsync;
                this._document = document;
                this._pattern = pattern;
                this._expression = expression;
                this._arguments = arguments;
                this._shouldNegateKey = shouldNegateKey;

                var title = !isAsync ?
                    MicrosoftNetCoreAnalyzersResources.DoNotUseCountWhenAnyCanBeUsedTitle :
                    MicrosoftNetCoreAnalyzersResources.DoNotUseCountAsyncWhenAnyAsyncCanBeUsedTitle;
                this.Title = title;
                this.EquivalenceKey = title;
            }

            public override string Title { get; }

            public override string EquivalenceKey { get; }

            protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
            {
                var editor = await DocumentEditor.CreateAsync(this._document, cancellationToken).ConfigureAwait(false);
                var generator = editor.Generator;
                var memberAccess = generator.MemberAccessExpression(this._expression.WithoutTrailingTrivia(), this._isAsync ? AsyncMethodName : SyncMethodName);
                var replacementSyntax = generator.InvocationExpression(memberAccess, _arguments);

                if (this._isAsync)
                {
                    replacementSyntax = generator.AwaitExpression(replacementSyntax);
                }

                if (this._shouldNegateKey)
                {
                    replacementSyntax = generator.LogicalNotExpression(replacementSyntax);
                }

                replacementSyntax = replacementSyntax
                    .WithAdditionalAnnotations(Formatter.Annotation)
                    .WithTriviaFrom(this._pattern);

                editor.ReplaceNode(this._pattern, replacementSyntax);

                return editor.GetChangedDocument();
            }
        }
    }
}


text:
@interface NSWindow (TrueCenter)

- (void)trueCenter;

@end


text:
class InterfaceGraphique {

	public :
		Microprocesseur * microP;

		InterfaceGraphique(Microprocesseur *);

		void afficherEtatMicroP(Microprocesseur *);
		void execute(Microprocesseur *);

};

#endif


text:
package info.sleeplessacorn.morechisels.util;

import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.oredict.OreDictionary;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class OreDictHelper {

    public static List<String> getAllFromPrefix(String prefix) {
        return Arrays.stream(OreDictionary.getOreNames())
                .filter(entry -> entry.startsWith(prefix))
                .collect(Collectors.toList());
    }

    public static String format(String input) {
        return input.replaceAll("[A-Z]","_$0");
    }

    public static boolean hasItems(NonNullList<ItemStack> ores) {
        return ores.size() > 0 && !ores.get(0).isEmpty();
    }

}


text:
package org.apache.flink.runtime.testutils;

import org.apache.flink.api.java.utils.ParameterTool;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.TaskManagerOptions;
import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.taskmanager.TaskManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.CountDownLatch;

import static org.apache.flink.util.Preconditions.checkArgument;
import static org.apache.flink.util.Preconditions.checkNotNull;

/**
 * A {@link TaskManager} instance running in a separate JVM.
 */
public class TaskManagerProcess extends TestJvmProcess {

	/** ID for this TaskManager */
	private final int id;

	/** The configuration for the TaskManager */
	private final Configuration config;

	/** Configuration parsed as args for {@link TaskManagerProcess.TaskManagerProcessEntryPoint} */
	private final String[] jvmArgs;

	public TaskManagerProcess(int id, Configuration config) throws Exception {
		checkArgument(id >= 0, "Negative ID");
		this.id = id;
		this.config = checkNotNull(config, "Configuration");

		ArrayList<String> args = new ArrayList<>();

		for (Map.Entry<String, String> entry : config.toMap().entrySet()) {
			args.add("--" + entry.getKey());
			args.add(entry.getValue());
		}

		this.jvmArgs = new String[args.size()];
		args.toArray(jvmArgs);
	}

	@Override
	public String getName() {
		return "TaskManager " + id;
	}

	@Override
	public String[] getJvmArgs() {
		return jvmArgs;
	}

	@Override
	public String getEntryPointClassName() {
		return TaskManagerProcessEntryPoint.class.getName();
	}

	public int getId() {
		return id;
	}

	@Override
	public String toString() {
		return String.format("TaskManagerProcess(id=%d)", id);
	}

	/**
	 * Entry point for the TaskManager process.
	 */
	public static class TaskManagerProcessEntryPoint {

		private static final Logger LOG = LoggerFactory.getLogger(TaskManagerProcessEntryPoint.class);

		/**
		 * All arguments are parsed to a {@link Configuration} and passed to the Taskmanager,
		 * for instance: <code>--high-availability ZOOKEEPER --high-availability.zookeeper.quorum "xyz:123:456"</code>.
		 */
		public static void main(String[] args) throws Exception {
			try {
				Configuration config = ParameterTool.fromArgs(args).getConfiguration();

				if (!config.contains(TaskManagerOptions.MANAGED_MEMORY_SIZE)) {
					config.setLong(TaskManagerOptions.MANAGED_MEMORY_SIZE, 4L);
				}

				if (!config.contains(TaskManagerOptions.NETWORK_NUM_BUFFERS)) {
					config.setInteger(TaskManagerOptions.NETWORK_NUM_BUFFERS, 100);
				}

				LOG.info("Configuration: {}.", config);

				// Run the TaskManager
				TaskManager.selectNetworkInterfaceAndRunTaskManager(
					config,
					ResourceID.generate(),
					TaskManager.class);

				// Run forever
				new CountDownLatch(1).await();
			}
			catch (Throwable t) {
				LOG.error("Failed to start TaskManager process", t);
				System.exit(1);
			}
		}
	}

}


text:
* Applies to quadcopters
* Assumptions:
  * All four rotors act as one

## Commands (high-level):

*	Takeoff (power on, calibrate, config, etc.)
*	Land
*	Hover
*	Up
*	Down
* Based on the camera position during initial calibration:
  *	Forward
  *	Back
  *	Left
  *	Right
  *	RotateLeft
  *	RotateRight
*	Move
  * this is the actual command the rest for the most part is preset off of this one
  * this command will correspond to AT* move command which will generally be device specific with a general form of cmd: flag, roll, pitch, gaz, yaw.


text:
<?php namespace LW\Statistics;

use Illuminate\Support\Collection;

class StatisticsHelper {

	/**
	 * @var \LW\Statistics\ProvidersHelper
	 */
	protected $providersHelper;

	/**
	 * @var \LW\Statistics\RangeHelper
	 */
	protected $rangeHelper;

	/**
	 * @var \LW\Statistics\DateRange
	 */
	protected $period;

	/**
	 * @var \LW\Statistics\Interval
	 */
	protected $interval;

	/**
	 * @param \LW\Statistics\ProvidersHelper $providersHelper
	 * @param \LW\Statistics\RangeHelper $rangeHelper
	 */
	public function __construct(ProvidersHelper $providersHelper, RangeHelper $rangeHelper)
	{
		$this->providersHelper = $providersHelper;
		$this->rangeHelper = $rangeHelper;
	}

	/**
	 * @return \LW\Statistics\ProvidersHelper
	 */
	public function providers()
	{
		return $this->providersHelper;
	}

	/**
	 * @param string $period
	 */
	public function period($period)
	{
		$this->period = $this->rangeHelper->parse($period);
	}

	/**
	 * @param array $interval
	 */
	public function interval($interval)
	{
		$this->interval = new Interval($interval);
	}

	/**
	 * @param array $providers
	 * @return \Illuminate\Support\Collection
	 */
	public function get(array $providers)
	{
		$return = new Collection;
		$providerCollection = $this->getProviderCollection(array_keys($providers));

		foreach ($providers as $provider => $scopes)
		{
			$return[$provider] = $this->results($providerCollection->get($provider), $scopes);
		}

		if ($this->interval)
		{
			$return['_totals'] = $this->totals($return);
		}

		return $return;
	}

	/**
	 * @param \Illuminate\Support\Collection $results
	 * @return array
	 */
	protected function totals($results)
	{
		$return = new Collection;

		$results->map(function($results, $provider) use ($return)
		{
			$totals = new Collection;

			foreach ($results as $scope => $resultSet)
			{
				$totals[$scope] = array_sum(array_values($resultSet));
			}

			$totals['_total'] = array_sum($totals->toArray());
			$return[$provider] = $totals;
		});

		return $return;
	}

	/**
	 * @param \LW\Statistics\StatisticsProviderInterface $provider
	 * @param array $scopes
	 * @return \Illuminate\Support\Collection
	 */
	protected function results(StatisticsProviderInterface $provider, $scopes)
	{
		if (is_string($scopes))
		{
			$scopes = explode(',', $scopes);
		}

		$results = new Collection;

		foreach ($scopes as $scope)
		{
			list($method, $args) = $this->parseScope($scope);

			$results[$scope] = $this->call($provider, $method, $args);
		}

		return $results;
	}

	/**
	 * @param \LW\Statistics\StatisticsProviderInterface $provider
	 * @param string $method
	 * @param array $args
	 * @return string|int|array
	 */
	protected function call(StatisticsProviderInterface $provider, $method, $args)
	{
		if ($this->period)
		{
			$this->period->apply($provider);
		}

		if ($this->interval)
		{
			return $this->callInterval($provider, $method, $args);
		}

		return call_user_func_array([$provider, $method], $args);
	}

	/**
	 * @param \LW\Statistics\StatisticsProviderInterface $provider
	 * @param string $method
	 * @param array $args
	 * @return array
	 */
	protected function callInterval(StatisticsProviderInterface $provider, $method, $args)
	{
		$provider->setInterval($this->interval);

		$result = call_user_func_array([$provider, $method], $args);

		return $result;
	}

	/**
	 * @param string $scope
	 * @return array
	 */
	protected function parseScope($scope)
	{
		if (count($parts = explode(':', $scope, 2)) === 2)
		{
			$parts[1] = explode(':', $parts[1]);
		}
		else
		{
			$parts[1] = [];
		}

		return $parts;
	}

	/**
	 * @param array $scopes
	 * @return \LW\Statistics\StatisticsProviderCollection
	 */
	protected function getProviderCollection(array $scopes)
	{
		return $this->providersHelper->providers($scopes);
	}

}


text:
const GUI = (function() {
	let eventOnOptMessagesPerPageChanged;
	let eventOnOptMessageFilterChanged;
	let eventOnNavButtonClicked;

	const getActiveFilter = function() {
		const active = DOM.fcls("active", DOM.id("opt-filter-list"));

		return active && active.value !== "" ? {
			"type": active.getAttribute("data-filter-type"),
			"value": active.value
		} : null;
	};

	const triggerFilterChanged = function() {
		eventOnOptMessageFilterChanged && eventOnOptMessageFilterChanged(getActiveFilter());
	};

	const showModal = function(width, html) {
		const dialog = DOM.id("dialog");
		dialog.innerHTML = html;
		dialog.style.width = width + "px";
		dialog.style.marginLeft = (-width / 2) + "px";

		DOM.id("modal").classList.add("visible");
		return dialog;
	};

	// -------------
	// Modal dialogs
	// -------------

	const showSettingsModal = function() {
		showModal(560, `
<input id='dht-cfg-imgpreviews' type='checkbox'> Image Previews

<input id='dht-cfg-formatting' type='checkbox'> Message Formatting

<input id='dht-cfg-useravatars' type='checkbox'> User Avatars

<input id='dht-cfg-animemoji' type='checkbox'> Animated Emoji
`);

		const setupCheckBox = function(id, settingName) {
			const ele = DOM.id(id);
			ele.checked = SETTINGS[settingName];
			ele.addEventListener("change", () => SETTINGS[settingName] = ele.checked);
		};

		setupCheckBox("dht-cfg-imgpreviews", "enableImagePreviews");
		setupCheckBox("dht-cfg-formatting", "enableFormatting");
		setupCheckBox("dht-cfg-useravatars", "enableUserAvatars");
		setupCheckBox("dht-cfg-animemoji", "enableAnimatedEmoji");
	};

	const showInfoModal = function() {
		const linkGH = "https://github.com/chylex/Discord-History-Tracker";

		showModal(560, `

Discord History Tracker is developed by chylex as an open source project.

Please, report any issues and suggestions to the tracker. If you want to support the development, please spread the word and consider becoming a patron or buying me a coffee. Any support is appreciated!

Issue Tracker  —  GitHub Repository  —  Developer's Twitter
`);
	};

	return {

		// ---------
		// GUI setup
		// ---------

		setup() {
			const inputMessageFilter = DOM.id("opt-messages-filter");
			const containerFilterList = DOM.id("opt-filter-list");

			const resetActiveFilter = function() {
				inputMessageFilter.value = "";
				inputMessageFilter.dispatchEvent(new Event("change"));

				DOM.id("opt-filter-contents").value = "";
			};

			inputMessageFilter.value = ""; // required to prevent browsers from remembering old value

			inputMessageFilter.addEventListener("change", () => {
				DOM.cls("active", containerFilterList).forEach(ele => ele.classList.remove("active"));

				if (inputMessageFilter.value) {
					containerFilterList.querySelector("[data-filter-type='" + inputMessageFilter.value + "']").classList.add("active");
				}

				triggerFilterChanged();
			});

			Array.prototype.forEach.call(containerFilterList.children, ele => {
				ele.addEventListener(ele.tagName === "SELECT" ? "change" : "input", () => triggerFilterChanged());
			});

			DOM.id("opt-messages-per-page").addEventListener("change", () => {
				eventOnOptMessagesPerPageChanged && eventOnOptMessagesPerPageChanged();
			});

			DOM.tag("button", DOM.fcls("nav")).forEach(button => {
				button.disabled = true;

				button.addEventListener("click", () => {
					eventOnNavButtonClicked && eventOnNavButtonClicked(button.getAttribute("data-nav"));
				});
			});

			DOM.id("btn-settings").addEventListener("click", () => {
				showSettingsModal();
			});

			DOM.id("btn-about").addEventListener("click", () => {
				showInfoModal();
			});

			DOM.id("messages").addEventListener("click", e => {
				const jump = e.target.getAttribute("data-jump");

				if (jump) {
					resetActiveFilter();

					const index = STATE.navigateToMessage(jump);

					if (index === -1) {
						alert("Message not found.");
					}
					else {
						DOM.id("messages").children[index].scrollIntoView();
					}
				}
			});

			DOM.id("overlay").addEventListener("click", () => {
				DOM.id("modal").classList.remove("visible");
				DOM.id("dialog").innerHTML = "";
			});
		},

		// -----------------
		// Event registering
		// -----------------

		/**
		 * Sets a callback for when the user changes the messages per page option. The callback is not passed any arguments.
		 */
		onOptionMessagesPerPageChanged(callback) {
			eventOnOptMessagesPerPageChanged = callback;
		},

		/**
		 * Sets a callback for when the user changes the active filter. The callback is passed either null or an object such as { type: <filter type>, value: <filter value> }.
		 */
		onOptMessageFilterChanged(callback) {
			eventOnOptMessageFilterChanged = callback;
		},

		/**
		 * Sets a callback for when the user clicks a navigation button. The callback is passed one of the following strings: first, prev, next, last.
		 */
		onNavigationButtonClicked(callback) {
			eventOnNavButtonClicked = callback;
		},

		// ----------------------
		// Options and navigation
		// ----------------------

		/**
		 * Returns the selected amount of messages per page.
		 */
		getOptionMessagesPerPage() {
			/** @type HTMLInputElement */
			const messagesPerPage = DOM.id("opt-messages-per-page");
			return parseInt(messagesPerPage.value, 10);
		},

		updateNavigation(currentPage, totalPages) {
			DOM.id("nav-page-current").innerHTML = currentPage;
			DOM.id("nav-page-total").innerHTML = totalPages || "?";

			DOM.id("nav-first").disabled = currentPage === 1;
			DOM.id("nav-prev").disabled = currentPage === 1;
			DOM.id("nav-pick").disabled = (totalPages || 0) <= 1;
			DOM.id("nav-next").disabled = currentPage === (totalPages || 1);
			DOM.id("nav-last").disabled = currentPage === (totalPages || 1);
		},

		// --------------
		// Updating lists
		// --------------

		/**
		 * Updates the channel list and sets up their click events. The callback is triggered whenever a channel is selected, and takes the channel ID as its argument.
		 */
		updateChannelList(channels, selected, callback) {
			const eleChannels = DOM.id("channels");

			if (!channels) {
				eleChannels.innerHTML = "";
			}
			else {
				if (getActiveFilter() != null) {
					channels = channels.filter(channel => channel.msgcount > 0);
				}

				eleChannels.innerHTML = channels.map(channel => DISCORD.getChannelHTML(channel)).join("");

				Array.prototype.forEach.call(eleChannels.children, ele => {
					ele.addEventListener("click", () => {
						const currentChannel = DOM.fcls("active", eleChannels);

						if (currentChannel) {
							currentChannel.classList.remove("active");
						}

						ele.classList.add("active");
						callback(ele.getAttribute("data-channel"));
					});
				});

				if (selected) {
					const activeChannel = eleChannels.querySelector("[data-channel='" + selected + "']");
					activeChannel && activeChannel.classList.add("active");
				}
			}
		},

		updateMessageList(messages) {
			DOM.id("messages").innerHTML = messages ? messages.map(message => DISCORD.getMessageHTML(message)).join("") : "";
		},

		updateUserList(users) {
			/** @type HTMLSelectElement */
			const eleSelect = DOM.id("opt-filter-user");

			while (eleSelect.length > 1) {
				eleSelect.remove(1);
			}

			const options = [];

			for (const key of Object.keys(users)) {
				const option = document.createElement("option");
				option.value = key;
				option.text = users[key].name;
				options.push(option);
			}

			options.sort((a, b) => a.text.toLocaleLowerCase().localeCompare(b.text.toLocaleLowerCase()));
			options.forEach(option => eleSelect.add(option));
		},

		scrollMessagesToTop() {
			DOM.id("messages").scrollTop = 0;
		}
	};
})();


text:
package org.elasticsearch.common.jna;

import org.apache.lucene.util.Constants;
import org.elasticsearch.common.jna.Kernel32Library.ConsoleCtrlHandler;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

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

import static org.hamcrest.Matchers.equalTo;

public class NativesTests extends ElasticsearchTestCase {

    /**
     * Those properties are set by the JNA Api and if not ignored,
     * lead to tests failure (see AbstractRandomizedTest#IGNORED_INVARIANT_PROPERTIES)
     */
    private static final String[] JNA_INVARIANT_PROPERTIES = {
            "jna.platform.library.path",
            "jnidispatch.path"
    };

    private Map<String, String> properties = new HashMap<>();

    @Before
    public void saveProperties() {
        for (String p : JNA_INVARIANT_PROPERTIES) {
            properties.put(p, System.getProperty(p));
        }
    }

    @After
    public void restoreProperties() {
        for (String p : JNA_INVARIANT_PROPERTIES) {
            if (properties.get(p) != null) {
                System.setProperty(p, properties.get(p));
            } else {
                System.clearProperty(p);
            }
        }
    }

    @Test
    public void testTryMlockall() {
        Natives.tryMlockall();

        if (Constants.WINDOWS) {
            assertFalse("Memory locking is not available on Windows platforms", Natives.LOCAL_MLOCKALL);
        }
    }

    @Test
    public void testAddConsoleCtrlHandler() {
        ConsoleCtrlHandler handler = new ConsoleCtrlHandler() {
            @Override
            public boolean handle(int code) {
                return false;
            }
        };

        Natives.addConsoleCtrlHandler(handler);

        if (Constants.WINDOWS) {
            assertNotNull(Kernel32Library.getInstance());
            assertThat(Kernel32Library.getInstance().getCallbacks().size(), equalTo(1));

        } else {
            assertNotNull(Kernel32Library.getInstance());
            assertThat(Kernel32Library.getInstance().getCallbacks().size(), equalTo(0));

            try {
                Kernel32Library.getInstance().addConsoleCtrlHandler(handler);
                fail("should have thrown an unsupported operation exception");
            } catch (UnsatisfiedLinkError e) {
                // UnsatisfiedLinkError is expected
            }
        }
    }
}


text:
using System.Drawing;

namespace GameColorWheelCreator
{
    public class ColorWheelItem
    {
        #region Constructor

        public ColorWheelItem(Color color, float occurency)
        {
            Color = color;
            OriginalOccurency = occurency;
            CustomOccurency = occurency;

            CreateColorImage(color);
        }

        #endregion

        #region Attributes and Properties

        public Color Color { get; private set; }
        public float OriginalOccurency { get; private set; }
        public float CustomOccurency { get; set; }

        public Bitmap GridImage { get; private set; }
        public string GridOriginalOccurency { get { return OriginalOccurency.ToString("0.##"); } }
        public string GridCustomOccurency { get { return CustomOccurency.ToString("0.##"); } }
        public string GridRGB { get { return Color.ToRGBValue(); } }
        public string GridHex { get { return Color.ToHexValue(); } }

        #endregion

        #region Private Methods

        private void CreateColorImage(Color color)
        {
            GridImage = new Bitmap(1 , 1);
            GridImage.SetPixel(0, 0, color);
        }

        #endregion
    }
}


text:
<?php

namespace Google\Service\OSConfig;

class OSPolicyResource extends \Google\Model
{
  protected $execType = OSPolicyResourceExecResource::class;
  protected $execDataType = '';
  protected $fileType = OSPolicyResourceFileResource::class;
  protected $fileDataType = '';
  /**
   * @var string
   */
  public $id;
  protected $pkgType = OSPolicyResourcePackageResource::class;
  protected $pkgDataType = '';
  protected $repositoryType = OSPolicyResourceRepositoryResource::class;
  protected $repositoryDataType = '';

  /**
   * @param OSPolicyResourceExecResource
   */
  public function setExec(OSPolicyResourceExecResource $exec)
  {
    $this->exec = $exec;
  }
  /**
   * @return OSPolicyResourceExecResource
   */
  public function getExec()
  {
    return $this->exec;
  }
  /**
   * @param OSPolicyResourceFileResource
   */
  public function setFile(OSPolicyResourceFileResource $file)
  {
    $this->file = $file;
  }
  /**
   * @return OSPolicyResourceFileResource
   */
  public function getFile()
  {
    return $this->file;
  }
  /**
   * @param string
   */
  public function setId($id)
  {
    $this->id = $id;
  }
  /**
   * @return string
   */
  public function getId()
  {
    return $this->id;
  }
  /**
   * @param OSPolicyResourcePackageResource
   */
  public function setPkg(OSPolicyResourcePackageResource $pkg)
  {
    $this->pkg = $pkg;
  }
  /**
   * @return OSPolicyResourcePackageResource
   */
  public function getPkg()
  {
    return $this->pkg;
  }
  /**
   * @param OSPolicyResourceRepositoryResource
   */
  public function setRepository(OSPolicyResourceRepositoryResource $repository)
  {
    $this->repository = $repository;
  }
  /**
   * @return OSPolicyResourceRepositoryResource
   */
  public function getRepository()
  {
    return $this->repository;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(OSPolicyResource::class, 'Google_Service_OSConfig_OSPolicyResource');


text:
<?xml version="1.0" encoding="UTF-8" ?>
<pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.2.64.36" id="LoginPageDef"
                Package="mybugdb.mobile.pageDefs">
  <parameters/>
  <executables>
    <variableIterator id="variables"/>
    <iterator Binds="root" RangeSize="25" DataControl="managerBean" id="managerBeanIterator"/>
  </executables>
  <bindings>
    <attributeValues IterBinding="managerBeanIterator" id="userName">
      <AttrNames>
        <Item Value="userName"/>
      </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="managerBeanIterator" id="passWord">
      <AttrNames>
        <Item Value="passWord"/>
      </AttrNames>
    </attributeValues>
    <methodAction id="getLoginUserName" RequiresUpdateModel="true" Action="invokeMethod" MethodName="getLoginUserName"
                  IsViewObjectMethod="false" DataControl="managerBean" InstanceName="data.managerBean.dataProvider"/>
    <methodAction id="executeLoginUserName" RequiresUpdateModel="true" Action="invokeMethod"
                  MethodName="executeLoginUserName" IsViewObjectMethod="false" DataControl="managerBean"
                  InstanceName="data.managerBean.dataProvider"/>
    <attributeValues IterBinding="managerBeanIterator" id="checkAccount">
      <AttrNames>
        <Item Value="checkAccount"/>
      </AttrNames>
    </attributeValues>
  </bindings>
</pageDefinition>


text:
{-# LANGUAGE TupleSections #-}

module BarthPar.Graph where

import           Control.Arrow       ((***))
import           Control.Lens
import qualified Data.HashMap.Strict as M
import qualified Data.List           as L
import           Data.Maybe
import           Data.Ord
import           Data.Traversable
import           Data.Tuple
import qualified Data.Vector         as V
import qualified Data.Vector.Unboxed as UV

import           BarthPar.Lens
import           BarthPar.Types
import           BarthPar.Utils

makeNodes :: InputByWord -> ([Node], TokenIndex)
makeNodes = (catMaybes *** snd) . swap . mapAccumL toNode (0, M.empty)
    where
        toNode (i, idx) rs@((_, n, _):_) =
            let topik  = view inputTopicId
                       $ L.maximumBy (comparing (view inputWeight)) rs
                index' = M.insert n i idx
            in  ((i + 1, index'), Just $ Node n topik i)
        toNode i [] = (i, Nothing)

makeLinks :: TokenIndex -> InputByWord -> [Link]
makeLinks tindex byWord = concatMap (uncurry (loop tvectors)) tvectors
    where
        toVector rs@((_, t, _):_) =   (,)
                                  <$> M.lookup t tindex
                                  <*> Just ( UV.fromList
                                           . map (view inputWeight)
                                           $ L.sortBy (comparing (view inputTopicId)) rs)
        toVector []               = Nothing

        tvectors = V.fromList $ mapMaybe toVector byWord

        loop matrix i ws = catMaybes . V.toList $ V.map (uncurry (link i ws)) matrix

        link i iws j jws | i == j    = Nothing
                         | otherwise = Just . Link i j $ euclid iws jws


text:
{-# LANGUAGE TemplateHaskell #-}
module Game.Monsters.MBrainGlobals where

import Control.Lens (makeLenses)

import Types

makeLenses ''MBrainGlobals

initialMBrainGlobals :: MBrainGlobals
initialMBrainGlobals =
  MBrainGlobals { _mBrainSoundChestOpen        = 0
                , _mBrainSoundTentaclesExtend  = 0
                , _mBrainSoundTentaclesRetract = 0
                , _mBrainSoundDeath            = 0
                , _mBrainSoundIdle1            = 0
                , _mBrainSoundIdle2            = 0
                , _mBrainSoundIdle3            = 0
                , _mBrainSoundPain1            = 0
                , _mBrainSoundPain2            = 0
                , _mBrainSoundSight            = 0
                , _mBrainSoundSearch           = 0
                , _mBrainSoundMelee1           = 0
                , _mBrainSoundMelee2           = 0
                , _mBrainSoundMelee3           = 0
                }


text:
#ifndef AudioTrackPrivateGStreamer_h
#define AudioTrackPrivateGStreamer_h

#if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK)

#include "AudioTrackPrivate.h"
#include "GRefPtrGStreamer.h"
#include "TrackPrivateBaseGStreamer.h"

namespace WebCore {

class AudioTrackPrivateGStreamer final : public AudioTrackPrivate, public TrackPrivateBaseGStreamer {
public:
    static RefPtr<AudioTrackPrivateGStreamer> create(GRefPtr<GstElement> playbin, gint index, GRefPtr<GstPad> pad)
    {
        return adoptRef(*new AudioTrackPrivateGStreamer(playbin, index, pad));
    }

    void disconnect() override;

    void setEnabled(bool) override;
    void setActive(bool enabled) override { setEnabled(enabled); }

    int trackIndex() const override { return m_index; }

    AtomicString id() const override { return m_id; }
    AtomicString label() const override { return m_label; }
    AtomicString language() const override { return m_language; }

private:
    AudioTrackPrivateGStreamer(GRefPtr<GstElement> playbin, gint index, GRefPtr<GstPad>);

    AtomicString m_id;
    GRefPtr<GstElement> m_playbin;
};

} // namespace WebCore

#endif // ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK)

#endif // AudioTrackPrivateGStreamer_h


text:
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title><?php echo $view_title?></title>
	<link rel=stylesheet href='./template/<?php echo $OJ_TEMPLATE?>/<?php echo isset($OJ_CSS)?$OJ_CSS:"hoj.css" ?>' type='text/css'>

	<?php require_once("oj-header.php");?>

	<?php echo $view_news?>

	<?php require_once("oj-footer.php");?>


text:
package com.shekhargulati.reactivex.docker.client.representations;

import com.google.gson.annotations.SerializedName;

import java.util.List;

public class DockerContainer {
    @SerializedName("Id")
    private String id;
    @SerializedName("Names")
    private List<String> names;
    @SerializedName("Image")
    private String image;
    @SerializedName("Command")
    private String command;
    @SerializedName("Created")
    private Long created;
    @SerializedName("Status")
    private String status;
    @SerializedName("SizeRw")
    private Long sizeRw;
    @SerializedName("SizeRootFs")
    private Long sizeRootFs;

    public String getId() {
        return id;
    }

    public List<String> getNames() {
        return names;
    }

    public String getImage() {
        return image;
    }

    public String getCommand() {
        return command;
    }

    public Long getCreated() {
        return created;
    }

    public String getStatus() {
        return status;
    }

    public Long getSizeRw() {
        return sizeRw;
    }

    public Long getSizeRootFs() {
        return sizeRootFs;
    }

    @Override
    public String toString() {
        return "DockerContainer{" +
                "id='" + id + '\'' +
                ", names=" + names +
                ", image='" + image + '\'' +
                ", command='" + command + '\'' +
                '}';
    }
}


text:
(function(){
    angular.module('d83.annotation', []);

})();


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>2. Topics, Domains and Partitions — The Data Distribution Service Tutorial</title>

    <link rel="stylesheet" href="_static/vortex.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="The Data Distribution Service Tutorial" href="index.html" />
    <link rel="next" title="3. Reading and Writing Data" href="readandwrite.html" />
    <link rel="prev" title="1. Foundations" href="foundations.html" />

Navigation

          index

          next |

          previous |

DDS Tutorial »

2. Topics, Domains and Partitions¶

The previous chapter introduced the basic concepts of DDS and walked
through the steps required to write a simple Pub/Sub application.

This chapter will look at DDS in more depth, starting with
data management.

2.1. Topics Inside Out¶

A Topic represents the unit for information that can produced or
consumed by a DDS application. Topics are defined by a name,
a type, and a set of QoS policies.

2.1.1. Topic Types¶

DDS is independent of the programming language as well as the
Operating System (OS), so it defines its type system
along with a space- and time-efficient binary encoding
for its types. Different syntaxes can be used to express DDS
topic types, such as IDL, XML.
Some vendors, such as ADLINK, also support
Google Protocol Buffers.

This Tutorial will focus on the subset of IDL that can be used to
define a topic type. A topic type is made with an IDL <tt class="docutils literal">struct</tt> plus a key.
The <tt class="docutils literal">struct</tt> can contain as many fields as required, and each field can be a
primitive type (see table Primitive Types), a template type (see table
IDL Template Types), or a constructed type (see table IDL Constructed types).

Primitive Types

<colgroup>
<col width="53%" />
<col width="47%" />
</colgroup>

Primitive Type
Size (bits)

boolean
8

octet
8

char
8

short
16

unsigned short
16

long
32

unsigned long
32

long long
64

unsigned long long
64

float
32

double
64

As shown in the table Primitive Types, primitive types are
essentially what you would expect, with just one exception:
the <tt class="docutils literal">int</tt> type is not there! This should not be a problem since the
IDL integral types <tt class="docutils literal">short</tt>, <tt class="docutils literal">long</tt> and <tt class="docutils literal">long long</tt> are equivalent
to the C99 <tt class="docutils literal">int16_t</tt>, <tt class="docutils literal">int32_t</tt> and <tt class="docutils literal">int64_t</tt>.
And what is more: in contrast to the <tt class="docutils literal">int</tt> type, which can have a different
footprint on different platforms, each of these types has specified exactly what
its footprint is.

IDL Template Types

<colgroup>
<col width="48%" />
<col width="52%" />
</colgroup>

Template Type
Example

string<length = UNBOUNDED$>

string s1;

string<32> s2;

sequence<T,length = UNBOUNDED>

sequence<octet> oseq;

sequence<octet, 1024> oseq1k;

sequence<MyType> mtseq;

sequence<MyType, $10>$ mtseq10;

In the table IDL Template Types, the <tt class="docutils literal">string</tt> can be
parameterized only with respect to their maximum length, while
the <tt class="docutils literal">sequence</tt> type can be parameterized with respect to both its
maximum length and its contained type.
The <tt class="docutils literal">sequence</tt> type abstracts a homogeneous random access container, pretty
much like the <tt class="docutils literal">std::vector</tt> in C++ or <tt class="docutils literal">java.util.Vector</tt> in Java.

Finally, it is important to point out that when the maximum length is
not provided the type is assumed to have an unbounded length, meaning
that the middleware will allocate as much memory as necessary to store
the values that the application provides.

The table IDL Constructed Types shows that DDS supports three different
kinds of IDL constructed types: <tt class="docutils literal">enum</tt>, <tt class="docutils literal">struct</tt>, and <tt class="docutils literal">union</tt>.

IDL Constructed Types

<colgroup>
<col width="33%" />
<col width="67%" />
</colgroup>

Constructed Type
Example

enum
enum Dimension {1D, 2D, 3D, 4D};

struct

struct Coord1D { long x;};

struct Coord2D { long x; long y; };

struct Coord3D { long x; long y; long z; };

struct Coord4D { long x; long y; long z,

unsigned long long t;};

union

union Coord switch (Dimension) {

case 1D: Coord1D c1d;

case 2D: Coord2D c2d;

case 3D: Coord3D c3d;

case 4D: Coord4D c4d;

};

It should be clear from this that a Topic type is a <tt class="docutils literal">struct</tt> that can
contain (as fields) nested structures, unions, enumerations,
and template types, as well as primitive types. In addition, it is possible to
define multi-dimensional arrays of any DDS-supported or user-defined type.

To tie things together, there are language-specific mappings from the
IDL types described above to mainstream programming languages such as
C++, Java, and C#.

2.1.2. Topic Keys, Instances and Samples¶

Each Topic comes with an associated key-set. This key-set might be empty
or it can include an arbitrary number of attributes defined by the Topic
Type. There are no limitations on the number, kind, or level of nesting,
of attributes used to establish the key. There are some limitations to
its kind though: a key should either be a primitive type (see table
Primitive Types), an enumeration or a string. A key cannot be constructed
type (although it may consist of one or more members of an embedded constructed
type), an array or a sequence of any type.

Keyed and Keyless Topics

  enum TemperatureScale {
    CELSIUS,
    FAHRENHEIT,
    KELVIN
  };

  struct TempSensorType {
    short id;
    float temp;
    float hum;
    TemperatureScale scale;
  };
#pragma keylist TempSensorType id

  struct KeylessTempSensorType {
    short id;
    float temp;
    float hum;
    TemperatureScale scale;
  };
#pragma keylist KeylessTempSensorType

Returning to the example application (the temperature control and
monitoring system), it is possible to define a keyless variant of the
<tt class="docutils literal">TempSensorType</tt> defined in the
Foundations chapter.

Keyed and Keyless Topics shows the <tt class="docutils literal">TempSensorType</tt> with the
<tt class="docutils literal">id</tt> attribute defined as its key, along with the <tt class="docutils literal">KeylessTempSensorType</tt>
showing off an empty key-set as defined in its <tt class="docutils literal">#pragma keylist</tt> directive.

If two topics associated with the types declared in
Keyed and Keyless Topics are created, what are the
differences between them?

  dds::topic::Topic<tutorial::TempSensorType> topic(dp, "TTempSensor");
  dds::topic::Topic<tutorial::KeylessTempSensorType> kltsTopic(dp,
                                                               "KLTempSensorTopic");

The main difference between these two topics is their number of
instances:

Keyless topics have only one instance, and thus can
be thought of as singletons.

Keyed topics have one instance per key-value.

Making a parallel with classes in object-oriented programming languages,
a Topic can be regarded as defining a class whose instances are created for
each unique value of the topic keys. Thus, if the topic has no keys you
get a singleton.

Topic instances are runtime entities for which DDS keeps track of
whether

there are any live writers,

the instance has appeared in the system for the first time, and

the instance has been disposed (explicitly removed from the system).

Topic instances impact the organization of data on the reader side as
well as the memory usage. Furthermore, as will be seen later in this
Tutorial, there are some QoSs that apply at the instance level.

We will now illustrate what happens when you write a keyless topic versus
a keyed topic.

If we write a sample for the keyless <tt class="docutils literal">KLSensorTopic</tt> this is
going to modify the value for exactly the same instance, the singleton,
regardless of the content of the sample.

On the other hand, each sample written for the keyed <tt class="docutils literal">TempSensorTopic</tt> will
modify the value of a specific topic instance, depending on the value of the
key attributes (<tt class="docutils literal">id</tt> in the example).

Data Reader queue for a keyless Topic

Thus, the code below is writing two samples for the same instance, as
shown in Data Reader queue for a keyless Topic.
These two samples will be posted in the same reader queue: the queue
associated with the singleton instance, as shown in
Data Reader queue for a keyless Topic.

  dds::pub::DataWriter<tutorial::KeylessTempSensorType> kldw(pub, kltsTopic);
  tutorial::KeylessTempSensorType klts(1, 26.0F, 70.0F, tutorial::CELSIUS);
  kldw.write(klts);
  kldw << tutorial::KeylessTempSensorType(2, 26.0F, 70.0F, tutorial::CELSIUS);

If we write the same samples for the <tt class="docutils literal">TempSensorTopic</tt>, the end-result
is quite different. The two samples written in the code fragment below
have two different <tt class="docutils literal">id</tt> values, respectively <tt class="docutils literal">1</tt> and <tt class="docutils literal">2</tt>;
they are referring to two different instances.

  dds::pub::DataWriter<tutorial::TempSensorType> dw(pub, topic);
  tutorial::TempSensorType ts(1, 26.0F, 70.0F, tutorial::CELSIUS);
  dw.write(ts);
  dw << tutorial::TempSensorType(2, 26.0F, 70.0F, tutorial::CELSIUS);

These two samples are posted into two different
queues, as represented in Data Reader queues for keyed Topics,
one queue for each instance.

Data Reader queues for keyed Topics

In summary, Topics should be thought of as classes in an object-oriented
language, and each unique key-value identifies an instance.
The life-cycle of topic instances is managed by DDS and to
each topic instance are allocated memory resources; think of it
as a queue on the reader side. Keys identify specific data streams
within a Topic. Thus, in our example, each <tt class="docutils literal">id</tt> value will
identify a specific temperature sensor. Differently from many other Pub/Sub
technologies, DDS allows keys to be used to automatically de-multiplex different
streams of data. Furthermore, since each temperature sensor represents
an instance of the <tt class="docutils literal">TempSensorTopic</tt> it is possible to
track the lifecycle of the sensor by tracking the lifecycle of its
associated instance. It is possible to detect when a new sensor is added into the
system, because it introduces a new instance; it is possible to detect
when a sensor has failed, because DDS can report
when there are no more writers for a specific instance.
It is even possible to detect when a sensor has crashed and then recovered
thanks to information about state transitions that is provided by DDS.

Finally, before moving on from DDS instances, it is emphasized that
DDS subscriptions concern Topics. Thus a subscriber receives
all of the instances produced for that topic. In some cases
this is not desirable and some scoping actions are necessary.
Scoping is discussed in the next section.

2.2. Scoping Information¶

2.2.1. Domain¶

DDS provides two mechanism for scoping information, domains and
partitions.

A domain establishes a virtual network linking all of the
DDS applications that have joined it. No communication can ever happen
across domains unless explicitly mediated by the user application.

2.2.2. Partition¶

Domains can be further organized into partitions, where each partition can
represent a logical grouping of topics.

DDS Partitions are described by names such as <tt class="docutils literal">SensorDataPartition</tt>,
<tt class="docutils literal">CommandPartition</tt>, <tt class="docutils literal">LogDataPartition</tt>, etc., and a partition has
to be explicitly joined in order to publish data in it or subscribe to
the topics it contains.

Domains and partitions in DDS

The mechanism provided by DDS for joining a partition is very flexible as
a publisher or a subscriber can join by providing its full name, such as
<tt class="docutils literal">SensorDataPartition</tt>, or it can join all the partitions that match a
regular expression, such as <tt class="docutils literal">Sens*</tt> or <tt class="docutils literal">*Data*</tt>. Supported regular
expressions are the same as those accepted by the POSIX <tt class="docutils literal">fnmatch</tt>
function (see POSIX fmatch).

To recap: partitions provide a way of scoping information.
This scoping mechanism can be used to organize topics into different
coherent sets.

Partitions can also be used to segregate topic instances. Instance
segregation can be necessary for optimizing performance or minimizing
footprint for those applications that are characterized by a very large
number of instances, such as large telemetry systems, or financial
trading applications. Referring to the example temperature
monitoring and control system, a scheme can be devised with a very natural
partitioning of data that mimics the physical placement of the various
temperature sensors. To do this, we can use partition names
made of the building number, the floor level and the room number
in which the sensor is installed:

<tt class="docutils literal">building-<number>:floor-<level>:room-<number></tt>

Using this naming scheme, as shown in Domains and partitions in DDS,
all of the topics produced in room 51 on the 15th floor of building 1
would belong to the partition <tt class="docutils literal">building-1:floor-15:room-51</tt>. Likewise, the
partition expression <tt class="docutils literal">building-1:floor-1:room-*</tt> matches all of the
partitions for all of the rooms at the first floor in building 1.

In a nutshell, partitions can be used to scope information, and
naming conventions (such as those used for the example temperature control
applications) can be used to emulate hierarchical organization of data
starting from flat partitions. Using the same technique it is possible to
slice and access data across different dimensions or views, depending on the
needs of the application.

2.3. Content Filtering¶

Domains and Partitions are useful mechanisms for the structural
organization of data, but what if it is neccessary to control the data
received based on its content? Content Filtering enables the creation of
topics that constrain the values that their instances might take.

When subscribing to a content-filtered topic an application will
receive, amongst all published values, only those that match the
topic filter. The filter expression can operate on the full topic
content, as opposed to being able to operate only on headers as it
happens in many other Pub/Sub technologies, such as JMS.
The filter expression is structurally similar to a SQL
<tt class="docutils literal">WHERE</tt> clause.

The table lists the operators supported by DDS.

Legal operators for DDS Filters and Query Conditions

<colgroup>
<col width="41%" />
<col width="59%" />
</colgroup>

Constructed Type
Example

=
equal

<>
not equal

>
greater than

<
less than

>=
greater than or equal

<=
less than or equal

BETWEEN
between and inclusive range

LIKE
matches a string pattern

Content-Filtered topics are very useful from several different
perspectives. First of all, they limit the amount of memory used by DDS to
the instances and samples that match the filter. Furthermore, filtering
can be used to simplify your application by delegating to DDS the logic
that checks certain data properties. For instance, if we consider the
temperature control application we might be interested in being notified
only then the temperature or the humidity are outside a given range.
Thus, assuming that we wanted to maintain the temperature between
20.5 and 21.5 degrees and the humidity between 30% and 50%, we could create
a Content-Filtered topic that would alert the application when the
sensor is producing values outside the desired ranges. This can be
done by using the filter expression below:

((temp NOT BETWEEN 20.5 AND 21.5)
     OR
(hum NOT BETWEEN 30 AND 50))

The listing Content Filtered Topic shows the code that creates
a content-filtered topic for the <tt class="docutils literal">TempSensor</tt> topic with the expression
above. Notice that the content-filtered topic is created starting from a
regular topic. Furthermore it is worth noticing that the filter
expression is relying on positional arguments <tt class="docutils literal">%0</tt>, <tt class="docutils literal">%2</tt>,
etc., whose actual values are passed via a vector of strings.

Content Filtered Topic

  // Create the TTempSensor topic
  dds::topic::Topic<tutorial::TempSensorType> topic(dp, "TTempSensor");

  // Define the filter expression
  std::string expression =
    "(temp NOT BETWEEN %0 AND %1) \
    OR \
    (hum NOT BETWEEN %2 and %3)";

  // Define the filter parameters
  std::vector<std::string> params =
    {"20.5", "21.5", "30", "50"};

  // Create the filter for the content-filtered-topic
  dds::topic::Filter filter(expression, params);

  // Create the ContentFilteredTopic
  dds::topic::ContentFilteredTopic<tutorial::TempSensorType> cfTopic(topic,
								     "CFTTempSensor",
								     filter);

  dds::sub::Subscriber sub(dp);
  //This data reader will only receive data that matches the content filter
  dds::sub::DataReader<tutorial::TempSensorType> dr(sub, cfTopic);

2.4. Summary¶

This chapter has covered the most important aspects of data
management in DDS: topics-types and topic instances, and the
various mechanisms provided by DDS for scoping information.

Information can be structurally organized by means of domains and
partitions, and special views can be created using content-filtered
topics and query conditions.

It is recommended again that the reader compiles and runs the examples
and experiments with the programs developed so far.

Table Of Contents

2. Topics, Domains and Partitions

2.1. Topics Inside Out

2.1.1. Topic Types

2.1.2. Topic Keys, Instances and Samples

2.2. Scoping Information

2.2.1. Domain

2.2.2. Partition

2.3. Content Filtering

2.4. Summary

Previous topic

1. Foundations

Next topic

3. Reading and Writing Data

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          next |

          previous |

DDS Tutorial »

        © Copyright 2017, ADLINK Technology Limited.


text:
using Logic.JudgementTypes.ModalityType.BehaviourContracts;

namespace Logic.JudgementTypes.ModalityType
{
    class EmptyType : IModalityType
    {
        public int GetIdent()
        {
            return 0;
        }
    }
}


text:
Acceso Usuarios

Subtitulo o Slogan

Login:

		<form action="">
			Usuario
			<input type="text">

			Contraseña
			<input type="password" name="" id="">

			Ingresar como:

			<select name="" id="">
				<option value="fabricante">Fabricante</option>
				<option value="ortopedista">Ortopedista</option>
			</select>
			<input type="submit" name="LOGIN" id="LOGIN">
		</form>

Registrarse:

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit animi minima ad, saepe possimus numquam. Sunt odio, ratione dolor. Vitae ea omnis modi, fugiat, ducimus a illum minus culpa sed!

		<a href="<?php echo base_url(); ?>index.php/startApp/routedHome/register">Registrar