text:
package org.apache.phoenix.compile;

import static org.apache.phoenix.util.TestUtil.PHOENIX_JDBC_URL;
import static org.junit.Assert.assertEquals;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSetMetaData;

import org.junit.Test;

import org.apache.phoenix.query.BaseConnectionlessQueryTest;
import org.apache.phoenix.util.TestUtil;

/**
 *
 * Tests for getting PreparedStatement meta data
 *
 *
 * @since 0.1
 */
public class QueryMetaDataTest extends BaseConnectionlessQueryTest {

    @Test
    public void testNoParameterMetaData() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE organization_id='000000000000000'";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(0, pmd.getParameterCount());
    }

    @Test
    public void testCaseInsensitive() throws Exception {
        String query = "SELECT A_string, b_striNG FROM ataBle WHERE ORGANIZATION_ID='000000000000000'";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(0, pmd.getParameterCount());
    }

    @Test
    public void testParameterMetaData() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE organization_id=? and (a_integer = ? or a_date = ? or b_string = ? or a_string = 'foo')";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(4, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(2));
        assertEquals(Date.class.getName(), pmd.getParameterClassName(3));
        assertEquals(String.class.getName(), pmd.getParameterClassName(4));
    }

    @Test
    public void testUpsertParameterMetaData() throws Exception {
        String query = "UPSERT INTO atable VALUES (?, ?, ?, ?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(5, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
        assertEquals(String.class.getName(), pmd.getParameterClassName(2));
        assertEquals(String.class.getName(), pmd.getParameterClassName(3));
        assertEquals(String.class.getName(), pmd.getParameterClassName(4));
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(5));
    }

    @Test
    public void testToDateFunctionMetaData() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE a_date > to_date(?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testLimitParameterMetaData() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE organization_id=? and a_string = 'foo' LIMIT ?";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(2));
    }

    @Test
    public void testRoundParameterMetaData() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE round(a_date,'day', ?) = ?";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Date.class.getName(), pmd.getParameterClassName(2));
    }

    @Test
    public void testInListParameterMetaData1() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE a_string IN (?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
        assertEquals(String.class.getName(), pmd.getParameterClassName(2));
    }

    @Test
    public void testInListParameterMetaData2() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE ? IN (2.2, 3)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(BigDecimal.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testInListParameterMetaData3() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE ? IN ('foo')";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testInListParameterMetaData4() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE ? IN (?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(3, pmd.getParameterCount());
        assertEquals(null, pmd.getParameterClassName(1));
        assertEquals(null, pmd.getParameterClassName(2));
        assertEquals(null, pmd.getParameterClassName(3));
    }

    @Test
    public void testCaseMetaData() throws Exception {
        String query1 = "SELECT a_string, b_string FROM atable WHERE case when a_integer = 1 then ? when a_integer > 2 then 2 end > 3";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query1);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(BigDecimal.class.getName(), pmd.getParameterClassName(1));
        assertEquals(ParameterMetaData.parameterNullable, pmd.isNullable(1));

        String query2 = "SELECT a_string, b_string FROM atable WHERE case when a_integer = 1 then 1 when a_integer > 2 then 2 end > ?";
        PreparedStatement statement2 = conn.prepareStatement(query2);
        ParameterMetaData pmd2 = statement2.getParameterMetaData();
        assertEquals(1, pmd2.getParameterCount());
        assertEquals(Integer.class.getName(), pmd2.getParameterClassName(1));
        assertEquals(ParameterMetaData.parameterNullable, pmd2.isNullable(1));
    }

    @Test
    public void testSubstrParameterMetaData() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE substr(a_string,?,?) = ?";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(3, pmd.getParameterCount());
        assertEquals(Long.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Long.class.getName(), pmd.getParameterClassName(2));
        assertEquals(String.class.getName(), pmd.getParameterClassName(3));
    }

    @Test
    public void testKeyPrefixParameterMetaData() throws Exception {
        String query = "SELECT a_string, b_string FROM atable WHERE organization_id='000000000000000' and substr(entity_id,1,3)=? and a_string = 'foo'";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testDateSubstractExpressionMetaData1() throws Exception {
        String query = "SELECT entity_id,a_string FROM atable where a_date-2.5-?=a_date";
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(BigDecimal.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testDateSubstractExpressionMetaData2() throws Exception {
        String query = "SELECT entity_id,a_string FROM atable where a_date-?=a_date";
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        // FIXME: Should really be Date, but we currently don't know if we're
        // comparing to a date or a number where this is being calculated
        // (which would disambiguate it).
        assertEquals(null, pmd.getParameterClassName(1));
    }

    @Test
    public void testDateSubstractExpressionMetaData3() throws Exception {
        String query = "SELECT entity_id,a_string FROM atable where a_date-?=a_integer";
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        // FIXME: Should really be Integer, but we currently don't know if we're
        // comparing to a date or a number where this is being calculated
        // (which would disambiguate it).
        assertEquals(null, pmd.getParameterClassName(1));
    }

    @Test
    public void testTwoDateSubstractExpressionMetaData() throws Exception {
        String query = "SELECT entity_id,a_string FROM atable where ?-a_date=1";
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        // We know this must be date - anything else would be an error
        assertEquals(Date.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testDateAdditionExpressionMetaData1() throws Exception {
        String query = "SELECT entity_id,a_string FROM atable where 1+a_date+?>a_date";
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(BigDecimal.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testDateAdditionExpressionMetaData2() throws Exception {
        String query = "SELECT entity_id,a_string FROM atable where ?+a_date>a_date";
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(1, pmd.getParameterCount());
        assertEquals(BigDecimal.class.getName(), pmd.getParameterClassName(1));
    }

    @Test
    public void testCoerceToDecimalArithmeticMetaData() throws Exception {
        String[] ops = { "+", "-", "*", "/" };
        for (String op : ops) {
            String query = "SELECT entity_id,a_string FROM atable where a_integer" + op + "2.5" + op + "?=0";
            Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setInt(1, 4);
            ParameterMetaData pmd = statement.getParameterMetaData();
            assertEquals(1, pmd.getParameterCount());
            assertEquals(BigDecimal.class.getName(), pmd.getParameterClassName(1));
        }
    }

    @Test
    public void testLongArithmeticMetaData() throws Exception {
        String[] ops = { "+", "-", "*", "/" };
        for (String op : ops) {
            String query = "SELECT entity_id,a_string FROM atable where a_integer" + op + "2" + op + "?=0";
            Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setInt(1, 4);
            ParameterMetaData pmd = statement.getParameterMetaData();
            assertEquals(1, pmd.getParameterCount());
            assertEquals(Long.class.getName(), pmd.getParameterClassName(1));
        }
    }

    @Test
    public void testBasicResultSetMetaData() throws Exception {
        String query = "SELECT organization_id, a_string, b_string, a_integer i, a_date FROM atable WHERE organization_id='000000000000000' and substr(entity_id,1,3)=? and a_string = 'foo'";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ResultSetMetaData md = statement.getMetaData();
        assertEquals(5, md.getColumnCount());

        assertEquals("organization_id".toUpperCase(),md.getColumnName(1));
        assertEquals("a_string".toUpperCase(),md.getColumnName(2));
        assertEquals("b_string".toUpperCase(),md.getColumnName(3));
        assertEquals("i".toUpperCase(),md.getColumnName(4));
        assertEquals("a_date".toUpperCase(),md.getColumnName(5));

        assertEquals(String.class.getName(),md.getColumnClassName(1));
        assertEquals(String.class.getName(),md.getColumnClassName(2));
        assertEquals(String.class.getName(),md.getColumnClassName(3));
        assertEquals(Integer.class.getName(),md.getColumnClassName(4));
        assertEquals(Date.class.getName(),md.getColumnClassName(5));

        assertEquals("atable".toUpperCase(),md.getTableName(1));
        assertEquals(java.sql.Types.INTEGER,md.getColumnType(4));
        assertEquals(true,md.isReadOnly(1));
        assertEquals(false,md.isDefinitelyWritable(1));
        assertEquals("i".toUpperCase(),md.getColumnLabel(4));
        assertEquals("a_date".toUpperCase(),md.getColumnLabel(5));
        assertEquals(ResultSetMetaData.columnNoNulls,md.isNullable(1));
        assertEquals(ResultSetMetaData.columnNullable,md.isNullable(5));
    }
    @Test
    public void testStringConcatMetaData() throws Exception {
    	String query = "SELECT entity_id,a_string FROM atable where 2 || a_integer || ? like '2%'";
    	Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
    	PreparedStatement statement = conn.prepareStatement(query);
    	statement.setString(1, "foo");
    	ParameterMetaData pmd = statement.getParameterMetaData();
    	assertEquals(1, pmd.getParameterCount());
    	assertEquals(String.class.getName(), pmd.getParameterClassName(1));

    }

    @Test
    public void testRowValueConstructorBindParamMetaData() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE (a_integer, x_integer, a_string) = (?, ?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(3, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(2));
        assertEquals(String.class.getName(), pmd.getParameterClassName(3));
    }

    @Test
    public void testRowValueConstructorBindParamMetaDataWithMoreNumberOfBindArgs() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE (a_integer, x_integer) = (?, ?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(3, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(2));
        assertEquals(null, pmd.getParameterClassName(3));
    }

    @Test
    public void testRowValueConstructorBindParamMetaDataWithLessNumberOfBindArgs() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE (a_integer, x_integer, a_string) = (?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(2));
    }

    @Test
    public void testRowValueConstructorBindParamMetaDataWithBindArgsAtSamePlacesOnLHSRHS() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE (a_integer, ?) = (a_integer, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(null, pmd.getParameterClassName(1));
        assertEquals(null, pmd.getParameterClassName(2));
    }

    @Test
    public void testRowValueConstructorBindParamMetaDataWithBindArgsAtDiffPlacesOnLHSRHS() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE (a_integer, ?) = (?, a_integer)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(2));
    }

    // @Test broken currently, as we'll end up with null = 7 which is never true
    public void testRowValueConstructorBindParamMetaDataWithBindArgsOnLHSAndLiteralExprOnRHS() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE (?, ?) = 7";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(null, pmd.getParameterClassName(2));
    }

    @Test
    public void testRowValueConstructorBindParamMetaDataWithBindArgsOnRHSAndLiteralExprOnLHS() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE 7 = (?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(null, pmd.getParameterClassName(2));
    }

    @Test
    public void testNonEqualityRowValueConstructorBindParamMetaDataWithBindArgsOnRHSAndLiteralExprOnLHS() throws Exception {
        String query = "SELECT a_integer, x_integer FROM aTable WHERE 7 >= (?, ?)";
        Connection conn = DriverManager.getConnection(getUrl(), TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(2, pmd.getParameterCount());
        assertEquals(Integer.class.getName(), pmd.getParameterClassName(1));
        assertEquals(null, pmd.getParameterClassName(2));
    }

    @Test
    public void testBindParamMetaDataForNestedRVC() throws Exception {
        String query = "SELECT organization_id, entity_id, a_string FROM aTable WHERE (organization_id, (entity_id, a_string)) >= (?, (?, ?))";
        Connection conn = DriverManager.getConnection(PHOENIX_JDBC_URL, TestUtil.TEST_PROPERTIES);
        PreparedStatement statement = conn.prepareStatement(query);
        ParameterMetaData pmd = statement.getParameterMetaData();
        assertEquals(3, pmd.getParameterCount());
        assertEquals(String.class.getName(), pmd.getParameterClassName(1));
        assertEquals(String.class.getName(), pmd.getParameterClassName(2));
        assertEquals(String.class.getName(), pmd.getParameterClassName(3));
    }
}


text:
"""
    diamond
    ~~~~~~~

    :copyright: (c) 2015 Jaco Ruit
    :license: MIT, see LICENSE for more details
"""

from queries import SelectQuery, EditQuery, AddQuery, RemoveQuery

class Diamond(object):
    def __init__(self, database):
        self.db = database
        self.debug = False

    def select(self, *args):
        return SelectQuery(self, list(args))

    def edit(self, modeltype):
        return EditQuery(self, modeltype)

    def add(self, modeltype):
        return AddQuery(self, modeltype)

    def remove(self, modeltype):
        return RemoveQuery(self, modeltype)

    def connect(self, credentials):
        self.db.connect(credentials)

    def close(self):
        self.db.close()

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Api.Interfaces;
using Api.Dto;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace ApiService.Controllers
{
    [Route("api/[controller]")]
    public class StudentController : Controller
    {
        private readonly IStudentManager _studentManager;

        public StudentController(IStudentManager studentManager)
        {
            _studentManager = studentManager;
        }

        // GET: api/values
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/values/5
        [HttpGet("{id}")]
        public StudentDto Get(string id)
        {
            return _studentManager.Get(id);
        }

        [HttpGet]
        [Route("list")]
        public List<StudentDto> GetList()
        {
            return _studentManager.GetList();
        }

        // POST api/values
        [HttpPost]
        public void Post([FromBody]StudentDto dto)
        {
            _studentManager.Add(dto);
        }

        // PUT api/values/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/values/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
}


text:
'use strict';

var util = require('util');
var msRest = require('ms-rest');
var WebResource = msRest.WebResource;

/**
 * @class
 * ArrayModel
 * __NOTE__: An instance of this class is automatically created for an
 * instance of the AutoRestComplexTestService.
 * Initializes a new instance of the ArrayModel class.
 * @constructor
 *
 * @param {AutoRestComplexTestService} client Reference to the service client.
 */
function ArrayModel(client) {
  this.client = client;
}

/**
 * Get complex types with array property
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object.
 *                      See {@link ArrayWrapper} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
ArrayModel.prototype.getValid = function (options, callback) {
  var client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }

  // Construct URL
  var baseUrl = this.client.baseUri;
  var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'complex/array/valid';

  // Create HTTP transport objects
  var httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.headers = {};
  httpRequest.url = requestUrl;
  // Set Headers
  if(options) {
    for(var headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, function (err, response, responseBody) {
    if (err) {
      return callback(err);
    }
    var statusCode = response.statusCode;
    if (statusCode !== 200) {
      var error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      var parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          var internalError = null;
          if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
          error.code = internalError ? internalError.code : parsedErrorResponse.code;
          error.message = internalError ? internalError.message : parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          var resultMapper = new client.models['ErrorModel']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = util.format('Error "%s" occurred in deserializing the responseBody ' +
                         '- "%s" for the default response.', defaultError.message, responseBody);
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    var result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      var parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          var resultMapper = new client.models['ArrayWrapper']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody));
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
};

/**
 * Put complex types with array property
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {array} [options.arrayProperty]
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
ArrayModel.prototype.putValid = function (options, callback) {
  var client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  var arrayProperty = (options && options.arrayProperty !== undefined) ? options.arrayProperty : undefined;
  // Validate
  try {
    if (util.isArray(arrayProperty)) {
      for (var i = 0; i < arrayProperty.length; i++) {
        if (arrayProperty[i] !== null && arrayProperty[i] !== undefined && typeof arrayProperty[i].valueOf() !== 'string') {
          throw new Error('arrayProperty[i] must be of type string.');
        }
      }
    }
  } catch (error) {
    return callback(error);
  }
  var complexBody;
  if (arrayProperty !== null && arrayProperty !== undefined) {
      complexBody = new client.models['ArrayWrapper']();
      complexBody.arrayProperty = arrayProperty;
  }

  // Construct URL
  var baseUrl = this.client.baseUri;
  var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'complex/array/valid';

  // Create HTTP transport objects
  var httpRequest = new WebResource();
  httpRequest.method = 'PUT';
  httpRequest.headers = {};
  httpRequest.url = requestUrl;
  // Set Headers
  if(options) {
    for(var headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  // Serialize Request
  var requestContent = null;
  var requestModel = null;
  try {
    if (complexBody !== null && complexBody !== undefined) {
      var requestModelMapper = new client.models['ArrayWrapper']().mapper();
      requestModel = client.serialize(requestModelMapper, complexBody, 'complexBody');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' +
        'payload - "%s"', error.message, util.inspect(complexBody, {depth: null})));
    return callback(serializationError);
  }
  httpRequest.body = requestContent;
  // Send Request
  return client.pipeline(httpRequest, function (err, response, responseBody) {
    if (err) {
      return callback(err);
    }
    var statusCode = response.statusCode;
    if (statusCode !== 200) {
      var error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      var parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          var internalError = null;
          if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
          error.code = internalError ? internalError.code : parsedErrorResponse.code;
          error.message = internalError ? internalError.message : parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          var resultMapper = new client.models['ErrorModel']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = util.format('Error "%s" occurred in deserializing the responseBody ' +
                         '- "%s" for the default response.', defaultError.message, responseBody);
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    var result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
};

/**
 * Get complex types with array property which is empty
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object.
 *                      See {@link ArrayWrapper} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
ArrayModel.prototype.getEmpty = function (options, callback) {
  var client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }

  // Construct URL
  var baseUrl = this.client.baseUri;
  var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'complex/array/empty';

  // Create HTTP transport objects
  var httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.headers = {};
  httpRequest.url = requestUrl;
  // Set Headers
  if(options) {
    for(var headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, function (err, response, responseBody) {
    if (err) {
      return callback(err);
    }
    var statusCode = response.statusCode;
    if (statusCode !== 200) {
      var error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      var parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          var internalError = null;
          if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
          error.code = internalError ? internalError.code : parsedErrorResponse.code;
          error.message = internalError ? internalError.message : parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          var resultMapper = new client.models['ErrorModel']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = util.format('Error "%s" occurred in deserializing the responseBody ' +
                         '- "%s" for the default response.', defaultError.message, responseBody);
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    var result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      var parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          var resultMapper = new client.models['ArrayWrapper']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody));
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
};

/**
 * Put complex types with array property which is empty
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {array} [options.arrayProperty]
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {null} [result]   - The deserialized result object.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
ArrayModel.prototype.putEmpty = function (options, callback) {
  var client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  var arrayProperty = (options && options.arrayProperty !== undefined) ? options.arrayProperty : undefined;
  // Validate
  try {
    if (util.isArray(arrayProperty)) {
      for (var i = 0; i < arrayProperty.length; i++) {
        if (arrayProperty[i] !== null && arrayProperty[i] !== undefined && typeof arrayProperty[i].valueOf() !== 'string') {
          throw new Error('arrayProperty[i] must be of type string.');
        }
      }
    }
  } catch (error) {
    return callback(error);
  }
  var complexBody;
  if (arrayProperty !== null && arrayProperty !== undefined) {
      complexBody = new client.models['ArrayWrapper']();
      complexBody.arrayProperty = arrayProperty;
  }

  // Construct URL
  var baseUrl = this.client.baseUri;
  var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'complex/array/empty';

  // Create HTTP transport objects
  var httpRequest = new WebResource();
  httpRequest.method = 'PUT';
  httpRequest.headers = {};
  httpRequest.url = requestUrl;
  // Set Headers
  if(options) {
    for(var headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  // Serialize Request
  var requestContent = null;
  var requestModel = null;
  try {
    if (complexBody !== null && complexBody !== undefined) {
      var requestModelMapper = new client.models['ArrayWrapper']().mapper();
      requestModel = client.serialize(requestModelMapper, complexBody, 'complexBody');
      requestContent = JSON.stringify(requestModel);
    }
  } catch (error) {
    var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' +
        'payload - "%s"', error.message, util.inspect(complexBody, {depth: null})));
    return callback(serializationError);
  }
  httpRequest.body = requestContent;
  // Send Request
  return client.pipeline(httpRequest, function (err, response, responseBody) {
    if (err) {
      return callback(err);
    }
    var statusCode = response.statusCode;
    if (statusCode !== 200) {
      var error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      var parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          var internalError = null;
          if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
          error.code = internalError ? internalError.code : parsedErrorResponse.code;
          error.message = internalError ? internalError.message : parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          var resultMapper = new client.models['ErrorModel']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = util.format('Error "%s" occurred in deserializing the responseBody ' +
                         '- "%s" for the default response.', defaultError.message, responseBody);
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    var result = null;
    if (responseBody === '') responseBody = null;

    return callback(null, result, httpRequest, response);
  });
};

/**
 * Get complex types with array property while server doesn't provide a
 * response payload
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object.
 *                      See {@link ArrayWrapper} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
ArrayModel.prototype.getNotProvided = function (options, callback) {
  var client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }

  // Construct URL
  var baseUrl = this.client.baseUri;
  var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'complex/array/notprovided';

  // Create HTTP transport objects
  var httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.headers = {};
  httpRequest.url = requestUrl;
  // Set Headers
  if(options) {
    for(var headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, function (err, response, responseBody) {
    if (err) {
      return callback(err);
    }
    var statusCode = response.statusCode;
    if (statusCode !== 200) {
      var error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      var parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          var internalError = null;
          if (parsedErrorResponse.error) internalError = parsedErrorResponse.error;
          error.code = internalError ? internalError.code : parsedErrorResponse.code;
          error.message = internalError ? internalError.message : parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          var resultMapper = new client.models['ErrorModel']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = util.format('Error "%s" occurred in deserializing the responseBody ' +
                         '- "%s" for the default response.', defaultError.message, responseBody);
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    var result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      var parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          var resultMapper = new client.models['ArrayWrapper']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody));
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
};

module.exports = ArrayModel;


text:
#ifndef EPD_H_
#define EPD_H_

#ifdef __cplusplus
extern "C" {
#endif

/*---------------------------------------------------------------------------*/
/* Type declarations                                                         */
/*---------------------------------------------------------------------------*/

/**
   @brief The type of extended precision floating-point numbers.
*/
typedef struct EpDoubleStruct EpDouble;

/*---------------------------------------------------------------------------*/
/* Function prototypes                                                       */
/*---------------------------------------------------------------------------*/

extern EpDouble *EpdAlloc(void);
extern int EpdCmp(const void *key1, const void *key2);
extern void EpdFree(EpDouble *epd);
extern void EpdGetString(EpDouble const *epd, char *str);
extern void EpdConvert(double value, EpDouble *epd);
extern void EpdMultiply(EpDouble *epd1, double value);
extern void EpdMultiply2(EpDouble *epd1, EpDouble const *epd2);
extern void EpdMultiply2Decimal(EpDouble *epd1, EpDouble const *epd2);
extern void EpdMultiply3(EpDouble const *epd1, EpDouble const *epd2, EpDouble *epd3);
extern void EpdMultiply3Decimal(EpDouble const *epd1, EpDouble const *epd2, EpDouble *epd3);
extern void EpdDivide(EpDouble *epd1, double value);
extern void EpdDivide2(EpDouble *epd1, EpDouble const *epd2);
extern void EpdDivide3(EpDouble const *epd1, EpDouble const *epd2, EpDouble *epd3);
extern void EpdAdd(EpDouble *epd1, double value);
extern void EpdAdd2(EpDouble *epd1, EpDouble const *epd2);
extern void EpdAdd3(EpDouble const *epd1, EpDouble const *epd2, EpDouble *epd3);
extern void EpdSubtract(EpDouble *epd1, double value);
extern void EpdSubtract2(EpDouble *epd1, EpDouble const *epd2);
extern void EpdSubtract3(EpDouble const *epd1, EpDouble const *epd2, EpDouble *epd3);
extern void EpdPow2(int n, EpDouble *epd);
extern void EpdPow2Decimal(int n, EpDouble *epd);
extern void EpdNormalize(EpDouble *epd);
extern void EpdNormalizeDecimal(EpDouble *epd);
extern void EpdGetValueAndDecimalExponent(EpDouble const *epd, double *value, int *exponent);
extern int EpdGetExponent(double value);
extern int EpdGetExponentDecimal(double value);
extern void EpdMakeInf(EpDouble *epd, int sign);
extern void EpdMakeZero(EpDouble *epd, int sign);
extern void EpdMakeNan(EpDouble *epd);
extern void EpdCopy(EpDouble const *from, EpDouble *to);
extern int EpdIsInf(EpDouble const *epd);
extern int EpdIsZero(EpDouble const *epd);
extern int EpdIsNan(EpDouble const *epd);
extern int EpdIsNanOrInf(EpDouble const *epd);
extern int IsInfDouble(double value);
extern int IsNanDouble(double value);
extern int IsNanOrInfDouble(double value);

#ifdef __cplusplus
}
#endif

#endif /* EPD_H_ */


text:
using System;
using System.Collections;

using Org.BouncyCastle.Utilities;
using Org.BouncyCastle.Utilities.Collections;
using Org.BouncyCastle.Utilities.Date;
using Org.BouncyCastle.X509.Store;

namespace Org.BouncyCastle.Pkix
{
	///
	/// Summary description for PkixParameters.
	///
	public class PkixParameters
//		: ICertPathParameters
	{
		/**
		* This is the default PKIX validity model. Actually there are two variants
		* of this: The PKIX model and the modified PKIX model. The PKIX model
		* verifies that all involved certificates must have been valid at the
		* current time. The modified PKIX model verifies that all involved
		* certificates were valid at the signing time. Both are indirectly choosen
		* with the {@link PKIXParameters#setDate(java.util.Date)} method, so this
		* methods sets the Date when all certificates must have been
		* valid.
		*/
		public const int PkixValidityModel = 0;

		/**
		* This model uses the following validity model. Each certificate must have
		* been valid at the moment where is was used. That means the end
		* certificate must have been valid at the time the signature was done. The
		* CA certificate which signed the end certificate must have been valid,
		* when the end certificate was signed. The CA (or Root CA) certificate must
		* have been valid, when the CA certificate was signed and so on. So the
		* {@link PKIXParameters#setDate(java.util.Date)} method sets the time, when
		* the end certificate must have been valid.
 It is used e.g.
		* in the German signature law.
		*/
		public const int ChainValidityModel = 1;

		private ISet trustAnchors;
		private DateTimeObject date;
		private IList certPathCheckers;
		private bool revocationEnabled = true;
		private ISet initialPolicies;
		//private bool checkOnlyEECertificateCrl = false;
		private bool explicitPolicyRequired = false;
		private bool anyPolicyInhibited = false;
		private bool policyMappingInhibited = false;
		private bool policyQualifiersRejected = true;
		private IX509Selector certSelector;
		private IList stores;
		private IX509Selector selector;
		private bool additionalLocationsEnabled;
		private IList additionalStores;
		private ISet trustedACIssuers;
		private ISet necessaryACAttributes;
		private ISet prohibitedACAttributes;
		private ISet attrCertCheckers;
		private int validityModel = PkixValidityModel;
		private bool useDeltas = false;

		/**
		 * Creates an instance of PKIXParameters with the specified Set of
		 * most-trusted CAs. Each element of the set is a TrustAnchor.

		 *

		 * Note that the Set is copied to protect against subsequent modifications.
		 *
		 * @param trustAnchors
		 *            a Set of TrustAnchors
		 *
		 * @exception InvalidAlgorithmParameterException
		 *                if the specified Set is empty
		 *                (trustAnchors.isEmpty() == true)
		 * @exception NullPointerException
		 *                if the specified Set is null
		 * @exception ClassCastException
		 *                if any of the elements in the Set are not of type
		 *                java.security.cert.TrustAnchor
		 */
		public PkixParameters(
			ISet trustAnchors)
		{
			SetTrustAnchors(trustAnchors);

			this.initialPolicies = new HashSet();
			this.certPathCheckers = Platform.CreateArrayList();
            this.stores = Platform.CreateArrayList();
			this.additionalStores = Platform.CreateArrayList();
			this.trustedACIssuers = new HashSet();
			this.necessaryACAttributes = new HashSet();
			this.prohibitedACAttributes = new HashSet();
			this.attrCertCheckers = new HashSet();
		}

//		// TODO implement for other keystores (see Java build)?
//		/**
//		 * Creates an instance of PKIXParameters that
//		 * populates the set of most-trusted CAs from the trusted
//		 * certificate entries contained in the specified KeyStore.
//		 * Only keystore entries that contain trusted X509Certificates
//		 * are considered; all other certificate types are ignored.
//		 *
//		 * @param keystore a KeyStore from which the set of
//		 * most-trusted CAs will be populated
//		 * @throws KeyStoreException if the keystore has not been initialized
//		 * @throws InvalidAlgorithmParameterException if the keystore does
//		 * not contain at least one trusted certificate entry
//		 * @throws NullPointerException if the keystore is null
//		 */
//		public PkixParameters(
//			Pkcs12Store keystore)
////			throws KeyStoreException, InvalidAlgorithmParameterException
//		{
//			if (keystore == null)
//				throw new ArgumentNullException("keystore");
//			ISet trustAnchors = new HashSet();
//			foreach (string alias in keystore.Aliases)
//			{
//				if (keystore.IsCertificateEntry(alias))
//				{
//					X509CertificateEntry x509Entry = keystore.GetCertificate(alias);
//					trustAnchors.Add(new TrustAnchor(x509Entry.Certificate, null));
//				}
//			}
//			SetTrustAnchors(trustAnchors);
//
//			this.initialPolicies = new HashSet();
//			this.certPathCheckers = new ArrayList();
//			this.stores = new ArrayList();
//			this.additionalStores = new ArrayList();
//			this.trustedACIssuers = new HashSet();
//			this.necessaryACAttributes = new HashSet();
//			this.prohibitedACAttributes = new HashSet();
//			this.attrCertCheckers = new HashSet();
//		}

		public virtual bool IsRevocationEnabled
		{
			get { return revocationEnabled; }
			set { revocationEnabled = value; }
		}

		public virtual bool IsExplicitPolicyRequired
		{
			get { return explicitPolicyRequired; }
			set { this.explicitPolicyRequired = value; }
		}

		public virtual bool IsAnyPolicyInhibited
		{
			get { return anyPolicyInhibited; }
			set { this.anyPolicyInhibited = value; }
		}

		public virtual bool IsPolicyMappingInhibited
		{
			get { return policyMappingInhibited; }
			set { this.policyMappingInhibited = value; }
		}

		public virtual bool IsPolicyQualifiersRejected
		{
			get { return policyQualifiersRejected; }
			set { this.policyQualifiersRejected = value; }
		}

		//public bool IsCheckOnlyEECertificateCrl
		//{
		//	get { return this.checkOnlyEECertificateCrl; }
		//	set { this.checkOnlyEECertificateCrl = value; }
		//}

		public virtual DateTimeObject Date
		{
			get { return this.date; }
			set { this.date = value; }
		}

		// Returns a Set of the most-trusted CAs.
		public virtual ISet GetTrustAnchors()
		{
			return new HashSet(this.trustAnchors);
		}

		// Sets the set of most-trusted CAs.
		// Set is copied to protect against subsequent modifications.
		public virtual void SetTrustAnchors(
			ISet tas)
		{
			if (tas == null)
				throw new ArgumentNullException("value");
			if (tas.IsEmpty)
				throw new ArgumentException(@"non-empty set required", "value");

			// Explicit copy to enforce type-safety
			this.trustAnchors = new HashSet();
			foreach (TrustAnchor ta in tas)
			{
				if (ta != null)
				{
					trustAnchors.Add(ta);
				}
			}
		}

		/**
		* Returns the required constraints on the target certificate. The
		* constraints are returned as an instance of CertSelector. If
		* null, no constraints are defined.

		*

		* Note that the CertSelector returned is cloned to protect against
		* subsequent modifications.
		*
		* @return a CertSelector specifying the constraints on the target
		*         certificate (or null)
		*
		* @see #setTargetCertConstraints(CertSelector)
		*/
		public virtual X509CertStoreSelector GetTargetCertConstraints()
		{
			if (certSelector == null)
			{
				return null;
			}

			return (X509CertStoreSelector)certSelector.Clone();
		}

		/**
		 * Sets the required constraints on the target certificate. The constraints
		 * are specified as an instance of CertSelector. If null, no constraints are
		 * defined.

		 *

		 * Note that the CertSelector specified is cloned to protect against
		 * subsequent modifications.
		 *
		 * @param selector
		 *            a CertSelector specifying the constraints on the target
		 *            certificate (or null)
		 *
		 * @see #getTargetCertConstraints()
		 */
		public virtual void SetTargetCertConstraints(
			IX509Selector selector)
		{
			if (selector == null)
			{
				certSelector = null;
			}
			else
			{
				certSelector = (IX509Selector)selector.Clone();
			}
		}

		/**
		* Returns an immutable Set of initial policy identifiers (OID strings),
		* indicating that any one of these policies would be acceptable to the
		* certificate user for the purposes of certification path processing. The
		* default return value is an empty Set, which is
		* interpreted as meaning that any policy would be acceptable.
		*
		* @return an immutable Set of initial policy OIDs in String
		*         format, or an empty Set (implying any policy is
		*         acceptable). Never returns null.
		*
		* @see #setInitialPolicies(java.util.Set)
		*/
		public virtual ISet GetInitialPolicies()
		{
			ISet returnSet = initialPolicies;

			// TODO Can it really be null?
			if (initialPolicies == null)
			{
				returnSet = new HashSet();
			}

			return new HashSet(returnSet);
		}

		/**
		* Sets the Set of initial policy identifiers (OID strings),
		* indicating that any one of these policies would be acceptable to the
		* certificate user for the purposes of certification path processing. By
		* default, any policy is acceptable (i.e. all policies), so a user that
		* wants to allow any policy as acceptable does not need to call this
		* method, or can call it with an empty Set (or
		* null).

		*

		* Note that the Set is copied to protect against subsequent modifications.

		*

		*
		* @param initialPolicies
		*            a Set of initial policy OIDs in String format (or
		*            null)
		*
		* @exception ClassCastException
		*                if any of the elements in the set are not of type String
		*
		* @see #getInitialPolicies()
		*/
		public virtual void SetInitialPolicies(
			ISet initialPolicies)
		{
			this.initialPolicies = new HashSet();
			if (initialPolicies != null)
			{
				foreach (string obj in initialPolicies)
				{
					if (obj != null)
					{
						this.initialPolicies.Add(obj);
					}
				}
			}
		}

		/**
		* Sets a List of additional certification path checkers. If
		* the specified List contains an object that is not a PKIXCertPathChecker,
		* it is ignored.

		*

		* Each PKIXCertPathChecker specified implements additional
		* checks on a certificate. Typically, these are checks to process and
		* verify private extensions contained in certificates. Each
		* PKIXCertPathChecker should be instantiated with any
		* initialization parameters needed to execute the check.

		*

		* This method allows sophisticated applications to extend a PKIX
		* CertPathValidator or CertPathBuilder. Each
		* of the specified PKIXCertPathCheckers will be called, in turn, by a PKIX
		* CertPathValidator or CertPathBuilder for
		* each certificate processed or validated.

		*

		* Regardless of whether these additional PKIXCertPathCheckers are set, a
		* PKIX CertPathValidator or CertPathBuilder
		* must perform all of the required PKIX checks on each certificate. The one
		* exception to this rule is if the RevocationEnabled flag is set to false
		* (see the {@link #setRevocationEnabled(boolean) setRevocationEnabled}
		* method).

		*

		* Note that the List supplied here is copied and each PKIXCertPathChecker
		* in the list is cloned to protect against subsequent modifications.
		*
		* @param checkers
		*            a List of PKIXCertPathCheckers. May be null, in which case no
		*            additional checkers will be used.
		* @exception ClassCastException
		*                if any of the elements in the list are not of type
		*                java.security.cert.PKIXCertPathChecker
		* @see #getCertPathCheckers()
		*/
		public virtual void SetCertPathCheckers(IList checkers)
		{
            certPathCheckers = Platform.CreateArrayList();
			if (checkers != null)
			{
				foreach (PkixCertPathChecker obj in checkers)
				{
					certPathCheckers.Add(obj.Clone());
				}
			}
		}

		/**
		 * Returns the List of certification path checkers. Each PKIXCertPathChecker
		 * in the returned IList is cloned to protect against subsequent modifications.
		 *
		 * @return an immutable List of PKIXCertPathCheckers (may be empty, but not
		 *         null)
		 *
		 * @see #setCertPathCheckers(java.util.List)
		 */
		public virtual IList GetCertPathCheckers()
		{
			IList checkers = Platform.CreateArrayList();
			foreach (PkixCertPathChecker obj in certPathCheckers)
			{
				checkers.Add(obj.Clone());
			}
			return checkers;
		}

		/**
		 * Adds a PKIXCertPathChecker to the list of certification
		 * path checkers. See the {@link #setCertPathCheckers setCertPathCheckers}
		 * method for more details.
		 *

		 * Note that the PKIXCertPathChecker is cloned to protect
		 * against subsequent modifications.

		 *
		 * @param checker a PKIXCertPathChecker to add to the list of
		 * checks. If null, the checker is ignored (not added to list).
		 */
		public virtual void AddCertPathChecker(
			PkixCertPathChecker checker)
		{
			if (checker != null)
			{
				certPathCheckers.Add(checker.Clone());
			}
		}

		public virtual object Clone()
		{
			// FIXME Check this whole method against the Java implementation!

			PkixParameters parameters = new PkixParameters(GetTrustAnchors());
			parameters.SetParams(this);
			return parameters;

//			PkixParameters obj = new PkixParameters(new HashSet());
////			(PkixParameters) this.MemberwiseClone();
//			obj.x509Stores = new ArrayList(x509Stores);
//			obj.certPathCheckers = new ArrayList(certPathCheckers);
//
//			//Iterator iter = certPathCheckers.iterator();
//			//obj.certPathCheckers = new ArrayList();
//			//while (iter.hasNext())
//			//{
//			//	obj.certPathCheckers.add(((PKIXCertPathChecker)iter.next())
//			//		.clone());
//			//}
//			//if (initialPolicies != null)
//			//{
//			//	obj.initialPolicies = new HashSet(initialPolicies);
//			//}
////			if (trustAnchors != null)
////			{
////				obj.trustAnchors = new HashSet(trustAnchors);
////			}
////			if (certSelector != null)
////			{
////				obj.certSelector = (X509CertStoreSelector) certSelector.Clone();
////			}
//			return obj;
		}

		/**
		* Method to support Clone() under J2ME.
		* super.Clone() does not exist and fields are not copied.
		*
		* @param params Parameters to set. If this are
		*            ExtendedPkixParameters they are copied to.
		*/
		protected virtual void SetParams(
			PkixParameters parameters)
		{
			Date = parameters.Date;
			SetCertPathCheckers(parameters.GetCertPathCheckers());
			IsAnyPolicyInhibited = parameters.IsAnyPolicyInhibited;
			IsExplicitPolicyRequired = parameters.IsExplicitPolicyRequired;
			IsPolicyMappingInhibited = parameters.IsPolicyMappingInhibited;
			IsRevocationEnabled = parameters.IsRevocationEnabled;
			SetInitialPolicies(parameters.GetInitialPolicies());
			IsPolicyQualifiersRejected = parameters.IsPolicyQualifiersRejected;
			SetTargetCertConstraints(parameters.GetTargetCertConstraints());
			SetTrustAnchors(parameters.GetTrustAnchors());

			validityModel = parameters.validityModel;
			useDeltas = parameters.useDeltas;
			additionalLocationsEnabled = parameters.additionalLocationsEnabled;
			selector = parameters.selector == null ? null
				: (IX509Selector) parameters.selector.Clone();
			stores = Platform.CreateArrayList(parameters.stores);
            additionalStores = Platform.CreateArrayList(parameters.additionalStores);
			trustedACIssuers = new HashSet(parameters.trustedACIssuers);
			prohibitedACAttributes = new HashSet(parameters.prohibitedACAttributes);
			necessaryACAttributes = new HashSet(parameters.necessaryACAttributes);
			attrCertCheckers = new HashSet(parameters.attrCertCheckers);
		}

		/**
		 * Whether delta CRLs should be used for checking the revocation status.
		 * Defaults to false.
		 */
		public virtual bool IsUseDeltasEnabled
		{
			get { return useDeltas; }
			set { useDeltas = value; }
		}

		/**
		* The validity model.
		* @see #CHAIN_VALIDITY_MODEL
		* @see #PKIX_VALIDITY_MODEL
		*/
		public virtual int ValidityModel
		{
			get { return validityModel; }
			set { validityModel = value; }
		}

		/**
		* Sets the Bouncy Castle Stores for finding CRLs, certificates, attribute
		* certificates or cross certificates.
		*

		* The IList is cloned.
		*

		*
		* @param stores A list of stores to use.
		* @see #getStores
		* @throws ClassCastException if an element of stores is not
		*             a {@link Store}.
		*/
		public virtual void SetStores(
			IList stores)
		{
			if (stores == null)
			{
                this.stores = Platform.CreateArrayList();
			}
			else
			{
				foreach (object obj in stores)
				{
					if (!(obj is IX509Store))
					{
						throw new InvalidCastException(
							"All elements of list must be of type " + typeof(IX509Store).FullName);
					}
				}
                this.stores = Platform.CreateArrayList(stores);
			}
		}

		/**
		* Adds a Bouncy Castle {@link Store} to find CRLs, certificates, attribute
		* certificates or cross certificates.
		*

		* This method should be used to add local stores, like collection based
		* X.509 stores, if available. Local stores should be considered first,
		* before trying to use additional (remote) locations, because they do not
		* need possible additional network traffic.
		*

		* If store is null it is ignored.
		*

		*
		* @param store The store to add.
		* @see #getStores
		*/
		public virtual void AddStore(
			IX509Store store)
		{
			if (store != null)
			{
				stores.Add(store);
			}
		}

		/**
		* Adds an additional Bouncy Castle {@link Store} to find CRLs, certificates,
		* attribute certificates or cross certificates.
		*

		* You should not use this method. This method is used for adding additional
		* X.509 stores, which are used to add (remote) locations, e.g. LDAP, found
		* during X.509 object processing, e.g. in certificates or CRLs. This method
		* is used in PKIX certification path processing.
		*

		* If store is null it is ignored.
		*

		*
		* @param store The store to add.
		* @see #getStores()
		*/
		public virtual void AddAdditionalStore(
			IX509Store store)
		{
			if (store != null)
			{
				additionalStores.Add(store);
			}
		}

		/**
		* Returns an IList of additional Bouncy Castle
		* Stores used for finding CRLs, certificates, attribute
		* certificates or cross certificates.
		*
		* @return an immutable IList of additional Bouncy Castle
		*         Stores. Never null.
		*
		* @see #addAddionalStore(Store)
		*/
		public virtual IList GetAdditionalStores()
		{
            return Platform.CreateArrayList(additionalStores);
		}

		/**
		* Returns an IList of Bouncy Castle
		* Stores used for finding CRLs, certificates, attribute
		* certificates or cross certificates.
		*
		* @return an immutable IList of Bouncy Castle
		*         Stores. Never null.
		*
		* @see #setStores(IList)
		*/
		public virtual IList GetStores()
		{
            return Platform.CreateArrayList(stores);
		}

		/**
		* Returns if additional {@link X509Store}s for locations like LDAP found
		* in certificates or CRLs should be used.
		*
		* @return Returns true if additional stores are used.
		*/
		public virtual bool IsAdditionalLocationsEnabled
		{
			get { return additionalLocationsEnabled; }
		}

		/**
		* Sets if additional {@link X509Store}s for locations like LDAP found in
		* certificates or CRLs should be used.
		*
		* @param enabled true if additional stores are used.
		*/
		public virtual void SetAdditionalLocationsEnabled(
			bool enabled)
		{
			additionalLocationsEnabled = enabled;
		}

		/**
		* Returns the required constraints on the target certificate or attribute
		* certificate. The constraints are returned as an instance of
		* IX509Selector. If null, no constraints are
		* defined.
		*
		*

		* The target certificate in a PKIX path may be a certificate or an
		* attribute certificate.
		*

		* Note that the IX509Selector returned is cloned to protect
		* against subsequent modifications.
		*

		* @return a IX509Selector specifying the constraints on the
		*         target certificate or attribute certificate (or null)
		* @see #setTargetConstraints
		* @see X509CertStoreSelector
		* @see X509AttributeCertStoreSelector
		*/
		public virtual IX509Selector GetTargetConstraints()
		{
			if (selector != null)
			{
				return (IX509Selector) selector.Clone();
			}
			else
			{
				return null;
			}
		}

		/**
		* Sets the required constraints on the target certificate or attribute
		* certificate. The constraints are specified as an instance of
		* IX509Selector. If null, no constraints are
		* defined.
		*

		* The target certificate in a PKIX path may be a certificate or an
		* attribute certificate.
		*

		* Note that the IX509Selector specified is cloned to protect
		* against subsequent modifications.
		*

		*
		* @param selector a IX509Selector specifying the constraints on
		*            the target certificate or attribute certificate (or
		*            null)
		* @see #getTargetConstraints
		* @see X509CertStoreSelector
		* @see X509AttributeCertStoreSelector
		*/
		public virtual void SetTargetConstraints(IX509Selector selector)
		{
			if (selector != null)
			{
				this.selector = (IX509Selector) selector.Clone();
			}
			else
			{
				this.selector = null;
			}
		}

		/**
		* Returns the trusted attribute certificate issuers. If attribute
		* certificates is verified the trusted AC issuers must be set.
		*

		* The returned ISet consists of TrustAnchors.
		*

		* The returned ISet is immutable. Never null
		*

		*
		* @return Returns an immutable set of the trusted AC issuers.
		*/
		public virtual ISet GetTrustedACIssuers()
		{
			return new HashSet(trustedACIssuers);
		}

		/**
		* Sets the trusted attribute certificate issuers. If attribute certificates
		* is verified the trusted AC issuers must be set.
		*

		* The trustedACIssuers must be a ISet of
		* TrustAnchor
		*

		* The given set is cloned.
		*

		*
		* @param trustedACIssuers The trusted AC issuers to set. Is never
		*            null.
		* @throws ClassCastException if an element of stores is not
		*             a TrustAnchor.
		*/
		public virtual void SetTrustedACIssuers(
			ISet trustedACIssuers)
		{
			if (trustedACIssuers == null)
			{
				this.trustedACIssuers = new HashSet();
			}
			else
			{
				foreach (object obj in trustedACIssuers)
				{
					if (!(obj is TrustAnchor))
					{
						throw new InvalidCastException("All elements of set must be "
							+ "of type " + typeof(TrustAnchor).Name + ".");
					}
				}
				this.trustedACIssuers = new HashSet(trustedACIssuers);
			}
		}

		/**
		* Returns the neccessary attributes which must be contained in an attribute
		* certificate.
		*

		* The returned ISet is immutable and contains
		* Strings with the OIDs.
		*

		*
		* @return Returns the necessary AC attributes.
		*/
		public virtual ISet GetNecessaryACAttributes()
		{
			return new HashSet(necessaryACAttributes);
		}

		/**
		* Sets the neccessary which must be contained in an attribute certificate.
		*

		* The ISet must contain Strings with the
		* OIDs.
		*

		* The set is cloned.
		*

		*
		* @param necessaryACAttributes The necessary AC attributes to set.
		* @throws ClassCastException if an element of
		*             necessaryACAttributes is not a
		*             String.
		*/
		public virtual void SetNecessaryACAttributes(
			ISet necessaryACAttributes)
		{
			if (necessaryACAttributes == null)
			{
				this.necessaryACAttributes = new HashSet();
			}
			else
			{
				foreach (object obj in necessaryACAttributes)
				{
					if (!(obj is string))
					{
						throw new InvalidCastException("All elements of set must be "
							+ "of type string.");
					}
				}
				this.necessaryACAttributes = new HashSet(necessaryACAttributes);
			}
		}

		/**
		* Returns the attribute certificates which are not allowed.
		*

		* The returned ISet is immutable and contains
		* Strings with the OIDs.
		*

		*
		* @return Returns the prohibited AC attributes. Is never null.
		*/
		public virtual ISet GetProhibitedACAttributes()
		{
			return new HashSet(prohibitedACAttributes);
		}

		/**
		* Sets the attribute certificates which are not allowed.
		*

		* The ISet must contain Strings with the
		* OIDs.
		*

		* The set is cloned.
		*

		*
		* @param prohibitedACAttributes The prohibited AC attributes to set.
		* @throws ClassCastException if an element of
		*             prohibitedACAttributes is not a
		*             String.
		*/
		public virtual void SetProhibitedACAttributes(
			ISet prohibitedACAttributes)
		{
			if (prohibitedACAttributes == null)
			{
				this.prohibitedACAttributes = new HashSet();
			}
			else
			{
				foreach (object obj in prohibitedACAttributes)
				{
					if (!(obj is String))
					{
						throw new InvalidCastException("All elements of set must be "
							+ "of type string.");
					}
				}
				this.prohibitedACAttributes = new HashSet(prohibitedACAttributes);
			}
		}

		/**
		* Returns the attribute certificate checker. The returned set contains
		* {@link PKIXAttrCertChecker}s and is immutable.
		*
		* @return Returns the attribute certificate checker. Is never
		*         null.
		*/
		public virtual ISet GetAttrCertCheckers()
		{
			return new HashSet(attrCertCheckers);
		}

		/**
		* Sets the attribute certificate checkers.
		*

		* All elements in the ISet must a {@link PKIXAttrCertChecker}.
		*

		*

		* The given set is cloned.
		*

		*
		* @param attrCertCheckers The attribute certificate checkers to set. Is
		*            never null.
		* @throws ClassCastException if an element of attrCertCheckers
		*             is not a PKIXAttrCertChecker.
		*/
		public virtual void SetAttrCertCheckers(
			ISet attrCertCheckers)
		{
			if (attrCertCheckers == null)
			{
				this.attrCertCheckers = new HashSet();
			}
			else
			{
				foreach (object obj in attrCertCheckers)
				{
					if (!(obj is PkixAttrCertChecker))
					{
						throw new InvalidCastException("All elements of set must be "
							+ "of type " + typeof(PkixAttrCertChecker).FullName + ".");
					}
				}
				this.attrCertCheckers = new HashSet(attrCertCheckers);
			}
		}
	}
}


text:
A collection of scripts to calculate the signal to noise ratio. Filteres were applied to the image in interactive mode to compare different modes.
Written in python3.


text:
package org.apache.zeppelin.kotlin.reflect;

import static org.apache.zeppelin.kotlin.reflect.KotlinReflectUtil.shorten;
import kotlin.reflect.KProperty;

public class KotlinVariableInfo {
  private final Object value;
  private final KProperty<?> descriptor;

  public KotlinVariableInfo(Object value, KProperty<?> descriptor) {
    this.value = value;
    this.descriptor = descriptor;
  }

  public Object getValue() {
    return value;
  }

  public KProperty<?> getDescriptor() {
    return descriptor;
  }

  public String getName() {
    return descriptor.getName();
  }

  public String getType() {
    return descriptor.getReturnType().toString();
  }

  public String toString(boolean shortenTypes) {
    String type = getType();
    if (shortenTypes) {
      type = shorten(type);
    }
    return getName() + ": " + type + " = " + getValue();
  }

  @Override
  public String toString() {
    return toString(false);
  }
}


text:
import * as React from 'react';

export interface ProgressSpinnerProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
    strokeWidth?: string;
    fill?: string;
    animationDuration?: string;
    children?: React.ReactNode;
}

export declare class ProgressSpinner extends React.Component<ProgressSpinnerProps, any> {
    public getElement(): HTMLDivElement;
}


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>com.communote.server.core.security.authentication.confluence Class Hierarchy (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<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

Next

Frames

No Frames

All Classes

Hierarchy For Package com.communote.server.core.security.authentication.confluence

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

org.springframework.security.authentication.AbstractAuthenticationToken (implements org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer)

com.communote.server.core.security.authentication.AbstractCommunoteAuthenticationToken<T>

com.communote.server.core.security.authentication.confluence.ConfluenceAuthenticationToken

com.communote.server.core.security.authentication.BaseCommunoteAuthenticationProvider (implements org.springframework.security.authentication.AuthenticationProvider)

com.communote.server.core.security.authentication.ExternalAuthenticationProvider

com.communote.server.core.security.authentication.confluence.ConfluenceAuthenticationProvider

com.communote.server.core.security.authentication.confluence.ConfluenceAuthenticationRequest (implements com.communote.server.core.security.authentication.AuthenticationRequest)

com.communote.server.core.security.authentication.confluence.ConfluenceTokenFactory (implements com.communote.server.core.security.authentication.TokenFactory<T>)

com.communote.server.core.security.authentication.ExternalKenmeiApiAuthenticator<R>

com.communote.server.core.security.authentication.confluence.ConfluenceAuthenticator

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2019 Communote team. All rights reserved.


text:
package com.hubspot.smtp.client;

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

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.DecoderException;
import io.netty.handler.codec.LineBasedFrameDecoder;
import io.netty.handler.codec.smtp.DefaultSmtpResponse;
import io.netty.handler.codec.smtp.SmtpResponse;
import io.netty.util.CharsetUtil;

// A copy of Netty's SmtpResponseDecoder but parses responses using UTF8
public final class Utf8SmtpResponseDecoder extends LineBasedFrameDecoder {

  private List<CharSequence> details;

  /**
   * Creates a new instance that enforces the given {@code maxLineLength}.
   */
  public Utf8SmtpResponseDecoder(int maxLineLength) {
    super(maxLineLength);
  }

  @Override
  protected SmtpResponse decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
    ByteBuf frame = (ByteBuf) super.decode(ctx, buffer);
    if (frame == null) {
      // No full line received yet.
      return null;
    }
    try {
      final int readable = frame.readableBytes();
      final int readerIndex = frame.readerIndex();
      if (readable < 3) {
        throw newDecoderException(buffer, readerIndex, readable);
      }
      final int code = parseCode(frame);
      final int separator = frame.readByte();
      final CharSequence detail = frame.isReadable() ? frame.toString(CharsetUtil.UTF_8) : null;

      List<CharSequence> details = this.details;

      switch (separator) {
        case ' ':
          // Marks the end of a response.
          this.details = null;
          if (details != null) {
            if (detail != null) {
              details.add(detail);
            }
          } else {
            details = Collections.singletonList(detail);
          }
          return new DefaultSmtpResponse(code, details.toArray(new CharSequence[0]));
        case '-':
          // Multi-line response.
          if (detail != null) {
            if (details == null) {
              // Using initial capacity as it is very unlikely that we will receive a multi-line response
              // with more then 3 lines.
              this.details = details = new ArrayList<>(4);
            }
            details.add(detail);
          }
          break;
        default:
          throw newDecoderException(buffer, readerIndex, readable);
      }
    } finally {
      frame.release();
    }
    return null;
  }

  private static DecoderException newDecoderException(ByteBuf buffer, int readerIndex, int readable) {
    return new DecoderException(
        "Received invalid line: '" + buffer.toString(readerIndex, readable, CharsetUtil.UTF_8) + '\'');
  }

  /**
   * Parses the io.netty.handler.codec.smtp code without any allocation, which is three digits.
   */
  private static int parseCode(ByteBuf buffer) {
    final int first = parseNumber(buffer.readByte()) * 100;
    final int second = parseNumber(buffer.readByte()) * 10;
    final int third = parseNumber(buffer.readByte());
    return first + second + third;
  }

  private static int parseNumber(byte b) {
    return Character.digit((char) b, 10);
  }
}


text:
#pragma once

#include <boost/intrusive/list.hpp>

#include <folly/ThreadLocal.h>
#include <folly/detail/Singleton.h>
#include <folly/functional/Invoke.h>

namespace folly {

/// SingletonThreadLocal
///
/// Useful for a per-thread leaky-singleton model in libraries and applications.
///
/// By "leaky" it is meant that the T instances held by the instantiation
/// SingletonThreadLocal<T> will survive until their owning thread exits.
/// Therefore, they can safely be used before main() begins and after main()
/// ends, and they can also safely be used in an application that spawns many
/// temporary threads throughout its life.
///
/// Example:
///
///   struct UsefulButHasExpensiveCtor {
///     UsefulButHasExpensiveCtor(); // this is expensive
///     Result operator()(Arg arg);
///   };
///
///   Result useful(Arg arg) {
///     using Useful = UsefulButHasExpensiveCtor;
///     auto& useful = folly::SingletonThreadLocal<Useful>::get();
///     return useful(arg);
///   }
///
/// As an example use-case, the random generators in <random> are expensive to
/// construct. And their constructors are deterministic, but many cases require
/// that they be randomly seeded. So folly::Random makes good canonical uses of
/// folly::SingletonThreadLocal so that a seed is computed from the secure
/// random device once per thread, and the random generator is constructed with
/// the seed once per thread.
///
/// Keywords to help people find this class in search:
/// Thread Local Singleton ThreadLocalSingleton
template <
    typename T,
    typename Tag = detail::DefaultTag,
    typename Make = detail::DefaultMake<T>,
    typename TLTag = _t<std::conditional<
        std::is_same<Tag, detail::DefaultTag>::value,
        void,
        Tag>>>
class SingletonThreadLocal {
 private:
  struct Wrapper;

  using NodeBase = boost::intrusive::list_base_hook<
      boost::intrusive::link_mode<boost::intrusive::auto_unlink>>;

  struct Node : NodeBase {
    Wrapper*& cache;
    bool& stale;

    Node(Wrapper*& cache_, bool& stale_) : cache(cache_), stale(stale_) {
      auto& wrapper = getWrapper();
      wrapper.caches.push_front(*this);
      cache = &wrapper;
    }
    ~Node() {
      clear();
    }

    void clear() {
      cache = nullptr;
      stale = true;
    }
  };

  using List =
      boost::intrusive::list<Node, boost::intrusive::constant_time_size<false>>;

  struct Wrapper {
    template <typename S>
    using MakeRet = is_invocable_r<S, Make>;

    // keep as first field, to save 1 instr in the fast path
    union {
      alignas(alignof(T)) unsigned char storage[sizeof(T)];
      T object;
    };
    List caches;

    /* implicit */ operator T&() {
      return object;
    }

    // normal make types
    template <typename S = T, _t<std::enable_if<MakeRet<S>::value, int>> = 0>
    Wrapper() {
      (void)new (storage) S(Make{}());
    }
    // default and special make types for non-move-constructible T, until C++17
    template <typename S = T, _t<std::enable_if<!MakeRet<S>::value, int>> = 0>
    Wrapper() {
      (void)Make{}(storage);
    }
    ~Wrapper() {
      for (auto& node : caches) {
        node.clear();
      }
      caches.clear();
      object.~T();
    }
  };

  using WrapperTL = ThreadLocal<Wrapper, TLTag>;

  SingletonThreadLocal() = delete;

  FOLLY_EXPORT FOLLY_NOINLINE static WrapperTL& getWrapperTL() {
    static auto& entry = *detail::createGlobal<WrapperTL, Tag>();
    return entry;
  }

  FOLLY_NOINLINE static Wrapper& getWrapper() {
    return *getWrapperTL();
  }

#ifdef FOLLY_TLS
  FOLLY_NOINLINE static T& getSlow(Wrapper*& cache) {
    static thread_local Wrapper** check = &cache;
    CHECK_EQ(check, &cache) << "inline function static thread_local merging";
    static thread_local bool stale;
    static thread_local Node node(cache, stale);
    return !stale && node.cache ? *node.cache : getWrapper();
  }
#endif

 public:
  FOLLY_EXPORT FOLLY_ALWAYS_INLINE static T& get() {
#ifdef FOLLY_TLS
    static thread_local Wrapper* cache;
    return FOLLY_LIKELY(!!cache) ? *cache : getSlow(cache);
#else
    return getWrapper();
#endif
  }

  // Must use a unique Tag, takes a lock that is one per Tag
  static typename WrapperTL::Accessor accessAllThreads() {
    return getWrapperTL().accessAllThreads();
  }
};
} // namespace folly


text:
#ifndef __WmeBFontTT_H__
#define __WmeBFontTT_H__

#include "BFont.h"

#define NUM_CACHED_TEXTS 30

class FontGlyphCache;

class CBFontTT : public CBFont
{
private:
	//////////////////////////////////////////////////////////////////////////
	class CBCachedTTFontText
	{
	public:
		WideString m_Text;
		int m_Width;
		TTextAlign m_Align;
		int m_MaxHeight;
		int m_MaxLength;
		CBSurface* m_Surface;
		int m_Priority;
		int m_TextOffset;
		bool m_Marked;

		CBCachedTTFontText()
		{
			m_Text = L"";
			m_Width = m_MaxHeight = m_MaxLength = -1;
			m_Align = TAL_LEFT;
			m_Surface = NULL;
			m_Priority = -1;
			m_TextOffset = 0;
			m_Marked = false;
		}

		virtual ~CBCachedTTFontText()
		{
			if(m_Surface) delete m_Surface;
		}
	};

public:
	//////////////////////////////////////////////////////////////////////////
	class CBTTFontLayer
	{
	public:
		CBTTFontLayer()
		{
			m_OffsetX = m_OffsetY = 0;
			m_Color = 0x00000000;
		}

		HRESULT Persist(CBPersistMgr* PersistMgr)
		{
			PersistMgr->Transfer(TMEMBER(m_OffsetX));
			PersistMgr->Transfer(TMEMBER(m_OffsetY));
			PersistMgr->Transfer(TMEMBER(m_Color));
			return S_OK;
		}

		int m_OffsetX;
		int m_OffsetY;
		DWORD m_Color;
	};

	//////////////////////////////////////////////////////////////////////////
	class TextLine
	{
	public:
		TextLine(const WideString& text, int width)
		{
			m_Text = text;
			m_Width = width;
		}

		const WideString& GetText() const { return m_Text; }
		int GetWidth() const { return m_Width; }
	private:
		WideString m_Text;
		int m_Width;
	};
	typedef std::list<TextLine*> TextLineList;

public:
	DECLARE_PERSISTENT(CBFontTT, CBFont);
	CBFontTT(CBGame* inGame);
	virtual ~CBFontTT(void);

	virtual int GetTextWidth(BYTE* text, int MaxLenght=-1);
	virtual int GetTextHeight(BYTE* text, int width);
	virtual void DrawText(BYTE* text, int x, int y, int width, TTextAlign align=TAL_LEFT, int max_height=-1, int MaxLenght=-1);
	virtual int GetLetterHeight();

	HRESULT LoadBuffer(BYTE* Buffer);
	HRESULT LoadFile(char* Filename);

	static unsigned long FTReadSeekProc(FT_Stream stream, unsigned long offset,	unsigned char* buffer, unsigned long count);
	static void FTCloseProc(FT_Stream stream);

	FontGlyphCache* GetGlyphCache() { return m_GlyphCache; }

	float GetLineHeight() const { return m_LineHeight; }

	void AfterLoad();
	void InitLoop();

private:
	HRESULT ParseLayer(CBTTFontLayer* Layer, BYTE* Buffer);

	int WrapText(const WideString& text, int maxWidth, int maxHeight, TextLineList& lines);
	void MeasureText(const WideString& text, int maxWidth, int maxHeight, int& textWidth, int& textHeight);
	float GetKerning(wchar_t leftChar, wchar_t rightChar);
	void PrepareGlyphs(const WideString& text);
	void CacheGlyph(wchar_t ch);

	CBSurface* RenderTextToTexture(const WideString& text, int width, TTextAlign align, int maxHeight, int& textOffset);
	void BlitSurface(SDL_Surface* src, SDL_Surface* target, SDL_Rect* targetRect);

	CBCachedTTFontText* m_CachedTexts[NUM_CACHED_TEXTS];

	HRESULT InitFont();
	FT_Stream m_FTStream;
	FT_Face m_FTFace;

	FontGlyphCache* m_GlyphCache;

	float m_Ascender;
	float m_Descender;
	float m_LineHeight;
	float m_UnderlinePos;
	float m_PointSize;
	float m_VertDpi;
	float m_HorDpi;

	size_t m_MaxCharWidth;
	size_t m_MaxCharHeight;

	bool m_FontAlphaHack;

	int m_FontYOffsetCompensation;

public:
	bool m_IsBold;
	bool m_IsItalic;
	bool m_IsUnderline;
	bool m_IsStriked;
	int m_FontHeight;
	char* m_FontFile;

	CBArray<CBTTFontLayer*, CBTTFontLayer*> m_Layers;
	void ClearCache();

};

#endif


text:
browserstack
============

Python browserstack API


text:
namespace i2p
{
namespace client
{
	class ClientDestination;
}
namespace datagram
{
	const size_t MAX_DATAGRAM_SIZE = 32768;
	class DatagramDestination
	{
		typedef std::function<void (const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len)> Receiver;

		public:

			DatagramDestination (std::shared_ptr<i2p::client::ClientDestination> owner);
			~DatagramDestination ();

			void SendDatagramTo (const uint8_t * payload, size_t len, const i2p::data::IdentHash& ident, uint16_t fromPort = 0, uint16_t toPort = 0);
			void HandleDataMessagePayload (uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len);

			void SetReceiver (const Receiver& receiver) { m_Receiver = receiver; };
			void ResetReceiver () { m_Receiver = nullptr; };

			void SetReceiver (const Receiver& receiver, uint16_t port) { m_ReceiversByPorts[port] = receiver; };
			void ResetReceiver (uint16_t port) { m_ReceiversByPorts.erase (port); };

		private:

			void HandleLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> leaseSet, std::shared_ptr<I2NPMessage> msg);

			std::shared_ptr<I2NPMessage> CreateDataMessage (const uint8_t * payload, size_t len, uint16_t fromPort, uint16_t toPort);
			void SendMsg (std::shared_ptr<I2NPMessage> msg, std::shared_ptr<const i2p::data::LeaseSet> remote);
			void HandleDatagram (uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len);

		private:

			std::shared_ptr<i2p::client::ClientDestination> m_Owner;
			Receiver m_Receiver; // default
			std::map<uint16_t, Receiver> m_ReceiversByPorts;

			i2p::data::GzipInflator m_Inflator;
			i2p::data::GzipDeflator m_Deflator;
	};
}
}

#endif


text:
Library documentation
#####################

.. automodule:: xdo
    :members:
    :undoc-members: