text:
package org.apache.camel.component.file.remote;

import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

/**
 * @version $Revision$
 */
public class UriConfigurationTest extends CamelTestSupport {

    @Test
    public void testFtpConfigurationDefaults() {
        Endpoint endpoint = context.getEndpoint("ftp://hostname");
        assertIsInstanceOf(FtpEndpoint.class, endpoint);
        FtpEndpoint ftpEndpoint = (FtpEndpoint) endpoint;
        RemoteFileConfiguration config = ftpEndpoint.getConfiguration();

        assertEquals("ftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(21, config.getPort());
        assertNull(config.getUsername());
        assertNull(config.getPassword());
        assertEquals(false, config.isBinary());
        assertEquals(RemoteFileConfiguration.PathSeparator.Auto, config.getSeparator());
    }

    @Test
    public void testSftpConfigurationDefaults() {
        Endpoint endpoint = context.getEndpoint("sftp://hostname");
        assertIsInstanceOf(SftpEndpoint.class, endpoint);
        SftpEndpoint sftpEndpoint = (SftpEndpoint) endpoint;
        RemoteFileConfiguration config = sftpEndpoint.getConfiguration();

        assertEquals("sftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(22, config.getPort());
        assertNull(config.getUsername());
        assertNull(config.getPassword());
        assertEquals(false, config.isBinary());
        assertEquals(RemoteFileConfiguration.PathSeparator.Auto, config.getSeparator());
    }

    @Test
    public void testFtpsConfigurationDefaults() {
        Endpoint endpoint = context.getEndpoint("ftps://hostname");
        assertIsInstanceOf(FtpsEndpoint.class, endpoint);
        FtpsEndpoint ftpsEndpoint = (FtpsEndpoint) endpoint;
        FtpsConfiguration config = (FtpsConfiguration) ftpsEndpoint.getConfiguration();

        assertEquals("ftps", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(21, config.getPort());
        assertNull(config.getUsername());
        assertNull(config.getPassword());
        assertEquals(false, config.isBinary());
        assertEquals(false, config.isImplicit());
        assertEquals("TLS", config.getSecurityProtocol());
        assertEquals(RemoteFileConfiguration.PathSeparator.Auto, config.getSeparator());
    }

    @Test
    public void testFtpsExplicitConfigurationDefaults() {
        Endpoint endpoint = context.getEndpoint("ftps://hostname:990?isImplicit=true");
        assertIsInstanceOf(FtpsEndpoint.class, endpoint);
        FtpsEndpoint ftpsEndpoint = (FtpsEndpoint) endpoint;
        FtpsConfiguration config = (FtpsConfiguration) ftpsEndpoint.getConfiguration();

        assertEquals("ftps", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(990, config.getPort());
        assertNull(config.getUsername());
        assertNull(config.getPassword());
        assertEquals(false, config.isBinary());
        assertEquals(true, config.isImplicit());
        assertEquals("TLS", config.getSecurityProtocol());
    }

    @Test
    public void testFtpExplicitConfiguration() {
        Endpoint endpoint = context.getEndpoint("ftp://user@hostname:1021/some/file?password=secret&binary=true");
        assertIsInstanceOf(FtpEndpoint.class, endpoint);
        FtpEndpoint ftpEndpoint = (FtpEndpoint) endpoint;
        RemoteFileConfiguration config = ftpEndpoint.getConfiguration();

        assertEquals("ftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(1021, config.getPort());
        assertEquals("user", config.getUsername());
        assertEquals("secret", config.getPassword());
        assertEquals(true, config.isBinary());
    }

    @Test
    public void testSftpExplicitConfiguration() {
        Endpoint endpoint = context.getEndpoint("sftp://user@hostname:1021/some/file?password=secret&binary=true");
        assertIsInstanceOf(SftpEndpoint.class, endpoint);
        SftpEndpoint sftpEndpoint = (SftpEndpoint) endpoint;
        RemoteFileConfiguration config = sftpEndpoint.getConfiguration();

        assertEquals("sftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(1021, config.getPort());
        assertEquals("user", config.getUsername());
        assertEquals("secret", config.getPassword());
        assertEquals(true, config.isBinary());
    }

    @Test
    public void testFtpsExplicitConfiguration() {
        Endpoint endpoint = context.getEndpoint("ftps://user@hostname:1021/some/file?password=secret&binary=true&securityProtocol=SSL&isImplicit=true");
        assertIsInstanceOf(FtpsEndpoint.class, endpoint);
        FtpsEndpoint sftpEndpoint = (FtpsEndpoint) endpoint;
        FtpsConfiguration config = (FtpsConfiguration) sftpEndpoint.getConfiguration();

        assertEquals("ftps", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(1021, config.getPort());
        assertEquals("user", config.getUsername());
        assertEquals("secret", config.getPassword());
        assertEquals(true, config.isBinary());
        assertEquals(true, config.isImplicit());
        assertEquals("SSL", config.getSecurityProtocol());
    }

    @Test
    public void testRemoteFileEndpointFiles() {
        assertRemoteFileEndpointFile("ftp://hostname/foo/bar", "foo/bar");
        assertRemoteFileEndpointFile("ftp://hostname/foo/bar/", "foo/bar/");
        assertRemoteFileEndpointFile("ftp://hostname/foo/", "foo/");
        assertRemoteFileEndpointFile("ftp://hostname/foo", "foo");
        assertRemoteFileEndpointFile("ftp://hostname/", "");
        assertRemoteFileEndpointFile("ftp://hostname", "");
        assertRemoteFileEndpointFile("ftp://hostname//", "/");
        assertRemoteFileEndpointFile("ftp://hostname//foo/bar", "/foo/bar");
        assertRemoteFileEndpointFile("ftp://hostname//foo/bar/", "/foo/bar/");
        assertRemoteFileEndpointFile("sftp://user@hostname:123//foo/bar?password=secret", "/foo/bar");
        assertRemoteFileEndpointFile("sftp://user@hostname:123?password=secret", "");
        assertRemoteFileEndpointFile("sftp://hostname/foo/bar", "foo/bar");
        assertRemoteFileEndpointFile("sftp://hostname/foo/bar/", "foo/bar/");
        assertRemoteFileEndpointFile("sftp://hostname/foo/", "foo/");
        assertRemoteFileEndpointFile("sftp://hostname/foo", "foo");
        assertRemoteFileEndpointFile("sftp://hostname/", "");
        assertRemoteFileEndpointFile("sftp://hostname", "");
        assertRemoteFileEndpointFile("sftp://hostname//", "/");
        assertRemoteFileEndpointFile("sftp://hostname//foo/bar", "/foo/bar");
        assertRemoteFileEndpointFile("sftp://hostname//foo/bar/", "/foo/bar/");
        assertRemoteFileEndpointFile("ftps://user@hostname:123//foo/bar?password=secret", "/foo/bar");
        assertRemoteFileEndpointFile("ftps://user@hostname:123?password=secret", "");
        assertRemoteFileEndpointFile("ftps://hostname/foo/bar", "foo/bar");
        assertRemoteFileEndpointFile("ftps://hostname/foo/bar/", "foo/bar/");
        assertRemoteFileEndpointFile("ftps://hostname/foo/", "foo/");
        assertRemoteFileEndpointFile("ftps://hostname/foo", "foo");
        assertRemoteFileEndpointFile("ftps://hostname/", "");
        assertRemoteFileEndpointFile("ftps://hostname", "");
        assertRemoteFileEndpointFile("ftps://hostname//", "/");
        assertRemoteFileEndpointFile("ftps://hostname//foo/bar", "/foo/bar");
        assertRemoteFileEndpointFile("ftps://hostname//foo/bar/", "/foo/bar/");
    }

    private void assertRemoteFileEndpointFile(String endpointUri, String expectedFile) {
        RemoteFileEndpoint endpoint = resolveMandatoryEndpoint(context, endpointUri, RemoteFileEndpoint.class);
        assertNotNull("Could not find endpoint: " + endpointUri, endpoint);

        String file = endpoint.getConfiguration().getDirectory();
        assertEquals("For uri: " + endpointUri + " the file is not equal", expectedFile, file);
    }

    @Test
    public void testSftpKnownHostsFileConfiguration() {
        Endpoint endpoint = context.getEndpoint("sftp://user@hostname:1021/some/file?password=secret&binary=true&knownHostsFile=/home/janstey/.ssh/known_hosts");
        assertIsInstanceOf(SftpEndpoint.class, endpoint);
        SftpEndpoint sftpEndpoint = (SftpEndpoint) endpoint;
        SftpConfiguration config = (SftpConfiguration) sftpEndpoint.getConfiguration();

        assertEquals("sftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(1021, config.getPort());
        assertEquals("user", config.getUsername());
        assertEquals("secret", config.getPassword());
        assertEquals(true, config.isBinary());
        assertEquals("/home/janstey/.ssh/known_hosts", config.getKnownHostsFile());
    }

    @Test
    public void testPasswordInContextPathConfiguration() {
        Endpoint endpoint = context.getEndpoint("ftp://user:secret@hostname:1021/some/file");
        assertIsInstanceOf(FtpEndpoint.class, endpoint);
        FtpEndpoint ftpEndpoint = (FtpEndpoint) endpoint;
        RemoteFileConfiguration config = ftpEndpoint.getConfiguration();

        assertEquals("ftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals(1021, config.getPort());
        assertEquals("user", config.getUsername());
        assertEquals("secret", config.getPassword());
    }

    @Test
    public void testStartingDirectoryWithDot() throws Exception {
        Endpoint endpoint = context.getEndpoint("ftp://user@hostname?password=secret");
        FtpEndpoint ftpEndpoint = assertIsInstanceOf(FtpEndpoint.class, endpoint);
        FtpConfiguration config = ftpEndpoint.getConfiguration();
        config.setHost("somewhere");
        config.setDirectory("temp.dir");
        ftpEndpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // do nothing
            }
        });
    }

    @Test
    public void testPathSeparatorAuto() {
        Endpoint endpoint = context.getEndpoint("ftp://hostname/foo/bar?separator=Auto");
        assertIsInstanceOf(FtpEndpoint.class, endpoint);
        FtpEndpoint ftpEndpoint = (FtpEndpoint) endpoint;
        RemoteFileConfiguration config = ftpEndpoint.getConfiguration();

        assertEquals("ftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals("foo/bar", config.getDirectory());
        assertEquals(RemoteFileConfiguration.PathSeparator.Auto, config.getSeparator());

        assertEquals("foo/bar/hello.txt", config.normalizePath("foo/bar/hello.txt"));
        assertEquals("foo\\bar\\hello.txt", config.normalizePath("foo\\bar\\hello.txt"));
    }

    @Test
    public void testPathSeparatorUnix() {
        Endpoint endpoint = context.getEndpoint("ftp://hostname/foo/bar?separator=UNIX");
        assertIsInstanceOf(FtpEndpoint.class, endpoint);
        FtpEndpoint ftpEndpoint = (FtpEndpoint) endpoint;
        RemoteFileConfiguration config = ftpEndpoint.getConfiguration();

        assertEquals("ftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals("foo/bar", config.getDirectory());
        assertEquals(RemoteFileConfiguration.PathSeparator.UNIX, config.getSeparator());

        assertEquals("foo/bar/hello.txt", config.normalizePath("foo/bar/hello.txt"));
        assertEquals("foo/bar/hello.txt", config.normalizePath("foo\\bar\\hello.txt"));
    }

    @Test
    public void testPathSeparatorWindows() {
        Endpoint endpoint = context.getEndpoint("ftp://hostname/foo/bar?separator=Windows");
        assertIsInstanceOf(FtpEndpoint.class, endpoint);
        FtpEndpoint ftpEndpoint = (FtpEndpoint) endpoint;
        RemoteFileConfiguration config = ftpEndpoint.getConfiguration();

        assertEquals("ftp", config.getProtocol());
        assertEquals("hostname", config.getHost());
        assertEquals("foo/bar", config.getDirectory());
        assertEquals(RemoteFileConfiguration.PathSeparator.Windows, config.getSeparator());

        assertEquals("foo\\bar\\hello.txt", config.normalizePath("foo/bar/hello.txt"));
        assertEquals("foo\\bar\\hello.txt", config.normalizePath("foo\\bar\\hello.txt"));
    }

}


text:
/*
 * (c)2017, Cris Luengo.
 * Based on original DIPlib code: (c)1995-2014, Delft University of Technology.
 *
 * 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.
 */

/*
 * Interface:
 *
 * out = dip_tensor_indices(image)
 *    out is a look-up table for image's tensor. For a tensor with M rows, element at (i,j) is out(i+j*M).
 *
 * out = dip_tensor_indices(images,[i,j])
 *    out is the linear index into the tensor for element (i,j) (i.e. the value of element i+j*M in the look-up table
 *    that would be generated in the call of the first form.
 *
 * Note that all indices here start with 0, whereas in MATLAB they'd start with 1. Adjust as necessary!
 */

#include "dip_matlab_interface.h"

void mexFunction( int /*nlhs*/, mxArray* plhs[], int nrhs, mxArray const* prhs[] ) {
   try {
      DML_MIN_ARGS( 1 );
      DML_MAX_ARGS( 2 );

      // Get tensor information from dip_image object
      DIP_THROW_IF( !mxIsClass( prhs[ 0 ], dml::imageClassName ), "First input argument must be a dip_image object" );
      dip::UnsignedArray tsize = dml::GetUnsignedArray( mxGetPropertyShared( prhs[ 0 ], 0, dml::tsizePropertyName ));
      DIP_THROW_IF( tsize.size() != 2, "Error in tensor size property" );
      dip::Tensor::Shape tshape = dml::detail::GetTensorShape( mxGetPropertyShared( prhs[ 0 ], 0, dml::tshapePropertyName ));
      dip::Tensor tensor( tshape, tsize[ 0 ], tsize[ 1 ] );

      if( nrhs == 2 ) {

         // Get indices
         dip::UnsignedArray indices = dml::GetUnsignedArray( prhs[ 1 ] );
         DIP_START_STACK_TRACE
            dip::uint out = tensor.Index( indices );
            plhs[ 0 ] = dml::GetArray( out );
         DIP_END_STACK_TRACE

      } else {

         // Get the look up table
         std::vector< dip::sint > lut = tensor.LookUpTable();
         plhs[ 0 ] = mxCreateDoubleMatrix( 1, lut.size(), mxREAL );
         double* data = mxGetPr( plhs[ 0 ] );
         for( dip::uint ii = 0; ii < lut.size(); ++ii ) {
            data[ ii ] = static_cast< double >( lut[ ii ] );
         }

      }

   } DML_CATCH
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var config = require('./config.json'),
        request = require('request').defaults({jar: true}),
        url = require('url'),
        fs = require('fs'),
        _ = require('underscore');

var data, thingRecords;
try {
    data = require('./data.json');
    thingRecords = data.thingRecords;
} catch (e) {
    thingRecords = {};
}

function saveData() {
    fs.writeFileSync('data.json', JSON.stringify({
        thingRecords: thingRecords
    }));
}

function mSecs() {
    return (new Date()).getTime();
}

var lastRequest = 0, queue = [], metaThingsSeen = [], badThings = [];

function queueNext() {
    var popped;

    if (popped = queue.pop()) {
        waitRequest(processLink.apply(undefined, popped));
    } else {
        waitRequest(moreLinks);
    }
}

function waitRequest(callback, time) {
    var now = mSecs();

    if (!time) {
        if (now - lastRequest < 3000) {
            time = (3000 - (now - lastRequest));
        } else {
            lastRequest = now;
            callback();
            return;
        }
    }

    console.log('Delay ' + time + 'ms');
    setTimeout(function () {
        lastRequest = mSecs();
        callback();
    }, time);
}

var currentLinkSource = 0, linkSources = [
    'http://www.reddit.com/domain/reddit.com/new/.json',
    'http://www.reddit.com/domain/np.reddit.com/new/.json',
    'http://www.reddit.com/domain/www.reddit.com/new/.json'
];

function nextLinkSource() {
    currentLinkSource = (currentLinkSource + 1) % linkSources.length;
    console.log('Link source: ' + linkSources[currentLinkSource]);
    return linkSources[currentLinkSource];
}

var robots = {
    "comments-only": {},
    "posts-only": {},
    "disallowed": {},
    "permission": {}
};

function getRobots() {
    waitRequest(function () {
        request({
            uri: 'http://www.reddit.com/r/Bottiquette/wiki/robots_txt_json.json',
            method: 'GET',
            headers: {
                'User-Agent': config.userAgent
            }
        }, function (error, response, body) {
            if (!error && response.statusCode == 200) {
                console.log('All good for get robots');
                var data = JSON.parse(body);
                data = JSON.parse(data.data.content_md);
                for (var key in data) {
                     if (data.hasOwnProperty(key)) {
                            robots[key] = {};
                            data[key].forEach(function (subreddit) {
                                robots[key][subreddit.toLowerCase()] = null;
                            });
                     }
                }
                console.dir(robots);
                console.log('Loaded robots');
            } else {
                console.log('Things bad for robots, panic!');
            }
            console.log('Will re-fetch robots in ~1hr');
            waitRequest(getRobots, 60 * 60 * 1000);
        });
    });
}

getRobots();

function doLogin() {
    waitRequest(function () {
        request({
            uri: 'http://www.reddit.com/api/login',
            method: 'POST',
            headers: {
                'User-Agent': config.userAgent
            },
            form: {
                user: config.username,
                passwd: config.password,
                rem: 'False'
            }
        }, function (error, response) {
            if (!error && response.statusCode == 200) {
                console.log('All good for login');
                waitRequest(moreLinks);
            } else {
                console.log('Things bad for login');
            }
        });
    });
}
doLogin();

function moreLinks() {
    request({
        uri: nextLinkSource(),
        method: 'GET',
        headers: {
            'User-Agent': config.userAgent
        }
    }, function (error, response, body) {
        if (!error && response.statusCode == 200) {
            console.log('All good for get new meta-links');
            process(JSON.parse(body));
        } else {
            if (response && response.statusCode >= 500 && response.statusCode < 600) {
                console.log('Get new meta-links was ' + response.statusCode + ', retrying');
                waitRequest(moreLinks);
            } else if (response) {
                console.log('Things bad for get new meta-links');
                console.log(response.statusCode + ', ' + error);
            } else {
                console.log('Things bad for get new meta-links');
                console.log(error);
            }
        }
    });
}

function getDataForURL(input) {
    var parsed, matched;

    parsed = url.parse(input);
    matched = parsed.pathname.match(/^\/r\/[a-zA-Z0-9]+\/comments\/([a-z0-9]+)\/?([a-z0-9_]+)?\/?([a-z0-9]+)?\/?$/);

    if (matched && matched[3]) {
        return {
            thingID: 't1_' + matched[3],
            thingURL: parsed.pathname
        };
    } else if (matched) {
        return {
            thingID: 't3_' + matched[1],
            thingURL: parsed.pathname
        };
    } else {
        return null;
    }
}

function totesReplied(page, thingID) {
    if (typeof page !== "object") {
        return false;
    }
    if (page instanceof Array) {
        for (var i = 0; i < page.length; i++) {
            if (totesReplied(page[i], thingID)) {
                return true;
            }
        }
    } else {
        if (page.kind === 'Listing') {
            return totesReplied(page.data.children, thingID);
        } else if (page.kind === thingID.substr(0, 2)) {
            if (page.data.parent_id === thingID && page.data.author === 'totes_meta_bot') {
                console.log('Found you, totes!');
                return true;
            }
            return totesReplied(page.data.replies, thingID);
        }
    }
    return false;
}

function processLink(queue, metaThingTitle, metaThingSubreddit, metaThingURL, metaThingID, thingURL, thingID) {
    return (function () {
        var thingSubreddit = thingURL.split('/')[2].toLowerCase();
        if (robots['posts-only'].hasOwnProperty(thingSubreddit)
            || robots['permission'].hasOwnProperty(thingSubreddit)
            || robots['disallowed'].hasOwnProperty(thingSubreddit)
        ) {
            console.log('Skipping ' + thingID + ', robots disallows posts to /r/' + thingSubreddit);
            queueNext();
            return;
        }
        request({
            uri: 'http://www.reddit.com' + thingURL + '.json',
            method: 'GET',
            headers: {
                'User-Agent': config.userAgent
            }
        }, function (error, response, body) {
            var popped, page, record, comment, edit = false, options, numSubreddits;

            if (!error && response.statusCode == 200) {
                console.log('All good for fetching ' + thingID);

                page = JSON.parse(body);

                if (thingRecords.hasOwnProperty(thingID)) {
                    if (!thingRecords[thingID].hasOwnProperty('commentID')) {
                        console.log('ERROR! ' + thingID + ' lacks commentID! - ' + thingURL);
                        return;
                    }
                    record = {
                        thingID: thingRecords[thingID].thingID,
                        thingURL: thingRecords[thingID].thingURL,
                        metaThings: thingRecords[thingID].metaThings.slice(0),
                        commentID: thingRecords[thingID].commentID
                    };
                    record.metaThings.push({
                        thingID: metaThingID,
                        thingURL: metaThingURL,
                        subreddit: metaThingSubreddit,
                        title: metaThingTitle
                    });
                    edit = true;
                } else {
                    /* spider page to see if totes_meta_bot replied */
                    console.log('Checking to make sure totes_meta_bot did not already comment');
                    if (totesReplied(page, thingID)) {
                        console.log('Totes already commented on ' + thingID + ', marking BAD and moving on');
                        badThings.push(thingID);
                        saveData();
                        queueNext();
                        return;
                    } else {
                        console.log('They did not.');
                    }

                    record = {
                        thingID: thingID,
                        thingURL: thingURL,
                        metaThings: [
                            {
                                thingID: metaThingID,
                                thingURL: metaThingURL,
                                subreddit: metaThingSubreddit,
                                title: metaThingTitle
                            }
                        ]
                    };
                    edit = false;
                }

                numSubreddits = _.uniq(_.pluck(record.metaThings, 'subreddit')).length;
                if (numSubreddits === 1) {
                    comment = 'Someone submitted a link to this ' + (thingID[1] === '1' ? 'comment' : 'submission') + ' in the following subreddit:\n\n';
                } else {
                    comment = 'Links to this ' + (thingID[1] === '1' ? 'comment' : 'submission') + ' have been submitted to ' + numSubreddits + ' subreddits:\n\n';
                }

                record.metaThings.forEach(function (metaThing) {
                    // create np.reddit.com version
                    var url = 'https://np.reddit.com' + metaThing.thingURL;
                    comment += '* /r/' + metaThing.subreddit + ': [' + metaThing.title + '](' + url + ')\n';
                });
                comment += '\n----\n' + config.description;

                if (edit) {
                    options = {
                        uri: 'http://www.reddit.com/api/editusertext?api_type=json',
                        method: 'POST',
                        headers: {
                            'User-Agent': config.userAgent,
                            'X-Modhash': page[0].data.modhash
                        },
                        form: {
                            text: comment,
                            thing_id: record.commentID,
                        }
                    };
                } else {
                    options = {
                        uri: 'http://www.reddit.com/api/comment?api_type=json',
                        method: 'POST',
                        headers: {
                            'User-Agent': config.userAgent,
                            'X-Modhash': page[0].data.modhash
                        },
                        form: {
                            text: comment,
                            thing_id: thingID,
                        }
                    };
                }

                waitRequest(function () {
                    request(options, function (error, response, body) {
                        if (!error && response.statusCode === 200) {
                            body = JSON.parse(body);
                            if (!body.json.errors.length) {
                                if (!edit) {
                                    record.commentID = body.json.data.things[0].data.id;
                                    if (!record.commentID) {
                                        console.log('Invalid comment ID gotten: ' + record.commentID);
                                        console.dir(body.json.data.things[0].data);
                                        return;
                                    }
                                    console.log('Commented on ' + thingID);
                                } else {
                                    console.log('Updated comment on ' + thingID);
                                }
                                thingRecords[thingID] = record;
                                saveData();

                                queueNext();
                            } else {
                                if (body.json.errors[0][0] === "RATELIMIT") {
                                    console.log(thingID + ' (meta: ' + metaThingSubreddit + ') rate limited (' + body.json.ratelimit + 's), postponing until appropriate time');
                                    waitRequest(function () {
                                        queue.push([queue, metaThingTitle, metaThingSubreddit, metaThingURL, metaThingID, thingURL, thingID]);
                                    }, body.json.ratelimit * 1000);
                                    queueNext();
                                } else if (body.json.errors[0][0] === "DELETED_LINK" || body.json.errors[0][0] === "DELETED_COMMENT") {
                                    console.log(thingID + ' was deleted, marking BAD and    moving on...');
                                    badThings.push(thingID);
                                    saveData();
                                    queueNext();
                                } else if (body.json.errors[0][0] === "TOO_OLD") {
                                    console.log(thingID + ' was too old, marking BAD and    moving on...');
                                    badThings.push(thingID);
                                    saveData();
                                    queueNext();
                                } else if (body.json.errors[0][0] === "NOT_AUTHOR") {
                                    console.log('Not author of ' + thingID + ' comment ' + record.commentID + '??');
                                    return;
                                } else if (body.json.errors[0][0] === 'USER_REQUIRED') {
                                    console.log('Got USER_REQUIRED, need to log in again.');
                                    doLogin();
                                    return;
                                } else {
                                    console.log('Error posting/editing comment: ' + body.json.errors);
                                    return;
                                }
                            }
                        } else {
                            if (response && response.statusCode >= 400 && response.statusCode < 500) {
                                console.log(thingID + ' was ' + response.statusCode + ', marking BAD and moving on: ' + thingURL);
                                badThings.push(thingID);
                                saveData();
                                queueNext();
                            } else if (response && response.statusCode >= 500 && response.statusCode < 600) {
                                console.log(thingID + ' was ' + response.statusCode + ', retrying');
                                waitRequest(processLink(queue, metaThingTitle, metaThingSubreddit, metaThingURL, metaThingID, thingURL, thingID));
                            } else if (response) {
                                console.log('Error posting/editing comment: ' + response.statusCode + ', ' + error);
                                return;
                            } else {
                                console.log('Error posting/editing comment: ' + error);
                                return;
                            }
                        }
                    });
                });
            } else {
                if (response && response.statusCode >= 500 && response.statusCode < 600) {
                    console.log(thingID + ' was ' + response.statusCode + ', internal server error, retrying');
                    waitRequest(processLink(queue, metaThingTitle, metaThingSubreddit, metaThingURL, metaThingID, thingURL, thingID));
                } else if (response && response.statusCode >= 400 && response.statusCode < 500) {
                    console.log(thingID + ' was ' + response.statusCode + ', marking BAD and moving on: ' + thingURL);
                    badThings.push(thingID);
                    queueNext();
                } else if (response) {
                    console.log('Error fetching ' + thingID + ': ' + response.statusCode + ', ' + error);
                } else {
                    console.log('Error fetching ' + thingID + ': ' + error);
                }
            }
        });
    });
}

function process(obj) {
    obj.data.children.forEach(function (child) {
        var data = child.data, thingData;

        if (!_.contains(metaThingsSeen, data.name)) {
            console.log('Haven\'t seen ' + data.name + ' (' + data.subreddit + ')');
            metaThingsSeen.push(data.name);
            thingData = getDataForURL(data.url);
            if (!thingData) {
                console.log('Rejected non-comment/submission: ' + data.url);
                return;
            } else if (_.contains(badThings, thingData.thingID)) {
                console.log('Rejected known bad thing: ' + data.url);
                return;
            } else if (_.contains(config.subredditBlacklist, data.subreddit.toLowerCase())) {
                console.log('Rejected thing from blacklisted subreddit (' + data.subreddit + '): ' + data.url);
                return;
            } else if (_.contains(config.usernameBlacklist, data.author.toLowerCase())) {
                console.log('Rejected thing from blacklisted username (' + data.author + '): ' + data.url);
                return;
            // if meta thing already seen
            } else if (thingRecords.hasOwnProperty(thingData.thingID) && _.contains(_.pluck(thingRecords[thingData.thingID].metaThings, 'thingID'), data.name)) {
                console.log('Rejected already known of meta thing ' + data.name + ': ' +    data.permalink);
                return;
            }
            queue.push([queue, data.title, data.subreddit, data.permalink, data.name, thingData.thingURL, thingData.thingID]);
        }
    });
    queueNext();
}


text:
{% macro edit_link(value, endpoint) %}
    {% if value.can_edit() %}

    {% endif %}
{% endmacro %}

{% macro detail_link(value, endpoint) %}
    {% if value.can_view_details() %}

    {% endif %}
{% endmacro %}

<a style='cursor:help' data-toggle='popover'
   title='{{ title }} {{ edit_link(value, endpoint) }}  {{ detail_link(value, endpoint) }}'
   data-content='

基本信息

    {% for f in header %}

{{ f.label }}	{{ f.value or ' ' }}

    {% endfor %}

{% if detail_labels|length > 0 %}

行信息

        {% for label in  detail_labels %}{{ label }}	{% endfor %}

        {% for line in detail_lines %}

{% for field in line %}{{ field or ' ' }}	{% endfor %}

        {% endfor %}

{% endif %}'>[ {{ title }} ]


text:
set -x

dest=s7.wservices.ch

##git push

rsync -avz -e ssh src/protocoller/db/main $dest:devel/protocoller/src/protocoller/db/main

ssh $dest "cd devel/protocoller &&  ~/init/protocoller restart"


text:
package corev1

import (
	"encoding/json"

	v1 "k8s.io/api/core/v1"
	"k8s.io/component-helpers/scheduling/corev1/nodeaffinity"
)

// PodPriority returns priority of the given pod.
func PodPriority(pod *v1.Pod) int32 {
	if pod.Spec.Priority != nil {
		return *pod.Spec.Priority
	}
	// When priority of a running pod is nil, it means it was created at a time
	// that there was no global default priority class and the priority class
	// name of the pod was empty. So, we resolve to the static default priority.
	return 0
}

// MatchNodeSelectorTerms checks whether the node labels and fields match node selector terms in ORed;
// nil or empty term matches no objects.
func MatchNodeSelectorTerms(
	node *v1.Node,
	nodeSelector *v1.NodeSelector,
) (bool, error) {
	if node == nil {
		return false, nil
	}
	return nodeaffinity.NewLazyErrorNodeSelector(nodeSelector).Match(node)
}

// GetAvoidPodsFromNodeAnnotations scans the list of annotations and
// returns the pods that needs to be avoided for this node from scheduling
func GetAvoidPodsFromNodeAnnotations(annotations map[string]string) (v1.AvoidPods, error) {
	var avoidPods v1.AvoidPods
	if len(annotations) > 0 && annotations[v1.PreferAvoidPodsAnnotationKey] != "" {
		err := json.Unmarshal([]byte(annotations[v1.PreferAvoidPodsAnnotationKey]), &avoidPods)
		if err != nil {
			return avoidPods, err
		}
	}
	return avoidPods, nil
}

// TolerationsTolerateTaint checks if taint is tolerated by any of the tolerations.
func TolerationsTolerateTaint(tolerations []v1.Toleration, taint *v1.Taint) bool {
	for i := range tolerations {
		if tolerations[i].ToleratesTaint(taint) {
			return true
		}
	}
	return false
}

type taintsFilterFunc func(*v1.Taint) bool

// FindMatchingUntoleratedTaint checks if the given tolerations tolerates
// all the filtered taints, and returns the first taint without a toleration
// Returns true if there is an untolerated taint
// Returns false if all taints are tolerated
func FindMatchingUntoleratedTaint(taints []v1.Taint, tolerations []v1.Toleration, inclusionFilter taintsFilterFunc) (v1.Taint, bool) {
	filteredTaints := getFilteredTaints(taints, inclusionFilter)
	for _, taint := range filteredTaints {
		if !TolerationsTolerateTaint(tolerations, &taint) {
			return taint, true
		}
	}
	return v1.Taint{}, false
}

// getFilteredTaints returns a list of taints satisfying the filter predicate
func getFilteredTaints(taints []v1.Taint, inclusionFilter taintsFilterFunc) []v1.Taint {
	if inclusionFilter == nil {
		return taints
	}
	filteredTaints := []v1.Taint{}
	for _, taint := range taints {
		if !inclusionFilter(&taint) {
			continue
		}
		filteredTaints = append(filteredTaints, taint)
	}
	return filteredTaints
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AbstractPlay2SourcePositionMapper (Play! 2.x Source Position Mappers 1.0.0-rc2 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.google.code.play2.spm

Class AbstractPlay2SourcePositionMapper

<map id="G" name="G">
<area shape="rect" id="node1_0" href="./AbstractPlay2SourcePositionMapper.html" title="com.google.code.play2.spm.AbstractPlay2SourcePositionMapper" alt="" coords="145,129,363,153"/>
<area shape="rect" id="node1" href="./AbstractPlay2SourcePositionMapper.html" title="<TABLE>" alt="" coords="135,117,373,165"/>
<area shape="rect" id="node2_1" href="./routes/Play2RoutesSourcePositionMapper.html" title="com.google.code.play2.spm.routes.Play2RoutesSourcePositionMapper" alt="" coords="16,219,228,256"/>
<area shape="rect" id="node2" href="./routes/Play2RoutesSourcePositionMapper.html" title="<TABLE>" alt="" coords="5,213,239,261"/>
<area shape="rect" id="node3_2" href="./template/Play2TemplateSourcePositionMapper.html" title="com.google.code.play2.spm.template.Play2TemplateSourcePositionMapper" alt="" coords="274,219,498,256"/>
<area shape="rect" id="node3" href="./template/Play2TemplateSourcePositionMapper.html" title="<TABLE>" alt="" coords="263,213,509,261"/>
<area shape="rect" id="node4_3" href="http://sbt-compiler-maven-plugin.github.io/sbt-compiler-maven-plugin/1.0.0/sbt-compiler-api/apidocs/com/google/code/sbt/compiler/api/SourcePositionMapper.html" title="com.google.code.sbt.compiler.api.SourcePositionMapper" alt="" coords="175,11,333,64"/>
<area shape="rect" id="node4" href="http://sbt-compiler-maven-plugin.github.io/sbt-compiler-maven-plugin/1.0.0/sbt-compiler-api/apidocs/com/google/code/sbt/compiler/api/SourcePositionMapper.html" title="<TABLE>" alt="" coords="165,5,343,69"/>
</map>

java.lang.Object

com.google.code.play2.spm.AbstractPlay2SourcePositionMapper

All Implemented Interfaces:

SourcePositionMapper

Direct Known Subclasses:

Play2RoutesSourcePositionMapper, Play2TemplateSourcePositionMapper

public abstract class AbstractPlay2SourcePositionMapper
extends java.lang.Object
implements SourcePositionMapper

Abstract Play! Framework source position mapper

Author:

Grzegorz Slowikowski

Constructor Summary

Constructors

Constructor and Description

AbstractPlay2SourcePositionMapper()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

protected java.lang.String
readFileAsString(java.io.File file)

Reads the content of the file to a string.

void
setCharsetName(java.lang.String charsetName)

Sets source files character set name (encoding).

Methods inherited from class java.lang.Object

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

Methods inherited from interface com.google.code.sbt.compiler.api.SourcePositionMapper

map

Constructor Detail

AbstractPlay2SourcePositionMapper

public AbstractPlay2SourcePositionMapper()

Method Detail

setCharsetName

public void setCharsetName(java.lang.String charsetName)

Sets source files character set name (encoding).

Specified by:

setCharsetName in interface SourcePositionMapper

Parameters:

charsetName - source files character set name

readFileAsString

protected java.lang.String readFileAsString(java.io.File file)
                                     throws java.io.IOException

Reads the content of the file to a string.

Parameters:

file - a file to read the content of

Returns:

the content of the file

Throws:

java.io.IOException - I/O exception when reading from the file

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2013–2018. All rights reserved.


text:
package com.amazonaws.services.mediaconvert.model;

import javax.annotation.Generated;

/**
 * If the sample range metadata in your input video is accurate, or if you don't know about sample range, keep the
 * default value, Follow (FOLLOW), for this setting. When you do, the service automatically detects your input sample
 * range. If your input video has metadata indicating the wrong sample range, specify the accurate sample range here.
 * When you do, MediaConvert ignores any sample range information in the input metadata. Regardless of whether
 * MediaConvert uses the input sample range or the sample range that you specify, MediaConvert uses the sample range for
 * transcoding and also writes it to the output metadata.
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum InputSampleRange {

    FOLLOW("FOLLOW"),
    FULL_RANGE("FULL_RANGE"),
    LIMITED_RANGE("LIMITED_RANGE");

    private String value;

    private InputSampleRange(String value) {
        this.value = value;
    }

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

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return InputSampleRange corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static InputSampleRange fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (InputSampleRange enumEntry : InputSampleRange.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
<?php

/**
 * Products Most Viewed Report collection
 *
 * @category    Mage
 * @package     Mage_Reports
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Reports_Model_Resource_Product_Viewed_Collection extends Mage_Reports_Model_Resource_Product_Collection
{
    /**
     * List of store ids for the current collection will be filtered by
     *
     * @var array
     */
    protected $_storeIds = array();

    /**
     * Join fields
     *
     * @param string $from
     * @param string $to
     * @return Mage_Reports_Model_Resource_Product_Viewed_Collection
     */
    protected function _joinFields($from = '', $to = '')
    {
        $this->addAttributeToSelect('*')
            ->addViewsCount($from, $to);
        return $this;
    }

    /**
     * Set date range
     *
     * @param string $from
     * @param string $to
     * @return Mage_Reports_Model_Resource_Product_Viewed_Collection
     */
    public function setDateRange($from, $to)
    {
        $this->_reset()
            ->_joinFields($from, $to);
        return $this;
    }

    /**
     * Set store ids
     *
     * @param array $storeIds
     * @return Mage_Reports_Model_Resource_Product_Viewed_Collection
     */
    public function setStoreIds($storeIds)
    {
        $storeId = array_pop($storeIds);
        $this->setStoreId($storeId);
        $this->addStoreFilter($storeId);
        $this->addStoreIds($storeId);
        return $this;
    }

    /**
     * Add store ids to filter 'report_event' data by store
     *
     * @param array|int $storeIds
     * @return Mage_Reports_Model_Resource_Product_Viewed_Collection
     */
    public function addStoreIds($storeIds)
    {
        if (is_array($storeIds)) {
            $this->_storeIds = array_merge($this->_storeIds, $storeIds);
        } else {
            $this->_storeIds[] = $storeIds;
        }
        return $this;
    }

    /**
     * Apply store filter
     *
     * @return Mage_Reports_Model_Resource_Product_Viewed_Collection
     */
    protected function _applyStoreIds()
    {
        $this->getSelect()->where('store_id IN(?)', $this->_storeIds);
        return $this;
    }

    /**
     * Apply filters
     *
     * @return Mage_Catalog_Model_Resource_Product_Collection
     */
    protected function _beforeLoad()
    {
        $this->_applyStoreIds();
        return parent::_beforeLoad();
    }
}


text:
<?php
# Copyright 2013 Mike Thorn (github: WasabiVengeance). All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

class bsc_widget_div extends bsc_widget
{
	function init()
	{
		$this->option_order = array('text');
		$this->options['tag'] = 'div';
		$this->option('text','');
	}

	function render_start()
	{
		$html = parent::render_start();
		$html .= $this->__translate($this->options['text']);
		return $html;
	}
}

?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
	<InformationRegister uuid="0ddeed48-b98a-47c3-84a2-2eac065be06c">
		<InternalInfo>
			<xr:GeneratedType name="InformationRegisterRecord.НомераОтсканированныхФайлов" category="Record">
				<xr:TypeId>e27b85e3-a432-4dbc-a824-38b6de3480f3</xr:TypeId>
				<xr:ValueId>1896af8c-2bb3-4a1d-89b9-f92cffe30cc9</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="InformationRegisterManager.НомераОтсканированныхФайлов" category="Manager">
				<xr:TypeId>f75f2fce-3485-4a86-8812-f38739bb7a0c</xr:TypeId>
				<xr:ValueId>707a550d-178b-4ec6-9e38-bef3ee7eef62</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="InformationRegisterSelection.НомераОтсканированныхФайлов" category="Selection">
				<xr:TypeId>16fdde4b-6a01-4c34-bbac-98e75547a3b3</xr:TypeId>
				<xr:ValueId>b8edf246-0629-4eb1-8cad-c317bf088081</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="InformationRegisterList.НомераОтсканированныхФайлов" category="List">
				<xr:TypeId>42d4761a-c564-4ea3-99c2-f3ed6a772dea</xr:TypeId>
				<xr:ValueId>35b687b3-abdb-479f-ad47-ccc7db01a11d</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="InformationRegisterRecordSet.НомераОтсканированныхФайлов" category="RecordSet">
				<xr:TypeId>b160a565-16a3-46ee-b010-7bb9275e352f</xr:TypeId>
				<xr:ValueId>85137ce0-1483-4d5e-8d75-1d8cdd6fbbd0</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="InformationRegisterRecordKey.НомераОтсканированныхФайлов" category="RecordKey">
				<xr:TypeId>1410ec4b-63d9-4dd0-a5be-d25c818f884f</xr:TypeId>
				<xr:ValueId>85183500-64d9-42e5-b5f6-6e31de57a057</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="InformationRegisterRecordManager.НомераОтсканированныхФайлов" category="RecordManager">
				<xr:TypeId>6a56c808-327c-48df-b32a-6845ee01f3f2</xr:TypeId>
				<xr:ValueId>cbceff5a-f4ca-4833-83a2-58dee11c16c1</xr:ValueId>
			</xr:GeneratedType>
		</InternalInfo>
		<Properties>
			<Name>НомераОтсканированныхФайлов</Name>
			<Synonym>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Номера отсканированных файлов</v8:content>
				</v8:item>
			</Synonym>
			<Comment/>
			<UseStandardCommands>false</UseStandardCommands>
			<EditType>InDialog</EditType>
			<DefaultRecordForm/>
			<DefaultListForm/>
			<AuxiliaryRecordForm/>
			<AuxiliaryListForm/>
			<StandardAttributes>
				<xr:StandardAttribute name="Active">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="LineNumber">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Recorder">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Period">
					<xr:LinkByType/>
					<xr:FillChecking>ShowError</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
			</StandardAttributes>
			<InformationRegisterPeriodicity>Nonperiodical</InformationRegisterPeriodicity>
			<WriteMode>Independent</WriteMode>
			<MainFilterOnPeriod>false</MainFilterOnPeriod>
			<IncludeHelpInContents>true</IncludeHelpInContents>
			<DataLockControlMode>Managed</DataLockControlMode>
			<FullTextSearch>DontUse</FullTextSearch>
			<EnableTotalsSliceFirst>false</EnableTotalsSliceFirst>
			<EnableTotalsSliceLast>false</EnableTotalsSliceLast>
			<RecordPresentation/>
			<ExtendedRecordPresentation/>
			<ListPresentation/>
			<ExtendedListPresentation/>
			<Explanation/>
		</Properties>
		<ChildObjects>
			<Resource uuid="7987fe2c-d7cc-4fd2-ac4e-610bfb1ab6d2">
				<Properties>
					<Name>Номер</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Номер</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:decimal</v8:Type>
						<v8:NumberQualifiers>
							<v8:Digits>9</v8:Digits>
							<v8:FractionDigits>0</v8:FractionDigits>
							<v8:AllowedSign>Any</v8:AllowedSign>
						</v8:NumberQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Номер сканирования</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Resource>
			<Dimension uuid="fc18d95e-a51d-45c0-83b0-09aeb2b5b03a">
				<Properties>
					<Name>Владелец</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Владелец</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:TypeSet>cfg:ExchangePlanRef</v8:TypeSet>
						<v8:TypeSet>cfg:BusinessProcessRef</v8:TypeSet>
						<v8:TypeSet>cfg:DocumentRef</v8:TypeSet>
						<v8:TypeSet>cfg:ChartOfCalculationTypesRef</v8:TypeSet>
						<v8:TypeSet>cfg:TaskRef</v8:TypeSet>
						<v8:TypeSet>cfg:ChartOfCharacteristicTypesRef</v8:TypeSet>
						<v8:TypeSet>cfg:ChartOfAccountsRef</v8:TypeSet>
						<v8:TypeSet>cfg:CatalogRef</v8:TypeSet>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Владелец номера</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Master>true</Master>
					<MainFilter>true</MainFilter>
					<DenyIncompleteValues>false</DenyIncompleteValues>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Dimension>
		</ChildObjects>
	</InformationRegister>
</MetaDataObject>


text:
'use strict';

const Stream = require('stream');
const Readable = Stream.Readable;
const binding = process.binding('http2');
const constants = binding.constants;
const {
  ERR_HTTP2_HEADERS_SENT,
  ERR_HTTP2_INFO_STATUS_NOT_ALLOWED,
  ERR_HTTP2_INVALID_HEADER_VALUE,
  ERR_HTTP2_INVALID_STREAM,
  ERR_HTTP2_NO_SOCKET_MANIPULATION,
  ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED,
  ERR_HTTP2_STATUS_INVALID,
  ERR_INVALID_ARG_TYPE,
  ERR_INVALID_ARG_VALUE,
  ERR_INVALID_CALLBACK,
  ERR_INVALID_HTTP_TOKEN
} = require('internal/errors').codes;
const { kSocket } = require('internal/http2/util');

const kFinish = Symbol('finish');
const kBeginSend = Symbol('begin-send');
const kState = Symbol('state');
const kStream = Symbol('stream');
const kRequest = Symbol('request');
const kResponse = Symbol('response');
const kHeaders = Symbol('headers');
const kRawHeaders = Symbol('rawHeaders');
const kTrailers = Symbol('trailers');
const kRawTrailers = Symbol('rawTrailers');
const kProxySocket = Symbol('proxySocket');
const kSetHeader = Symbol('setHeader');
const kAborted = Symbol('aborted');

const {
  HTTP2_HEADER_AUTHORITY,
  HTTP2_HEADER_METHOD,
  HTTP2_HEADER_PATH,
  HTTP2_HEADER_SCHEME,
  HTTP2_HEADER_STATUS,

  HTTP_STATUS_CONTINUE,
  HTTP_STATUS_EXPECTATION_FAILED,
  HTTP_STATUS_METHOD_NOT_ALLOWED,
  HTTP_STATUS_OK
} = constants;

let statusMessageWarned = false;

// Defines and implements an API compatibility layer on top of the core
// HTTP/2 implementation, intended to provide an interface that is as
// close as possible to the current require('http') API

function assertValidHeader(name, value) {
  let err;
  if (name === '' || typeof name !== 'string') {
    err = new ERR_INVALID_HTTP_TOKEN('Header name', name);
  } else if (isPseudoHeader(name)) {
    err = new ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED();
  } else if (value === undefined || value === null) {
    err = new ERR_HTTP2_INVALID_HEADER_VALUE(value, name);
  }
  if (err !== undefined) {
    Error.captureStackTrace(err, assertValidHeader);
    throw err;
  }
}

function isPseudoHeader(name) {
  switch (name) {
    case HTTP2_HEADER_STATUS:    // :status
    case HTTP2_HEADER_METHOD:    // :method
    case HTTP2_HEADER_PATH:      // :path
    case HTTP2_HEADER_AUTHORITY: // :authority
    case HTTP2_HEADER_SCHEME:    // :scheme
      return true;
    default:
      return false;
  }
}

function statusMessageWarn() {
  if (statusMessageWarned === false) {
    process.emitWarning(
      'Status message is not supported by HTTP/2 (RFC7540 8.1.2.4)',
      'UnsupportedWarning'
    );
    statusMessageWarned = true;
  }
}

function onStreamData(chunk) {
  const request = this[kRequest];
  if (request !== undefined && !request.push(chunk))
    this.pause();
}

function onStreamTrailers(trailers, flags, rawTrailers) {
  const request = this[kRequest];
  if (request !== undefined) {
    Object.assign(request[kTrailers], trailers);
    request[kRawTrailers].push(...rawTrailers);
  }
}

function onStreamEnd() {
  // Cause the request stream to end as well.
  const request = this[kRequest];
  if (request !== undefined)
    this[kRequest].push(null);
}

function onStreamError(error) {
  // this is purposefully left blank
  //
  // errors in compatibility mode are
  // not forwarded to the request
  // and response objects. However,
  // they are forwarded to 'streamError'
  // on the server by Http2Stream
}

function onRequestPause() {
  this[kStream].pause();
}

function onRequestResume() {
  this[kStream].resume();
}

function onStreamDrain() {
  const response = this[kResponse];
  if (response !== undefined)
    response.emit('drain');
}

function onStreamAbortedRequest() {
  const request = this[kRequest];
  if (request !== undefined && request[kState].closed === false) {
    request[kAborted] = true;
    request.emit('aborted');
  }
}

function onStreamAbortedResponse() {
  // non-op for now
}

function resumeStream(stream) {
  stream.resume();
}

const proxySocketHandler = {
  get(stream, prop) {
    switch (prop) {
      case 'on':
      case 'once':
      case 'end':
      case 'emit':
      case 'destroy':
        return stream[prop].bind(stream);
      case 'writable':
      case 'destroyed':
        return stream[prop];
      case 'readable':
        if (stream.destroyed)
          return false;
        const request = stream[kRequest];
        return request ? request.readable : stream.readable;
      case 'setTimeout':
        const session = stream.session;
        if (session !== undefined)
          return session.setTimeout.bind(session);
        return stream.setTimeout.bind(stream);
      case 'write':
      case 'read':
      case 'pause':
      case 'resume':
        throw new ERR_HTTP2_NO_SOCKET_MANIPULATION();
      default:
        const ref = stream.session !== undefined ?
          stream.session[kSocket] : stream;
        const value = ref[prop];
        return typeof value === 'function' ? value.bind(ref) : value;
    }
  },
  getPrototypeOf(stream) {
    if (stream.session !== undefined)
      return Reflect.getPrototypeOf(stream.session[kSocket]);
    return Reflect.getPrototypeOf(stream);
  },
  set(stream, prop, value) {
    switch (prop) {
      case 'writable':
      case 'readable':
      case 'destroyed':
      case 'on':
      case 'once':
      case 'end':
      case 'emit':
      case 'destroy':
        stream[prop] = value;
        return true;
      case 'setTimeout':
        const session = stream.session;
        if (session !== undefined)
          session.setTimeout = value;
        else
          stream.setTimeout = value;
        return true;
      case 'write':
      case 'read':
      case 'pause':
      case 'resume':
        throw new ERR_HTTP2_NO_SOCKET_MANIPULATION();
      default:
        const ref = stream.session !== undefined ?
          stream.session[kSocket] : stream;
        ref[prop] = value;
        return true;
    }
  }
};

class Http2ServerRequest extends Readable {
  constructor(stream, headers, options, rawHeaders) {
    super(options);
    this[kState] = {
      closed: false,
      didRead: false,
    };
    this[kHeaders] = headers;
    this[kRawHeaders] = rawHeaders;
    this[kTrailers] = {};
    this[kRawTrailers] = [];
    this[kStream] = stream;
    this[kAborted] = false;
    stream[kProxySocket] = null;
    stream[kRequest] = this;

    // Pause the stream..
    stream.pause();
    stream.on('data', onStreamData);
    stream.on('trailers', onStreamTrailers);
    stream.on('end', onStreamEnd);
    stream.on('error', onStreamError);
    stream.on('aborted', onStreamAbortedRequest);
    stream.on('close', this[kFinish].bind(this));
    this.on('pause', onRequestPause);
    this.on('resume', onRequestResume);
  }

  get aborted() {
    return this[kAborted];
  }

  get complete() {
    return this._readableState.ended ||
           this[kState].closed ||
           this[kStream].destroyed;
  }

  get stream() {
    return this[kStream];
  }

  get headers() {
    return this[kHeaders];
  }

  get rawHeaders() {
    return this[kRawHeaders];
  }

  get trailers() {
    return this[kTrailers];
  }

  get rawTrailers() {
    return this[kRawTrailers];
  }

  get httpVersionMajor() {
    return 2;
  }

  get httpVersionMinor() {
    return 0;
  }

  get httpVersion() {
    return '2.0';
  }

  get socket() {
    const stream = this[kStream];
    const proxySocket = stream[kProxySocket];
    if (proxySocket === null)
      return stream[kProxySocket] = new Proxy(stream, proxySocketHandler);
    return proxySocket;
  }

  get connection() {
    return this.socket;
  }

  _read(nread) {
    const state = this[kState];
    if (!state.closed) {
      state.didRead = true;
      process.nextTick(resumeStream, this[kStream]);
    } else {
      this.emit('error', new ERR_HTTP2_INVALID_STREAM());
    }
  }

  get method() {
    return this[kHeaders][HTTP2_HEADER_METHOD];
  }

  set method(method) {
    if (typeof method !== 'string')
      throw new ERR_INVALID_ARG_TYPE('method', 'string', method);
    if (method.trim() === '')
      throw new ERR_INVALID_ARG_VALUE('method', method);

    this[kHeaders][HTTP2_HEADER_METHOD] = method;
  }

  get authority() {
    return this[kHeaders][HTTP2_HEADER_AUTHORITY];
  }

  get scheme() {
    return this[kHeaders][HTTP2_HEADER_SCHEME];
  }

  get url() {
    return this[kHeaders][HTTP2_HEADER_PATH];
  }

  set url(url) {
    this[kHeaders][HTTP2_HEADER_PATH] = url;
  }

  setTimeout(msecs, callback) {
    if (this[kState].closed)
      return;
    this[kStream].setTimeout(msecs, callback);
  }

  [kFinish]() {
    const state = this[kState];
    if (state.closed)
      return;
    state.closed = true;
    this.push(null);
    this[kStream][kRequest] = undefined;
    // if the user didn't interact with incoming data and didn't pipe it,
    // dump it for compatibility with http1
    if (!state.didRead && !this._readableState.resumeScheduled)
      this.resume();
    this.emit('close');
  }
}

function onStreamTrailersReady() {
  this[kStream].sendTrailers(this[kTrailers]);
}

class Http2ServerResponse extends Stream {
  constructor(stream, options) {
    super(options);
    this[kState] = {
      closed: false,
      ending: false,
      headRequest: false,
      sendDate: true,
      statusCode: HTTP_STATUS_OK,
    };
    this[kHeaders] = Object.create(null);
    this[kTrailers] = Object.create(null);
    this[kStream] = stream;
    stream[kProxySocket] = null;
    stream[kResponse] = this;
    this.writable = true;
    stream.on('drain', onStreamDrain);
    stream.on('aborted', onStreamAbortedResponse);
    stream.on('close', this[kFinish].bind(this));
    stream.on('wantTrailers', onStreamTrailersReady.bind(this));
  }

  // User land modules such as finalhandler just check truthiness of this
  // but if someone is actually trying to use this for more than that
  // then we simply can't support such use cases
  get _header() {
    return this.headersSent;
  }

  get finished() {
    const stream = this[kStream];
    return stream.destroyed ||
           stream._writableState.ended ||
           this[kState].closed;
  }

  get socket() {
    // this is compatible with http1 which removes socket reference
    // only from ServerResponse but not IncomingMessage
    if (this[kState].closed)
      return;

    const stream = this[kStream];
    const proxySocket = stream[kProxySocket];
    if (proxySocket === null)
      return stream[kProxySocket] = new Proxy(stream, proxySocketHandler);
    return proxySocket;
  }

  get connection() {
    return this.socket;
  }

  get stream() {
    return this[kStream];
  }

  get headersSent() {
    return this[kStream].headersSent;
  }

  get sendDate() {
    return this[kState].sendDate;
  }

  set sendDate(bool) {
    this[kState].sendDate = Boolean(bool);
  }

  get statusCode() {
    return this[kState].statusCode;
  }

  set statusCode(code) {
    code |= 0;
    if (code >= 100 && code < 200)
      throw new ERR_HTTP2_INFO_STATUS_NOT_ALLOWED();
    if (code < 100 || code > 599)
      throw new ERR_HTTP2_STATUS_INVALID(code);
    this[kState].statusCode = code;
  }

  setTrailer(name, value) {
    if (typeof name !== 'string')
      throw new ERR_INVALID_ARG_TYPE('name', 'string', name);

    name = name.trim().toLowerCase();
    assertValidHeader(name, value);
    this[kTrailers][name] = value;
  }

  addTrailers(headers) {
    const keys = Object.keys(headers);
    let key = '';
    for (var i = 0; i < keys.length; i++) {
      key = keys[i];
      this.setTrailer(key, headers[key]);
    }
  }

  getHeader(name) {
    if (typeof name !== 'string')
      throw new ERR_INVALID_ARG_TYPE('name', 'string', name);

    name = name.trim().toLowerCase();
    return this[kHeaders][name];
  }

  getHeaderNames() {
    return Object.keys(this[kHeaders]);
  }

  getHeaders() {
    return Object.assign({}, this[kHeaders]);
  }

  hasHeader(name) {
    if (typeof name !== 'string')
      throw new ERR_INVALID_ARG_TYPE('name', 'string', name);

    name = name.trim().toLowerCase();
    return Object.prototype.hasOwnProperty.call(this[kHeaders], name);
  }

  removeHeader(name) {
    if (typeof name !== 'string')
      throw new ERR_INVALID_ARG_TYPE('name', 'string', name);

    if (this[kStream].headersSent)
      throw new ERR_HTTP2_HEADERS_SENT();

    name = name.trim().toLowerCase();
    delete this[kHeaders][name];
  }

  setHeader(name, value) {
    if (typeof name !== 'string')
      throw new ERR_INVALID_ARG_TYPE('name', 'string', name);

    if (this[kStream].headersSent)
      throw new ERR_HTTP2_HEADERS_SENT();

    this[kSetHeader](name, value);
  }

  [kSetHeader](name, value) {
    name = name.trim().toLowerCase();
    assertValidHeader(name, value);
    this[kHeaders][name] = value;
  }

  get statusMessage() {
    statusMessageWarn();

    return '';
  }

  set statusMessage(msg) {
    statusMessageWarn();
  }

  flushHeaders() {
    const state = this[kState];
    if (!state.closed && !this[kStream].headersSent)
      this.writeHead(state.statusCode);
  }

  writeHead(statusCode, statusMessage, headers) {
    const state = this[kState];

    if (state.closed)
      throw new ERR_HTTP2_INVALID_STREAM();
    if (this[kStream].headersSent)
      throw new ERR_HTTP2_HEADERS_SENT();

    if (typeof statusMessage === 'string')
      statusMessageWarn();

    if (headers === undefined && typeof statusMessage === 'object')
      headers = statusMessage;

    if (typeof headers === 'object') {
      const keys = Object.keys(headers);
      let key = '';
      for (var i = 0; i < keys.length; i++) {
        key = keys[i];
        this[kSetHeader](key, headers[key]);
      }
    }

    state.statusCode = statusCode;
    this[kBeginSend]();
  }

  write(chunk, encoding, cb) {
    if (typeof encoding === 'function') {
      cb = encoding;
      encoding = 'utf8';
    }

    if (this[kState].closed) {
      const err = new ERR_HTTP2_INVALID_STREAM();
      if (typeof cb === 'function')
        process.nextTick(cb, err);
      else
        throw err;
      return;
    }

    const stream = this[kStream];
    if (!stream.headersSent)
      this.writeHead(this[kState].statusCode);
    return stream.write(chunk, encoding, cb);
  }

  end(chunk, encoding, cb) {
    const stream = this[kStream];
    const state = this[kState];

    if ((state.closed || state.ending) &&
        state.headRequest === stream.headRequest) {
      return false;
    }

    if (typeof chunk === 'function') {
      cb = chunk;
      chunk = null;
    } else if (typeof encoding === 'function') {
      cb = encoding;
      encoding = 'utf8';
    }

    if (chunk !== null && chunk !== undefined)
      this.write(chunk, encoding);

    const isFinished = this.finished;
    state.headRequest = stream.headRequest;
    state.ending = true;

    if (typeof cb === 'function') {
      if (isFinished)
        this.once('finish', cb);
      else
        stream.once('finish', cb);
    }

    if (!stream.headersSent)
      this.writeHead(this[kState].statusCode);

    if (isFinished)
      this[kFinish]();
    else
      stream.end();

    return this;
  }

  destroy(err) {
    if (this[kState].closed)
      return;
    this[kStream].destroy(err);
  }

  setTimeout(msecs, callback) {
    if (this[kState].closed)
      return;
    this[kStream].setTimeout(msecs, callback);
  }

  createPushResponse(headers, callback) {
    if (typeof callback !== 'function')
      throw new ERR_INVALID_CALLBACK();
    if (this[kState].closed) {
      process.nextTick(callback, new ERR_HTTP2_INVALID_STREAM());
      return;
    }
    this[kStream].pushStream(headers, {}, (err, stream, headers, options) => {
      if (err) {
        callback(err);
        return;
      }
      callback(null, new Http2ServerResponse(stream));
    });
  }

  [kBeginSend]() {
    const state = this[kState];
    const headers = this[kHeaders];
    headers[HTTP2_HEADER_STATUS] = state.statusCode;
    const options = {
      endStream: state.ending,
      waitForTrailers: true,
    };
    this[kStream].respond(headers, options);
  }

  [kFinish]() {
    const stream = this[kStream];
    const state = this[kState];
    if (state.closed || stream.headRequest !== state.headRequest)
      return;
    state.closed = true;
    this[kProxySocket] = null;
    stream[kResponse] = undefined;
    this.emit('finish');
    this.emit('close');
  }

  // TODO doesn't support callbacks
  writeContinue() {
    const stream = this[kStream];
    if (stream.headersSent || this[kState].closed)
      return false;
    stream.additionalHeaders({
      [HTTP2_HEADER_STATUS]: HTTP_STATUS_CONTINUE
    });
    return true;
  }
}

function onServerStream(ServerRequest, ServerResponse,
                        stream, headers, flags, rawHeaders) {
  const server = this;
  const request = new ServerRequest(stream, headers, undefined, rawHeaders);
  const response = new ServerResponse(stream);

  // Check for the CONNECT method
  const method = headers[HTTP2_HEADER_METHOD];
  if (method === 'CONNECT') {
    if (!server.emit('connect', request, response)) {
      response.statusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;
      response.end();
    }
    return;
  }

  // Check for Expectations
  if (headers.expect !== undefined) {
    if (headers.expect === '100-continue') {
      if (server.listenerCount('checkContinue')) {
        server.emit('checkContinue', request, response);
      } else {
        response.writeContinue();
        server.emit('request', request, response);
      }
    } else if (server.listenerCount('checkExpectation')) {
      server.emit('checkExpectation', request, response);
    } else {
      response.statusCode = HTTP_STATUS_EXPECTATION_FAILED;
      response.end();
    }
    return;
  }

  server.emit('request', request, response);
}

module.exports = {
  onServerStream,
  Http2ServerRequest,
  Http2ServerResponse,
};


text:
package com.github.rafasantos.cli;

import java.io.FileNotFoundException;
import java.net.URL;
import org.junit.Test;
import com.github.rafasantos.exception.DiffFilterException;
import static org.junit.Assert.assertEquals;

public class AppCliHandlerIT {

	@Test(expected=FileNotFoundException.class)
	public void fileDoesNotExist_ff() throws FileNotFoundException, DiffFilterException {
		URL secondFile = this.getClass().getClassLoader().getResource("second-file.tsv");
		String[] arguments = {"-ff", "files/does/not/exist/path", "-sf", secondFile.getPath()};
		new AppCliHandler(arguments);
	}

	@Test(expected=FileNotFoundException.class)
	public void fileDoesNotExist_sf() throws FileNotFoundException, DiffFilterException {
		URL firstFile = this.getClass().getClassLoader().getResource("first-file.tsv");
		String[] arguments = {"-ff", firstFile.getPath(), "-sf", "files/does/not/exist/path"};
		new AppCliHandler(arguments);
	}

	@Test
	public void validConstructor() throws FileNotFoundException, DiffFilterException {
		URL firstFile = this.getClass().getClassLoader().getResource("first-file.tsv");
		URL secondFile = this.getClass().getClassLoader().getResource("second-file.tsv");
		String[] arguments = {"-ff", firstFile.getPath(), "-sf", secondFile.getPath(), ""};
		new AppCliHandler(arguments);
	}

	@Test(expected=DiffFilterException.class)
	public void uniqueIndexes_negative() throws FileNotFoundException, DiffFilterException {
		URL firstFile = this.getClass().getClassLoader().getResource("first-file.tsv");
		URL secondFile = this.getClass().getClassLoader().getResource("second-file.tsv");
		String[] arguments = {"-ff", firstFile.getPath(), "-sf", secondFile.getPath(), "-ui", "invalid"};
		new AppCliHandler(arguments);
	}

	@Test
	public void uniqueIndexes_positive() throws FileNotFoundException, DiffFilterException {
		URL firstFile = this.getClass().getClassLoader().getResource("first-file.tsv");
		URL secondFile = this.getClass().getClassLoader().getResource("second-file.tsv");
		String[] a1 = {"-ff", firstFile.getPath(), "-sf", secondFile.getPath(), "-ui", "0"};
		new AppCliHandler(a1);
		String[] a2= {"-ff", firstFile.getPath(), "-sf", secondFile.getPath(), "-ui", "0,1"};
		new AppCliHandler(a2);
		String[] a3= {"-ff", firstFile.getPath(), "-sf", secondFile.getPath(), "-ui", "0,1,2"};
		new AppCliHandler(a3);
	}

	@Test
	public void defaultCommandLineMustPickFistAndSecondArgumentsAsFirstAndSecondFile() throws FileNotFoundException, DiffFilterException {
		URL firstFile = this.getClass().getClassLoader().getResource("first-file.tsv");
		URL secondFile = this.getClass().getClassLoader().getResource("second-file.tsv");

		// Simple case: only first and second files
		String[] twoRegularArguments = {"-ff", firstFile.getPath(), "-sf", secondFile.getPath()};
		AppCliHandler twoRegularHandler = new AppCliHandler(twoRegularArguments);
		String[] twoShortArguments = {firstFile.getPath(), secondFile.getPath()};
		AppCliHandler twoShortHandler = new AppCliHandler(twoShortArguments);
		assertEquals(twoRegularHandler.getFirstFile(), twoShortHandler.getFirstFile());
		assertEquals(twoRegularHandler.getSecondFile(), twoShortHandler.getSecondFile());

		// Complex case: only first and second files
		String[] fiveRegularArguments = {"-ff", firstFile.getPath(), "-sf", secondFile.getPath(), "-ui", "0,1", "-it", "InsertTemplate", "-dt", "DeleteTemplate"};
		AppCliHandler fiveRegularHandler = new AppCliHandler(fiveRegularArguments);
		String[] fiveShortArguments = {firstFile.getPath(), secondFile.getPath(), "-ui", "0,1", "-it", "InsertTemplate", "-dt", "DeleteTemplate"};
		AppCliHandler fiveShortHandler = new AppCliHandler(fiveShortArguments);
		assertEquals(fiveRegularHandler.getFirstFile(), fiveShortHandler.getFirstFile());
		assertEquals(fiveRegularHandler.getSecondFile(), fiveShortHandler.getSecondFile());
		assertEquals(fiveRegularHandler.getUniqueIndexes(), fiveShortHandler.getUniqueIndexes());
		assertEquals(fiveRegularHandler.getInsertTemplate(), fiveShortHandler.getInsertTemplate());
		assertEquals(fiveRegularHandler.getDeleteTemplate(), fiveShortHandler.getDeleteTemplate());
	}

}


text:
var cms = {
    //general options and settings
    opts: {},

    //allow only numbers in textbox
    onlyNumbers: function (obj) {
        var me = this,
        strValue = obj.value;

        strValue = strValue.replace(/\D/gi, '');
        obj.value = strValue;
    }
};


text:
import os
import stat

from catapult_base import cloud_storage
from telemetry import decorators
from telemetry.internal.util import path

def _GetBinPath(binary_name, arch_name, platform_name):
  return os.path.join(
      path.GetTelemetryDir(), 'bin', platform_name, arch_name, binary_name)

def _IsInCloudStorage(binary_name, arch_name, platform_name):
  return os.path.exists(
      _GetBinPath(binary_name, arch_name, platform_name) + '.sha1')

@decorators.Cache
def FindLocallyBuiltPath(binary_name):
  """Finds the most recently built |binary_name|."""
  command = None
  command_mtime = 0
  chrome_root = path.GetChromiumSrcDir()
  required_mode = os.X_OK
  if binary_name.endswith('.apk'):
    required_mode = os.R_OK
  for build_dir, build_type in path.GetBuildDirectories():
    candidate = os.path.join(chrome_root, build_dir, build_type, binary_name)
    if os.path.isfile(candidate) and os.access(candidate, required_mode):
      candidate_mtime = os.stat(candidate).st_mtime
      if candidate_mtime > command_mtime:
        command = candidate
        command_mtime = candidate_mtime
  return command

@decorators.Cache
def FindPath(binary_name, arch_name, platform_name):
  """Returns the path to the given binary name, pulling from the cloud if
  necessary."""
  if platform_name == 'win':
    binary_name += '.exe'
  command = FindLocallyBuiltPath(binary_name)
  if not command and _IsInCloudStorage(binary_name, arch_name, platform_name):
    cloud_storage.GetIfChanged(
        _GetBinPath(binary_name, arch_name, platform_name),
                    cloud_storage.PUBLIC_BUCKET)
    command = _GetBinPath(binary_name, arch_name, platform_name)

    # Ensure the downloaded file is actually executable.
    if command and os.path.exists(command):
      os.chmod(command,
               stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP)
  if not command and platform_name == 'win' and arch_name != 'AMD64':
    # This is an awful, awful hack to temporarily fix cloud_storage downloads
    # on XP until the binary_manager is finished and migrated to.
    # Please don't try this at home.
    return FindPath(binary_name, 'AMD64', platform_name)

  # Return an absolute path consistently.
  if command:
    command = os.path.abspath(command)
  return command


text:
<?php echo render('_parts/member_contents_box', array(
	'member'      => $thread->member,
	'id'          => $thread->id,
	'public_flag' => $thread->public_flag,
	'public_flag_option_type' => 'public',
	'model'       => 'thread',
	'size'        => 'M',
	'date'        => array(
		'datetime' => $thread->created_at,
		'label'    => term('form.create_simple', 'site.datetime'),
	)
)); ?>

<?php if (Auth::check()): ?>
<?php
$dropdown_btn_group_attr = array(
	'id' => 'btn_dropdown_'.$thread->id,
	'class' => array('dropdown', 'boxBtn', 'edit'),
);
$dropdown_btn_attr = array(
	'class' => 'js-dropdown_content_menu',
	'data-uri' => sprintf('thread/api/menu/%d.html?is_detail=1', $thread->id),
	'data-member_id' => $thread->member_id,
	'data-menu' => '#menu_'.$thread->id,
	'data-loaded' => 0,
);
echo btn_dropdown('noterm.dropdown', array(), false, 'xs', null, true, $dropdown_btn_group_attr, $dropdown_btn_attr, false);
?>
<?php endif; ?>


text:
Install with [npm](npmjs.org):

```
npm i {%= name %} --save-dev`
```

Install with [bower](https://github.com/bower/bower):

```
bower install {%= name %} --save-dev`
```

## Register the helper

The easiest way to register the helper with [Assemble](https://github.com/assemble/assemble) is to add the module to `devDependencies` and `keywords` in your project's package.json:

```json
{
  "devDependencies": {
    "{%= name %}": "*"
  },
  "keywords": [
    "{%= name %}"
  ]
}
```

Alternatively, to register the helper explicitly in the Gruntfile:

```javascript
grunt.initConfig({
  assemble: {
    options: {
      // the '{%= name %}' npm module must also be listed in
      // devDependencies for assemble to automatically resolve the helper
      helpers: ['{%= name %}', 'foo/*.js']
    },
    files: {
      'dist/': ['src/templates/*.hbs']
    }
  }
});
```


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="VI Assignment 1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
    <title>VI Assig 1 - Discussions</title>

    <meta name="mobile-web-app-capable" content="yes">
    <link rel="icon" sizes="192x192" href="images/android-desktop.png">

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Material Design Lite">
    <link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png">

    <meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
    <meta name="msapplication-TileColor" content="#3372DF">

    <link rel="shortcut icon" href="images/favicon.png">

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.cyan-light_blue.min.css">
    <link rel="stylesheet" href="styles.css">

          Home

              search

              <input class="mdl-textfield__input" type="text" id="search">
              Enter your query...

          <button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon" id="hdrbtn">
            more_vert
          </button>

Home

Helps

Discussion

About Project

            Guest

 Discussion

                     no discussions yet!

      Voltar


text:
function cXSDuration(nYear, nMonth, nDay, nHours, nMinutes, nSeconds, bNegative) {
	this.year	= nYear;
	this.month	= nMonth;
	this.day	= nDay;
	this.hours	= nHours;
	this.minutes	= nMinutes;
	this.seconds	= nSeconds;
	this.negative	= bNegative;
};

cXSDuration.prototype	= new cXSAnyAtomicType;
cXSDuration.prototype.builtInKind	= cXSConstants.DURATION_DT;
cXSDuration.prototype.primitiveKind	= cXSAnySimpleType.PRIMITIVE_DURATION;

cXSDuration.prototype.year		= null;
cXSDuration.prototype.month		= null;
cXSDuration.prototype.day		= null;
cXSDuration.prototype.hours		= null;
cXSDuration.prototype.minutes	= null;
cXSDuration.prototype.seconds	= null;
cXSDuration.prototype.negative	= null;

cXSDuration.prototype.toString	= function() {
	return (this.negative ? '-' : '') + 'P'
			+ ((fXSDuration_getYearMonthComponent(this) + fXSDuration_getDayTimeComponent(this)) || 'T0S');
};

var rXSDuration		= /^(-)?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:((?:(?:[0-9]+(?:.[0-9]*)?)|(?:.[0-9]+)))S)?)?$/;
cXSDuration.cast	= function(vValue) {
	if (vValue instanceof cXSYearMonthDuration)
		return new cXSDuration(vValue.year, vValue.month, 0, 0, 0, 0, vValue.negative);
	if (vValue instanceof cXSDayTimeDuration)
		return new cXSDuration(0, 0, vValue.day, vValue.hours, vValue.minutes, vValue.seconds, vValue.negative);
	if (vValue instanceof cXSDuration)
		return vValue;
	if (vValue instanceof cXSString || vValue instanceof cXSUntypedAtomic) {
		var aMatch	= fString_trim(vValue).match(rXSDuration);
		if (aMatch)
			return fXSDuration_normalize(new cXSDuration(+aMatch[2] || 0, +aMatch[3] || 0, +aMatch[4] || 0, +aMatch[5] || 0, +aMatch[6] || 0, +aMatch[7] || 0, aMatch[1] == '-'));
		throw new cException("FORG0001");
	}
	//
	throw new cException("XPTY0004"
//->Debug
			, "Casting value '" + vValue + "' to xs:duration can never succeed"
//<-Debug
	);
};

// Utilities
function fXSDuration_getYearMonthComponent(oDuration) {
	return (oDuration.year ? oDuration.year + 'Y' : '')
			+ (oDuration.month ? oDuration.month + 'M' : '');
};

function fXSDuration_getDayTimeComponent(oDuration) {
	return (oDuration.day ? oDuration.day + 'D' : '')
			+ (oDuration.hours || oDuration.minutes || oDuration.seconds
				? 'T'
					+ (oDuration.hours ? oDuration.hours + 'H' : '')
					+ (oDuration.minutes ? oDuration.minutes + 'M' : '')
					+ (oDuration.seconds ? oDuration.seconds + 'S' : '')
				: '');
};

function fXSDuration_normalize(oDuration) {
	return fXSYearMonthDuration_normalize(fXSDayTimeDuration_normalize(oDuration));
};

//
fStaticContext_defineSystemDataType("duration",	cXSDuration);


text:
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { switchMap } from 'rxjs/operators';

import { BackendResource } from '../decorators';
import { AsyncJob, Snapshot } from '../models';
import { AsyncJobService } from './async-job.service';
import { BaseBackendCachedService } from './base-backend-cached.service';
import { CSCommands } from './base-backend.service';
import { SnapshotTagService } from './tags/snapshot-tag.service';

@Injectable()
@BackendResource({
  entity: 'Snapshot',
})
export class SnapshotService extends BaseBackendCachedService<Snapshot> {
  constructor(
    private asyncJobService: AsyncJobService,
    private snapshotTagService: SnapshotTagService,
    protected http: HttpClient,
  ) {
    super(http);
  }

  public create(volumeId: string, name?: string, description?: string): Observable<Snapshot> {
    this.invalidateCache();

    const params = this.getSnapshotCreationParams(volumeId, name);
    return this.sendCommand(CSCommands.Create, params).pipe(
      switchMap(job => this.asyncJobService.queryJob(job, this.entity)),
      switchMap(snapshot => {
        if (description) {
          return this.snapshotTagService.setDescription(snapshot, description);
        }

        return of(snapshot);
      }),
    );
  }

  public markForRemoval(snapshot: Snapshot): Observable<Snapshot> {
    return this.snapshotTagService.markForRemoval(snapshot);
  }

  public remove(id: string): Observable<any> {
    this.invalidateCache();
    return this.sendCommand(CSCommands.Delete, { id }).pipe(
      switchMap(job => this.asyncJobService.queryJob(job.jobid, this.entity)),
    );
  }

  public revert(id: string): Observable<AsyncJob<Snapshot>> {
    return this.sendCommand(CSCommands.Revert, { id }).pipe(
      switchMap(job => this.asyncJobService.queryJob(job.jobid, this.entity)),
    );
  }

  public getList(volumeId?: string): Observable<Snapshot[]> {
    if (volumeId) {
      return super.getList({ volumeId });
    }
    return super.getList();
  }

  private getSnapshotCreationParams(volumeId: string, name?: string): any {
    if (name) {
      return {
        volumeId,
        name,
      };
    }

    return {
      volumeId,
    };
  }
}


text:
:host ::ng-deep  .p-frozen-column {
    font-weight: bold;
}
:host ::ng-deep .p-datatable-frozen-tbody {
    font-weight: bold;
}


text:
package com.castlemock.service.mock.soap.project.converter.types;

import java.util.Objects;
import java.util.Optional;

public final class PortTypeOperation {

    private final String name;
    private final PortTypeOperationInput input;
    private final PortTypeOperationOutput output;

    private PortTypeOperation(final Builder builder){
        this.name = Objects.requireNonNull(builder.name);
        this.input = builder.input;
        this.output = builder.output;
    }

    public String getName() {
        return name;
    }

    public Optional<PortTypeOperationInput> getInput() {
        return Optional.ofNullable(input);
    }

    public Optional<PortTypeOperationOutput> getOutput() {
        return Optional.ofNullable(output);
    }

    public static Builder builder(){
        return new Builder();
    }

    public static class Builder{

        private String name;
        private PortTypeOperationInput input;
        private PortTypeOperationOutput output;

        private Builder(){

        }

        public Builder name(final String name){
            this.name = name;
            return this;
        }

        public Builder input(final PortTypeOperationInput input){
            this.input = input;
            return this;
        }

        public Builder output(final PortTypeOperationOutput output){
            this.output = output;
            return this;
        }

        public PortTypeOperation build(){
            return new PortTypeOperation(this);
        }
    }

}


text:
package com.fortify.processrunner.util.map;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.support.StandardEvaluationContext;

/**
 * This class allows for building a {@link Map} based on configured
 * {@link IMapUpdater} instances.
 *
 * @author Ruud Senden
 *
 */
public class MapBuilder {
	private static final Log LOG = LogFactory.getLog(MapBuilder.class);
	private Collection<IMapUpdater> mapUpdaters = new ArrayList<IMapUpdater>();

	public <T extends Map<String, Object>> T build(T map) {
		for ( IMapUpdater mapUpdater : mapUpdaters ) {
			mapUpdater.updateMap(map);
		}
		if ( LOG.isDebugEnabled() ) {
			LOG.trace("[Process] Build object map: "+map);
		}
		return map;
	}

	public MapBuilder addMapUpdater(IMapUpdater mapUpdater) {
		mapUpdaters.add(mapUpdater);
		return this;
	}

	/**
	 * Interface for updating a given map.
	 *
	 */
	public static interface IMapUpdater {
		void updateMap(Map<String, Object> map);
	}

	public static abstract class AbstractMapUpdaterWithRootObject implements IMapUpdater {
		private Object rootObject;
		public Object getRootObject() { return rootObject; }
		public void setRootObject(Object rootObject) { this.rootObject = rootObject; }
		public final void updateMap(Map<String, Object> map) {
			Object rootObject = getRootObject();
			if ( rootObject != null ) {
				updateMap(map, rootObject);
			}
		}
		protected abstract void updateMap(Map<String, Object> map, Object rootObject);
	}

	public static abstract class AbstractMapUpdaterWithRootObjectAndExpressionMap extends AbstractMapUpdaterWithRootObject {
		private LinkedHashMap<String,? extends Expression> expressions;
		public LinkedHashMap<String,? extends Expression> getExpressions() { return expressions; }
		public void setExpressions(LinkedHashMap<String,? extends Expression> expressions) { this.expressions = expressions; }
		@Override
		protected final void updateMap(Map<String, Object> map, Object rootObject) {
			LinkedHashMap<String,? extends Expression> expressions = getExpressions();
			if ( expressions != null ) {
				for ( Map.Entry<String, ? extends Expression> entry : expressions.entrySet() ) {
					String key = entry.getKey();
					Expression expression = entry.getValue();
					if ( StringUtils.isNotBlank(key) && expression != null ) {
						Object value = getValue(map, key, rootObject, expression);
						map.put(key, value);
					}
				}
			}
		}
		protected abstract Object getValue(Map<String, Object> map, String key, Object rootObject, Expression expression);
	}

	public static class MapUpdaterPutValuesFromExpressionMap extends AbstractMapUpdaterWithRootObjectAndExpressionMap {
		private StandardEvaluationContext evaluationContext;
		public MapUpdaterPutValuesFromExpressionMap() {}
		public MapUpdaterPutValuesFromExpressionMap(StandardEvaluationContext evaluationContext, Object rootObject, LinkedHashMap<String, ? extends Expression> expressions) {
			setRootObject(rootObject);
			setExpressions(expressions);
			this.evaluationContext = evaluationContext;
		}
		@Override
		protected Object getValue(Map<String, Object> map, String key, Object rootObject, Expression expression) {
			return expression==null || rootObject==null ? null : expression.getValue(evaluationContext, rootObject);
		}
	}

	public static class MapUpdaterAppendValuesFromExpressionMap extends AbstractMapUpdaterWithRootObjectAndExpressionMap {
		private StandardEvaluationContext evaluationContext;
		public MapUpdaterAppendValuesFromExpressionMap() {}
		public MapUpdaterAppendValuesFromExpressionMap(StandardEvaluationContext evaluationContext, Object rootObject, LinkedHashMap<String, ? extends Expression> expressions) {
			setRootObject(rootObject);
			setExpressions(expressions);
			this.evaluationContext = evaluationContext;
		}
		@Override
		protected Object getValue(Map<String, Object> map, String key, Object rootObject, Expression expression) {
			Object value = map.get(key);
			if ( rootObject instanceof Iterable ) {
				value = appendValues(value, (Iterable<?>)rootObject, expression);
			} else {
				value = appendValue(value, rootObject, expression);
			}
			return value;
		}

		protected Object appendValues(Object value, Iterable<?> rootObjects, Expression expression) {
			for ( Object rootObject : rootObjects ) {
				value = appendValue(value, rootObject, expression);
			}
			return value;
		}

		@SuppressWarnings({ "rawtypes", "unchecked" })
		protected Object appendValue(Object value, Object rootObject, Expression expression) {
			Object valueToAppend = expression==null || rootObject==null ? null : expression.getValue(evaluationContext, rootObject);
			if ( value instanceof String ) {
				value = value+""+valueToAppend;
			} else if ( value instanceof Collection ) {
				((Collection)value).add(valueToAppend);
			}
			return value;
		}
	}

}


text:
package org.semanticweb.elk.reasoner.entailments.impl;

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

import org.semanticweb.elk.owl.interfaces.ElkDifferentIndividualsAxiom;
import org.semanticweb.elk.reasoner.entailments.model.DifferentIndividualsAxiomEntailment;
import org.semanticweb.elk.reasoner.entailments.model.DisjointClassesAxiomEntailment;
import org.semanticweb.elk.reasoner.entailments.model.EntailedDisjointClassesEntailsDifferentIndividualsAxiom;
import org.semanticweb.elk.reasoner.entailments.model.EntailmentInference;

public class EntailedDisjointClassesEntailsDifferentIndividualsAxiomImpl extends
		AbstractAxiomEntailmentInference<ElkDifferentIndividualsAxiom, DifferentIndividualsAxiomEntailment>
		implements EntailedDisjointClassesEntailsDifferentIndividualsAxiom {

	private final DisjointClassesAxiomEntailment premise_;

	public EntailedDisjointClassesEntailsDifferentIndividualsAxiomImpl(
			final DifferentIndividualsAxiomEntailment conclusion,
			final DisjointClassesAxiomEntailment premise) {
		super(conclusion);
		this.premise_ = premise;
	}

	@Override
	public List<? extends DisjointClassesAxiomEntailment> getPremises() {
		return Collections.singletonList(premise_);
	}

	@Override
	public <O> O accept(final EntailmentInference.Visitor<O> visitor) {
		return visitor.visit(this);
	}

}