text:
<?php
/**
 * tvlistings.php
 *
 * I/O Wraps PHP Client Library Sample App for TV Listings API
 *
 * PHP version 5
 *
 * @category Examples
 * @package  Mashery_IO_Wraps_Rovi
 * @author   Neil Mansilla <neil@mashery.com>
 * @license  https://raw.github.com/mashery/io-wraps-rovi-php/master/LICENSE.txt MIT License
 * @version  GIT: $Id:$
 * @link     https://github.com/mashery/io-wraps-rovi-php/
 *
 */

// Client library (network/authentication)
require_once "../google-api-php-client/src/apiClient.php";

// Rovi resource/method library
require_once "../google-api-php-client/src/contrib/apiTvlistingsapiService.php";

// Instantiate client
$client = new apiClient();

// Set credentials
$client -> setDeveloperKey("YOUR_KEY_HERE");

// Instantiate service
$service = new apiTvlistingsapiService($client);

// Initialize globals
$tvlistingsAPI = array();
$resultsObj = array();
$postalCode = $_GET['postalCode'];
$searchResultCount = 0;

if ($postalCode) {
    $tvlistingsAPI = $service->TVListingsMethods->Services(
        $postalCode,
        "en-US",
        "US"
    );
    $resultsObj = $tvlistingsAPI['ServicesResult'];
}
?>
<!doctype html>

        <title>Rovi TV Listings API - Services Example App</title>
         <link rel="stylesheet"
            href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />

Rovi TV Listings API - Services Example App

                    <form id="section" method="GET" action="./tvlistings.php"
                        class="well">

                            Postal Code
                            <input type="text" name="postalCode"
<?php
if ($postalCode) {
    echo ("value=\"" . $postalCode . "\"");
}
?>
                            />

                            <input type="submit" value="Search for TV Services" />

                    </form>

<?php
// Pardon this inline control
if (($postalCode) && ($resultsObj['Services'] > 0)):
?>

                            ServiceClass
                            ServiceId
                            Name
                            City
                            MSO
                            MSOID

<?php
foreach ($resultsObj['Services']['Service'] as $result) {
    // Output each result in row
    echo("
" . $result['ServiceClass'] . "	");
    echo("" . $result['ServiceId'] . "	");
    echo("" . $result['Name'] . "	");
    echo("" . $result['City'] . "	");
    echo("" . $result['MSO'] . "	");
    echo("" . $result['MSOID'] . "
");
}
?>

<?php elseif ($postalCode): ?>

No results were found with those search parameters.

<?php endif ?>


text:
using namespace ydsh;

TEST(result, tag) {
  static_assert(TypeTag<int, std::string, int>::value == 1, "must be 1");
  static_assert(TypeTag<unsigned int, std::string, int>::value == -1, "must be -1");
  static_assert(TypeTag<unsigned int>::value == -1, "must be -1");

  static_assert(std::is_same<int, typename TypeByIndex<0, int>::type>::value);
  static_assert(std::is_same<int, typename TypeByIndex<0, int, void *, std::string>::type>::value);
  static_assert(
      std::is_same<void *, typename TypeByIndex<1, int, void *, std::string>::type>::value);
  static_assert(
      std::is_same<std::string, typename TypeByIndex<2, int, void *, std::string>::type>::value);
}

TEST(result, storage1) {
  auto str = std::make_shared<std::string>("hello");
  ASSERT_EQ(1, str.use_count());

  using shared = decltype(str);
  Storage<bool, shared> raw;
  raw.obtain(shared(str));
  ASSERT_EQ(2, str.use_count());
  ASSERT_EQ(2, get<shared>(raw).use_count());
  ASSERT_EQ(str.get(), get<shared>(raw).get());

  Storage<bool, shared> raw2;
  move<shared>(raw, raw2);
  ASSERT_EQ(2, get<shared>(raw2).use_count());
  ASSERT_EQ(2, str.use_count());
  ASSERT_EQ(str.get(), get<shared>(raw2).get());

  destroy<shared>(raw2);
  ASSERT_EQ(1, str.use_count());

  raw.obtain(true);
  raw2.obtain(false);
  ASSERT_TRUE(get<bool>(raw));
  ASSERT_FALSE(get<bool>(raw2));
}

TEST(result, storage2) {
  Storage<int, std::string> value;
  value.obtain(std::string("hello"));
  ASSERT_EQ("hello", get<std::string>(value));

  decltype(value) value2;
  move<std::string>(value, value2);
  ASSERT_EQ("hello", get<std::string>(value2));

  destroy<std::string>(value2);
}

TEST(result, Union1) {
  Union<int, std::string, std::nullptr_t> value(std::string("hey"));
  ASSERT_EQ("hey", get<std::string>(value));
  ASSERT_TRUE(is<std::string>(value));
  ASSERT_FALSE(is<int>(value));

  decltype(value) value2;
  ASSERT_EQ(-1, value2.tag());
  ASSERT_FALSE(value2.hasValue());

  value2 = std::move(value);
  ASSERT_TRUE(is<std::string>(value2));
  ASSERT_EQ("hey", get<std::string>(value2));
  value = std::move(value2);
  ASSERT_EQ(-1, value2.tag());
  ASSERT_FALSE(value2.hasValue());
  ASSERT_EQ("hey", get<std::string>(value));

  value = nullptr;
  ASSERT_TRUE(is<std::nullptr_t>(value));
  ASSERT_EQ(nullptr, get<std::nullptr_t>(value));
}

TEST(result, Union2) {
  auto str = std::make_shared<std::string>("hello");
  ASSERT_EQ(1, str.use_count());

  using shared = decltype(str);
  auto v = Union<const char *, shared>(shared(str));
  ASSERT_EQ(2, str.use_count());
  ASSERT_EQ(2, get<shared>(v).use_count());
  ASSERT_EQ(str.get(), get<shared>(v).get());

  {
    auto v2 = std::move(v);
    ASSERT_EQ(-1, v.tag());
    ASSERT_FALSE(v.hasValue());
    ASSERT_EQ(2, str.use_count());
    ASSERT_EQ(2, get<shared>(v2).use_count());
    ASSERT_EQ(str.get(), get<shared>(v2).get());
  }
  ASSERT_EQ(1, str.use_count());

  auto v3 = Union<const char *, bool>((const char *)"hello");
  ASSERT_EQ("hello", get<const char *>(v3));
  ASSERT_TRUE(is<const char *>(v3));
}

TEST(result, Union3) {
  auto v = Union<unsigned int>();
  ASSERT_FALSE(v.hasValue());
  v = 34;
  ASSERT_TRUE(v.hasValue());
  ASSERT_EQ(34, get<unsigned int>(v));
}

TEST(result, Union4) {
  auto str = std::make_shared<std::string>("hello");
  ASSERT_EQ(1, str.use_count());

  using shared = decltype(str);
  auto v = Union<const char *, shared>(shared(str));
  ASSERT_EQ(2, str.use_count());
  ASSERT_EQ(2, get<shared>(v).use_count());
  ASSERT_EQ(str.get(), get<shared>(v).get());

  auto v2 = v;
  ASSERT_EQ(3, str.use_count());
  ASSERT_EQ(3, get<shared>(v).use_count());
  ASSERT_EQ(3, get<shared>(v2).use_count());
  ASSERT_EQ(str.get(), get<shared>(v).get());
  ASSERT_EQ(str.get(), get<shared>(v2).get());

  v = "34";
  ASSERT_STREQ("34", get<const char *>(v));
  ASSERT_EQ(2, str.use_count());
  ASSERT_EQ(2, get<shared>(v2).use_count());

  v2 = v;
  ASSERT_STREQ("34", get<const char *>(v2));
  ASSERT_EQ(1, str.use_count());
  ASSERT_EQ(get<const char *>(v), get<const char *>(v2));
}

Result<std::string, int> func(int index) {
  if (index < 0) {
    return Err(index);
  }
  return Ok(std::to_string(index));
}

TEST(result, result) {
  Result<std::string, int> ret = Ok("hello");
  ASSERT_TRUE(ret);
  ASSERT_EQ("hello", ret.asOk());

  Result<std::string, int> ret2 = Err(12);
  ASSERT_FALSE(ret2);
  ASSERT_EQ(12, ret2.asErr());

  auto v = std::move(func(12).asOk());
  ASSERT_EQ("12", v);
  ASSERT_EQ(-1, func(-1).asErr());
}

TEST(result, optional1) {
  Optional<int> ret;
  ASSERT_FALSE(ret.hasValue());
  ret = 12;
  ASSERT_TRUE(ret.hasValue());
  ASSERT_EQ(12, ret.unwrap());
  ret = Optional<int>(34);
  ASSERT_TRUE(ret.hasValue());
  ASSERT_EQ(34, ret.unwrap());
}

TEST(result, optional2) {
  ASSERT_EQ(sizeof(Union<int, double>), sizeof(Optional<Union<int, double>>));
  Optional<Union<int, std::string>> ret;
  ASSERT_FALSE(ret.hasValue());
  ret = 12;
  ASSERT_TRUE(ret.hasValue());
  ASSERT_EQ(12, get<int>(ret));
  ret = "hello";
  ASSERT_TRUE(ret.hasValue());
  ASSERT_EQ("hello", get<std::string>(ret));

  ASSERT_EQ(sizeof(Optional<int>), sizeof(Optional<Optional<int>>));
}

template <typename T>
using hasValue_member = decltype(&T::hasValue);

TEST(result, optional3) {
  static_assert(is_detected_v<hasValue_member, Optional<int>>);
  static_assert(!is_detected_v<hasValue_member, std::string>);

  static_assert(std::is_same<Optional<float>, Optional<Optional<float>>>::value);
  ASSERT_EQ(sizeof(Optional<int>), sizeof(Optional<Optional<int>>));
  ASSERT_EQ(sizeof(Optional<int>), sizeof(Optional<Optional<Optional<int>>>));
  Optional<Optional<int>> ret;
  ASSERT_FALSE(ret.hasValue());
  ret = 12;
  ASSERT_TRUE(ret.hasValue());
  ASSERT_EQ(12, ret.unwrap());
  ret = Optional<int>(34);
  ASSERT_TRUE(ret.hasValue());
  ASSERT_EQ(34, ret.unwrap());
}

int main(int argc, char **argv) {
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}

redpajama_set_name: RedPajamaGithub


text:
#include "sml_observation.h"
#include "sml_fuzzy_bridge.h"
#include "sml_bit_array.h"
#include <macros.h>
#include <sml_log.h>
#include <sml_string.h>

#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include <errno.h>

#define RULE_WEIGHT 1
#define WEIGHT_THRESHOLD (0.1)
#define FLOAT_THRESHOLD (0.01)

struct sml_observation {
    //Replace this structure with a struct sml_matrix
    struct sol_vector output_weights;
    struct sol_vector input_membership;
};

static void
_input_set(struct sml_observation *observation, uint16_t input, uint16_t term,
    uint8_t value)
{
    struct sml_bit_array *array;

    array = sol_vector_get(&observation->input_membership, input);
    if (!array)
        return;

    sml_bit_array_set(array, term, value);
}

static int
_input_membership_initialize(struct sml_fuzzy *fuzzy,
    struct sml_observation *obs)
{
    uint16_t len, i, terms_len;
    struct sml_bit_array *array;
    struct sml_variable *var;
    int error;

    len = sml_fuzzy_variables_list_get_length(fuzzy->input_list);
    for (i = 0; i < len; i++) {
        if (i >= obs->input_membership.len) {
            array = sol_vector_append(&obs->input_membership);
            if (!array)
                return -ENOMEM;
            sml_bit_array_init(array);
        } else
            array = sol_vector_get(&obs->input_membership, i);

        var = sml_fuzzy_variables_list_index(fuzzy->input_list, i);
        terms_len = sml_fuzzy_variable_terms_count(var);
        error = sml_bit_array_size_set(array, terms_len, 0);
        if (error != 0)
            return error;
    }

    return 0;
}

static int
_output_weights_initialize(struct sml_fuzzy *fuzzy, struct sml_observation *obs)
{
    uint16_t len, i, j, terms_len;
    uint8_t *val;
    struct sol_vector *vector;
    struct sml_variable *var;

    len = sml_fuzzy_variables_list_get_length(fuzzy->output_list);
    for (i = 0; i < len; i++) {
        if (i >= obs->output_weights.len) {
            vector = sol_vector_append(&obs->output_weights);
            if (!vector)
                return -ENOMEM;
            sol_vector_init(vector, sizeof(uint8_t));
        } else
            vector = sol_vector_get(&obs->output_weights, i);

        var = sml_fuzzy_variables_list_index(fuzzy->output_list, i);
        terms_len = sml_fuzzy_variable_terms_count(var);
        for (j = vector->len; j < terms_len; j++) {
            val = sol_vector_append(vector);
            *val = 0;
        }
    }
    return 0;
}

static void
_input_membership_free(struct sml_observation *observation)
{
    uint16_t i;

    for (i = 0; i < observation->input_membership.len; i++)
        sml_bit_array_clear(sol_vector_get(&observation->input_membership, i));
    sol_vector_clear(&observation->input_membership);
}

static void
_output_weights_free(struct sml_observation *observation)
{
    uint16_t i;

    for (i = 0; i < observation->output_weights.len; i++)
        sol_vector_clear(sol_vector_get(&observation->output_weights, i));
    sol_vector_clear(&observation->output_weights);
}

static int
_output_set(struct sml_fuzzy *fuzzy, struct sml_observation *obs, uint16_t
    output,
    uint16_t term, uint8_t data)
{
    struct sol_vector *vector;
    uint8_t *val;
    int error;

    if (output >= obs->output_weights.len ||
        term >= *((uint8_t *)sol_vector_get(&obs->output_weights, output))) {
        if ((error = _output_weights_initialize(fuzzy, obs)))
            return error;
    }

    vector = sol_vector_get(&obs->output_weights, output);
    if (!vector)
        return -ENODATA;

    val = sol_vector_get(vector, term);
    if (!val)
        return -ENODATA;

    *val = data;
    return 0;
}

static uint8_t
_output_get(struct sml_observation *observation, uint16_t output, uint16_t term)
{
    struct sol_vector *terms;
    uint8_t *val;

    if (output >= observation->output_weights.len)
        return 0;

    terms = sol_vector_get(&observation->output_weights, output);
    if (term >= terms->len)
        return 0;

    val = sol_vector_get(terms, term);
    if (!val)
        return 0;
    return *val;
}

static struct sml_observation *
_observation_alloc(struct sml_fuzzy *fuzzy)
{
    struct sml_observation *observation = malloc(
        sizeof(struct sml_observation));

    if (!observation)
        return NULL;

    sol_vector_init(&observation->output_weights, sizeof(struct sol_vector));
    if (_output_weights_initialize(fuzzy, observation))
        goto alloc_error;

    sol_vector_init(&observation->input_membership,
        sizeof(struct sml_bit_array));
    if (_input_membership_initialize(fuzzy, observation) != 0)
        goto alloc_error;

    return observation;

alloc_error:
    _output_weights_free(observation);
    _input_membership_free(observation);
    free(observation);
    return NULL;
}

static bool
_set_input_observations_values(struct sml_observation *observation,
    struct sml_variables_list *list, struct sml_matrix *values)
{
    uint16_t len, i, j;
    float *tmp, val;
    bool set = false;

    len = sml_fuzzy_variables_list_get_length(list);
    for (i = 0; i < len; i++) {
        struct sml_variable *variable = sml_fuzzy_variables_list_index(list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(variable);
        if (sml_fuzzy_variable_is_enabled(variable)) {
            for (j = 0; j < terms_len; j++) {
                val = sml_matrix_cast_get(values, i, j, tmp, float);
                if (val > VARIABLE_MEMBERSHIP_THRESHOLD) {
                    _input_set(observation, i, j, SET);
                    set = true;
                } else
                    _input_set(observation, i, j, UNSET);
            }
        }
    }

    return set;
}

uint8_t
sml_observation_input_term_get(struct sml_observation *obs, uint16_t input,
    uint16_t term)
{
    struct sml_bit_array *array;

    array = sol_vector_get(&obs->input_membership, input);
    if (!array)
        return 0;

    return sml_bit_array_get(array, term);
}

void
sml_observation_free(struct sml_observation *observation)
{
    _output_weights_free(observation);
    _input_membership_free(observation);
    free(observation);
}

int
sml_observation_new(struct sml_fuzzy *fuzzy, struct sml_measure *measure,
    struct sml_observation **observation)
{
    struct sml_observation *tmp_obs;

    if (!observation)
        return -EINVAL;

    if (!fuzzy->output_terms_count || !fuzzy->input_terms_count) {
        *observation = NULL;
        return 0;
    }

    tmp_obs = _observation_alloc(fuzzy);
    if (!tmp_obs) {
        sml_critical("Failed to create new tmp_obs");
        return -errno;
    }

    if (!_set_input_observations_values(tmp_obs, fuzzy->input_list,
        &measure->inputs)) {
        sml_observation_free(tmp_obs);
        *observation = NULL;
        return 0;
    }

    *observation = tmp_obs;
    return 0;
}

bool
sml_observation_enabled_input_values_equals(struct sml_fuzzy *fuzzy,
    struct sml_observation *observation,
    struct sml_measure *measure)
{
    uint16_t i, j, len;
    float val, *tmp;
    struct sml_variable *var;

    len = sml_fuzzy_variables_list_get_length(fuzzy->input_list);
    for (i = 0; i < len; i++) {
        var = sml_fuzzy_variables_list_index(fuzzy->input_list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(var);
        if (sml_fuzzy_variable_is_enabled(var)) {
            for (j = 0; j < terms_len; j++) {
                val = sml_matrix_cast_get(&measure->inputs, i, j, tmp, float);
                uint8_t set = val > VARIABLE_MEMBERSHIP_THRESHOLD;
                if (sml_observation_input_term_get(observation, i, j) != set)
                    return false;
            }
        }
    }

    return true;
}

bool
sml_observation_enabled_input_equals(struct sml_fuzzy *fuzzy,
    struct sml_observation *obs1,
    struct sml_observation *obs2)
{
    uint16_t i, j, len;
    struct sml_variable *var;

    len = sml_fuzzy_variables_list_get_length(fuzzy->input_list);
    for (i = 0; i < len; i++) {
        var = sml_fuzzy_variables_list_index(fuzzy->input_list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(var);
        if (sml_fuzzy_variable_is_enabled(var)) {
            for (j = 0; j < terms_len; j++) {
                if (sml_observation_input_term_get(obs1, i, j) !=
                    sml_observation_input_term_get(obs2, i, j))
                    return false;
            }
        }
    }

    return true;
}

bool
sml_observation_output_equals(struct sml_fuzzy *fuzzy,
    struct sml_observation *obs1, struct sml_observation *obs2,
    uint16_t output_number)
{
    uint16_t i, terms_len, total_weight1 = 0, total_weight2 = 0;
    struct sml_variable *var;

    var = sml_fuzzy_variables_list_index(fuzzy->output_list, output_number);
    terms_len = sml_fuzzy_variable_terms_count(var);
    for (i = 0; i < terms_len; i++) {
        total_weight1 += _output_get(obs1, output_number, i);
        total_weight2 += _output_get(obs2, output_number, i);
    }
    if (total_weight1 == 0 && total_weight2 == 0)
        return true;

    if (total_weight1 == 0 || total_weight2 == 0)
        return false;

    for (i = 0; i < terms_len; i++)
        if (fabs((_output_get(obs1, output_number, i) / total_weight1) -
            (_output_get(obs2, output_number, i) / total_weight2)) >
            WEIGHT_THRESHOLD)
            return false;

    return true;
}

bool
sml_observation_input_equals(struct sml_fuzzy *fuzzy,
    struct sml_observation *obs1, struct sml_observation *obs2)
{
    uint16_t i, j, len;
    struct sml_variable *var;

    len = sml_fuzzy_variables_list_get_length(fuzzy->input_list);
    for (i = 0; i < len; i++) {
        var = sml_fuzzy_variables_list_index(fuzzy->input_list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(var);
        for (j = 0; j < terms_len; j++) {
            if (sml_observation_input_term_get(obs1, i, j) !=
                sml_observation_input_term_get(obs2, i, j))
                return false;
        }
    }

    return true;
}

int
sml_observation_hit(struct sml_fuzzy *fuzzy,
    struct sml_observation *observation, struct sml_measure *measure, bool *hit)
{
    uint16_t len, i, j, index = 0;
    int error;
    float val, *tmp;
    bool tmp_hit = false;
    struct sml_variable *variable;

    len = sml_fuzzy_variables_list_get_length(fuzzy->output_list);
    for (i = 0; i < len; i++) {
        variable = sml_fuzzy_variables_list_index(fuzzy->output_list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(variable);
        bool reduce_weight = false;

        for (j = 0; j < terms_len; j++) {
            val = sml_matrix_cast_get(&measure->outputs, i, j, tmp, float);
            uint16_t output_weight = _output_get(observation, i, j);

            if (val >= VARIABLE_MEMBERSHIP_THRESHOLD) {
                if (output_weight >= UINT8_MAX - RULE_WEIGHT) {
                    output_weight = UINT8_MAX;
                    reduce_weight = true;
                } else
                    output_weight += RULE_WEIGHT;
                if ((error = _output_set(fuzzy, observation, i, j,
                        output_weight)))
                    return error;
                tmp_hit = true;
            } else if (output_weight > 0 &&
                val < VARIABLE_MEMBERSHIP_THRESHOLD) {
                if (output_weight < RULE_WEIGHT)
                    output_weight = 0;
                else
                    output_weight -= RULE_WEIGHT;
                if ((error = _output_set(fuzzy, observation, i, j,
                        output_weight)))
                    return error;
                tmp_hit = true;
            }
            index++;
        }

        if (reduce_weight)
            for (j = 0; j < terms_len; j++)
                _output_set(fuzzy, observation, i, j,
                    _output_get(observation, i, j));
    }

    if (hit)
        *hit = tmp_hit;
    return 0;
}

static bool
_is_input_relevant(struct sml_bit_array *relevant_inputs, uint16_t i)
{
    if (!relevant_inputs)
        return true;
    return sml_bit_array_get(relevant_inputs, i) == SET;
}

static bool
_observation_input_rule_generate(struct sml_variables_list *list,
    struct sml_bit_array *relevant_inputs,
    struct sml_observation *observation, struct sml_string *str)
{
    uint16_t len, i, j;
    bool is_first = true, r;
    struct sml_variable *variable;
    struct sml_fuzzy_term *term;

    len = sml_fuzzy_variables_list_get_length(list);
    for (i = 0; i < len; i++) {
        variable = sml_fuzzy_variables_list_index(list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(variable);
        if (sml_fuzzy_variable_is_enabled(variable) &&
            _is_input_relevant(relevant_inputs, i)) {
            for (j = 0; j < terms_len; j++) {
                term = sml_fuzzy_variable_get_term(variable, j);
                uint8_t val = sml_observation_input_term_get(observation,
                    i, j);
                if (val == SET) {
                    if (is_first)
                        is_first = false;
                    else {
                        r = sml_string_append(str, " and ");
                        if (!r) {
                            sml_critical("Could not append \"and\" to the " \
                                "string");
                            return false;
                        }
                    }
                    r = sml_string_append_printf(str, "%s is %s",
                        sml_fuzzy_variable_get_name(variable),
                        sml_fuzzy_term_get_name(term));
                    if (!r) {
                        sml_critical("Could not append the variable name " \
                            "and term to the string");
                        return false;
                    }
                }
            }
        }
    }
    return !is_first;
}

static void
_observation_output_rule_generate(struct sml_variables_list *list,
    float *output_weights,
    struct sml_string *prefix,
    float weight_threshold,
    uint16_t output_number,
    sml_process_str_cb process_cb, void *data)
{
    uint16_t i, j, len, index = 0;
    bool r;

    len = sml_fuzzy_variables_list_get_length(list);
    for (i = 0; i < len; i++) {
        struct sml_variable *v = sml_fuzzy_variables_list_index(list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(v);
        if (i != output_number) {
            index += terms_len;
            continue;
        }

        for (j = 0; j < terms_len; j++) {
            struct sml_fuzzy_term *term = sml_fuzzy_variable_get_term(v, j);
            float output_weight = output_weights[index];
            if (output_weight > weight_threshold) {
                struct sml_string *str_observation =
                    sml_string_new(sml_string_get_string(prefix));
                if (!str_observation) {
                    sml_critical("Could not alloc the sml string");
                    continue;
                }
                r = sml_string_append_printf(str_observation, "%s is %s",
                    sml_fuzzy_variable_get_name(v),
                    sml_fuzzy_term_get_name(term));
                if (r) {
                    if (output_weight < (1 - FLOAT_THRESHOLD))
                        r = sml_string_append_printf(
                            str_observation, " with %f", output_weight);
                    if (r)
                        process_cb(sml_string_get_string(str_observation),
                            data);
                    else
                        sml_critical("Couild not append the rule weight");
                } else
                    sml_critical("Could not append the variable name and term");

                sml_string_free(str_observation);
            }
            index++;
        }
        break;
    }
}

void
sml_observation_rule_generate(struct sml_fuzzy *fuzzy,
    struct sol_ptr_vector *observation_list,
    float weight_threshold,
    struct sml_bit_array *relevant_inputs,
    float *output_weights,
    uint16_t output_number,
    sml_process_str_cb process_cb, void *data)
{
    struct sml_observation *first_observation =
        sol_ptr_vector_get(observation_list, 0);
    bool success;
    struct sml_string *str = sml_string_new("if ");

    if (!str) {
        sml_critical("Could not alloc the sml string");
        return;
    }

    success = _observation_input_rule_generate(fuzzy->input_list,
        relevant_inputs,
        first_observation, str);
    if (!success) {
        sml_critical("Generating observation string failed");
        goto error;
    }

    if (!sml_string_append(str, " then ")) {
        sml_critical("Could not append to \"then\" to the string");
        goto error;
    }

    _observation_output_rule_generate(fuzzy->output_list,
        output_weights, str, weight_threshold,
        output_number,
        process_cb, data);
error:
    sml_string_free(str);
}

void
sml_observation_debug(struct sml_observation *observation)
{
    uint16_t i, j;
    struct sml_string *str = sml_string_new("\t");
    struct sol_vector *term_weights;
    struct sml_bit_array *term_membership;
    uint8_t *val;

    sml_string_append_printf(str, "Observation {");
    sml_string_append_printf(str, "Inputs (%d) {",
        observation->input_membership.len);
    SOL_VECTOR_FOREACH_IDX (&observation->input_membership, term_membership,
        i) {
        if (i > 0)
            sml_string_append(str, ", ");
        sml_string_append_printf(str, "{");
        for (j = 0; j < term_membership->size; j++) {
            if ( j > 0)
                sml_string_append(str, ", ");
            sml_string_append_printf(str, "%d",
                sml_bit_array_get(term_membership, j));
        }
        sml_string_append(str, "}");
    }
    sml_string_append(str, "}");

    sml_string_append_printf(str, ", Outputs (%d) {",
        observation->output_weights.len);

    SOL_VECTOR_FOREACH_IDX (&observation->output_weights, term_weights, i) {
        if (i > 0)
            sml_string_append(str, ", ");
        sml_string_append_printf(str, "{");
        SOL_VECTOR_FOREACH_IDX (term_weights, val, j) {
            if ( j > 0)
                sml_string_append(str, ", ");
            sml_string_append_printf(str, "%d", *val);
        }
        sml_string_append(str, "}");
    }

    sml_string_append(str, "}");
    sml_string_append(str, "}");
    sml_debug("%s", sml_string_get_string(str));

    sml_string_free(str);
}

int
sml_observation_remove_variables(struct sml_observation *observation,
    bool *inputs_to_remove,
    bool *outputs_to_remove)
{
    uint16_t i, removed, len;

    if (inputs_to_remove) {
        removed = 0;
        len = observation->input_membership.len;
        for (i = 0; i < len; i++) {
            if (inputs_to_remove[i]) {
                sml_bit_array_clear(sol_vector_get(
                    &observation->input_membership, i - removed));
                sol_vector_del(&observation->input_membership, i - removed);
                removed++;
            }
        }
    }

    if (outputs_to_remove) {
        removed = 0;
        len = observation->output_weights.len;
        for (i = 0; i < len; i++) {
            if (outputs_to_remove[i]) {
                sol_vector_clear(sol_vector_get(&observation->output_weights,
                    i - removed));
                sol_vector_del(&observation->output_weights, i - removed);
                removed++;
            }
        }
    }

    return 0;
}

bool
sml_observation_is_empty(struct sml_observation *observation)
{
    return !observation->output_weights.len ||
           !observation->input_membership.len;
}

int
sml_observation_merge_output(struct sml_fuzzy *fuzzy,
    struct sml_observation *observation1, struct sml_observation *observation2)
{
    uint16_t i, j;
    struct sol_vector *term_weights;
    uint8_t *val;
    int error;

    if ((error = _output_weights_initialize(fuzzy, observation1)))
        return error;

    SOL_VECTOR_FOREACH_IDX (&observation1->output_weights, term_weights, i) {
        SOL_VECTOR_FOREACH_IDX (term_weights, val, j)
            *val = *val + _output_get(observation2, i, j);
    }

    return 0;
}

bool
sml_observation_is_base(struct sml_fuzzy *fuzzy,
    struct sml_observation *observation)
{
    uint16_t i, j, len;
    struct sml_variable *var;

    len = sml_fuzzy_variables_list_get_length(fuzzy->input_list);
    for (i = 0; i < len; i++) {
        var = sml_fuzzy_variables_list_index(fuzzy->input_list, i);
        uint16_t terms_len = sml_fuzzy_variable_terms_count(var);
        if (!sml_fuzzy_variable_is_enabled(var)) {
            for (j = 0; j < terms_len; j++) {
                if (sml_observation_input_term_get(observation, i, j))
                    return false;
            }
        }
    }

    return true;
}

void
sml_observation_fill_output_weights(struct sml_fuzzy *fuzzy,
    struct sml_observation *obs, uint16_t *output_weights)
{
    uint16_t index, len, i, j, terms_len;
    struct sml_variables_list *list;

    index = 0;
    list = fuzzy->output_list;
    len = sml_fuzzy_variables_list_get_length(list);
    for (i = 0; i < len; i++) {
        struct sml_variable *variable = sml_fuzzy_variables_list_index(list, i);
        terms_len = sml_fuzzy_variable_terms_count(variable);
        for (j = 0; j < terms_len; j++)
            output_weights[index++] += _output_get(obs, i, j);
    }
}

bool
sml_observation_save(struct sml_observation *obs, FILE *f)
{
    uint16_t input_byte_size, i;
    struct sol_vector *vector;
    struct sml_bit_array *array;

    if (fwrite(&obs->output_weights.len, sizeof(uint16_t), 1, f) < 1)
        return false;

    SOL_VECTOR_FOREACH_IDX (&obs->output_weights, vector, i) {
        if (fwrite(&vector->len, sizeof(uint16_t), 1, f) < 1)
            return false;

        if (fwrite(vector->data, sizeof(uint8_t), vector->len, f) < vector->len)
            return false;
    }

    if (fwrite(&obs->input_membership.len, sizeof(uint16_t), 1, f) < 1)
        return false;

    SOL_VECTOR_FOREACH_IDX (&obs->input_membership, array, i) {
        if (fwrite(&array->size, sizeof(uint16_t), 1, f) < 1)
            return false;

        input_byte_size = sml_bit_array_byte_size_get(array);
        if (fwrite(array->data, sizeof(uint8_t), input_byte_size, f)
            < input_byte_size)
            return false;

    }

    return true;
}

struct sml_observation *
sml_observation_load(FILE *f)
{
    struct sml_observation *obs;
    uint16_t i, j, input_size, output_size;

    obs = malloc(sizeof(struct sml_observation));

    if (fread(&output_size, sizeof(uint16_t), 1, f) < 1)
        goto error;
    sol_vector_init(&obs->output_weights, sizeof(struct sol_vector));
    for (i = 0; i < output_size; i++) {
        struct sol_vector *vector;
        uint16_t terms_size;

        vector = sol_vector_append(&obs->output_weights);
        sol_vector_init(vector, sizeof(uint8_t));

        if (fread(&terms_size, sizeof(uint16_t), 1, f) < 1)
            goto error;
        for (j = 0; j < terms_size; j++) {
            uint8_t *val = sol_vector_append(vector);
            if (fread(val, sizeof(uint8_t), 1, f) < 1)
                goto error;
        }
    }

    if (fread(&input_size, sizeof(uint16_t), 1, f) < 1)
        goto error;
    sol_vector_init(&obs->input_membership, sizeof(struct sml_bit_array));
    for (i = 0; i < input_size; i++) {
        struct sml_bit_array *array;
        uint16_t terms_size, input_byte_size;

        array = sol_vector_append(&obs->input_membership);
        sml_bit_array_init(array);

        if (fread(&terms_size, sizeof(uint16_t), 1, f) < 1)
            goto error;
        if (sml_bit_array_size_set(array, terms_size, 0) != 0)
            goto error;
        input_byte_size = sml_bit_array_byte_size_get(array);
        if (fread(array->data, sizeof(uint8_t), input_byte_size, f)
            < input_byte_size)
            goto error;
    }
    return obs;

error:
    sml_observation_free(obs);
    return NULL;
}

int
sml_observation_remove_term(struct sml_observation *obs, uint16_t var_num,
    uint16_t term_num, bool input)
{
    struct sol_vector *vector;
    struct sml_bit_array *array;

    if (input) {
        array = sol_vector_get(&obs->input_membership, var_num);
        return sml_bit_array_remove(array, term_num);
    }

    vector = sol_vector_get(&obs->output_weights, var_num);
    return sol_vector_del(vector, term_num);
}

int
sml_observation_merge_terms(struct sml_observation *obs, uint16_t var_num,
    uint16_t term1, uint16_t term2, bool input)
{
    struct sol_vector *vector;
    struct sml_bit_array *array;
    uint8_t val;
    uint16_t *weight1, *weight2;

    if (input) {
        array = sol_vector_get(&obs->input_membership, var_num);
        val = sml_bit_array_get(array, term1) == SET ||
            sml_bit_array_get(array, term2) == SET ? SET : UNSET;
        sml_bit_array_set(array, term1, val);
        return sml_bit_array_remove(array, term2);
    }

    vector = sol_vector_get(&obs->output_weights, var_num);
    weight1 = sol_vector_get(vector, term1);
    weight2 = sol_vector_get(vector, term2);
    *weight1 = *weight1 + *weight2;
    return sol_vector_del(vector, term2);
}

int
sml_observation_split_terms(struct sml_fuzzy *fuzzy,
    struct sml_observation *obs, uint16_t var_num, uint16_t term_num,
    uint16_t term1, uint16_t term2, bool input)
{
    struct sol_vector *vector;
    struct sml_bit_array *array;
    struct sml_variable *var;
    uint8_t val;
    uint16_t weight, terms_len;
    int error;

    if (input) {
        array = sol_vector_get(&obs->input_membership, var_num);
        var = sml_fuzzy_variables_list_index(fuzzy->input_list, var_num);
        terms_len = sml_fuzzy_variable_terms_count(var);
        if ((error = sml_bit_array_size_set(array, terms_len, 0)))
            return error;

        val = sml_bit_array_get(array, term_num) == SET;
        sml_bit_array_set(array, term1, val);
        sml_bit_array_set(array, term2, val);
        return sml_bit_array_remove(array, term_num);
    }

    weight = _output_get(obs, var_num, term_num);

    if ((error = _output_set(fuzzy, obs, var_num, term1, weight)))
        return error;

    if ((error = _output_set(fuzzy, obs, var_num, term2, weight)))
        return error;

    vector = sol_vector_get(&obs->output_weights, var_num);
    return sol_vector_del(vector, term_num);
}

unsigned int
sml_observation_estimate_size(struct sml_fuzzy *fuzzy)
{
    unsigned int size = sizeof(struct sml_observation);

    size += (sml_fuzzy_variables_list_get_length(fuzzy->input_list) +
        sml_fuzzy_variables_list_get_length(fuzzy->output_list)) *
        sizeof(struct sol_vector);
    size += (fuzzy->output_terms_count * sizeof(uint8_t)) +
        (fuzzy->input_terms_count / 8 + 1);
    return size;
}


text:
namespace YAF.Controls
{

    public partial class PMList
    {

        /// <summary>
        /// PagerTop control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.Pager PagerTop;

        /// <summary>
        /// Sort control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton Sort;

        /// <summary>
        /// SortFromAsc control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton SortFromAsc;

        /// <summary>
        /// SortFromDesc control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton SortFromDesc;

        /// <summary>
        /// SortSubjectAsc control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton SortSubjectAsc;

        /// <summary>
        /// SortSubjectDesc control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton SortSubjectDesc;

        /// <summary>
        /// SortDatedAsc control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton SortDatedAsc;

        /// <summary>
        /// SortDateDesc control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton SortDateDesc;

        /// <summary>
        /// Messages control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Repeater Messages;

        /// <summary>
        /// upPanExport control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel upPanExport;

        /// <summary>
        /// MarkAsRead control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton MarkAsRead;

        /// <summary>
        /// ArchiveSelected control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton ArchiveSelected;

        /// <summary>
        /// ArchiveAll control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton ArchiveAll;

        /// <summary>
        /// ExportSelected control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton ExportSelected;

        /// <summary>
        /// ExportAll control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton ExportAll;

        /// <summary>
        /// DeleteSelected control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton DeleteSelected;

        /// <summary>
        /// DeleteAll control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton DeleteAll;

        /// <summary>
        /// PagerBottom control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.Pager PagerBottom;

        /// <summary>
        /// lblExportType control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label lblExportType;

        /// <summary>
        /// ExportType control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RadioButtonList ExportType;

        /// <summary>
        /// NoMessage control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.Alert NoMessage;

        /// <summary>
        /// PMInfoLink control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label PMInfoLink;
    }
}


text:
<?php
namespace PSB\Core\Transport;

class TransportReceiver
{
    /**
     * @var MessagePusherInterface
     */
    private $messagePusher;

    /**
     * @var PushSettings
     */
    private $pushSettings;

    /**
     * @var PushPipe
     */
    private $pushPipe;

    /**
     * @param MessagePusherInterface $messagePusher
     * @param PushSettings           $pushSettings
     * @param PushPipe               $pushPipe
     */
    public function __construct(
        MessagePusherInterface $messagePusher,
        PushSettings $pushSettings,
        PushPipe $pushPipe
    ) {
        $this->messagePusher = $messagePusher;
        $this->pushSettings = $pushSettings;
        $this->pushPipe = $pushPipe;
    }

    public function start()
    {
        $this->messagePusher->init($this->pushPipe, $this->pushSettings);
        $this->messagePusher->start();
    }
}


text:
package it.tangodev.ble;

/**
 * Interface that describe the source of the data source of one Characteristic.
 * @author Tongo
 *
 */
public interface BleCharacteristicListener {
	public byte[] getValue();
	public void setValue(byte[] value);
}


text:
<?php

namespace Magento\Tax\Test\Handler\TaxRule;

use Magento\Tax\Test\Fixture\TaxRule;
use Magento\Mtf\Fixture\FixtureInterface;
use Magento\Mtf\Handler\Curl as AbstractCurl;
use Magento\Mtf\Util\Protocol\CurlTransport;
use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator;

/**
 * Curl handler for creating Tax Rule.
 */
class Curl extends AbstractCurl implements TaxRuleInterface
{
    /**
     * Default Tax Class values.
     *
     * @var array
     */
    protected $defaultTaxClasses = [
        'tax_customer_class' => 3, // Retail Customer
        'tax_product_class' => 2, // Taxable Goods
    ];

    /**
     * Post request for creating tax rule.
     *
     * @param FixtureInterface $fixture
     * @return array
     * @throws \Exception
     */
    public function persist(FixtureInterface $fixture = null)
    {
        /** @var TaxRule $fixture */
        $data = $this->prepareData($fixture);

        $url = $_ENV['app_backend_url'] . 'tax/rule/save/?back=1';
        $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
        $curl->addOption(CURLOPT_HEADER, 1);
        $curl->write($url, $data);
        $response = $curl->read();
        $curl->close();

        if (!strpos($response, 'data-ui-id="messages-message-success"')) {
            $this->_eventManager->dispatchEvent(['curl_failed'], [$response]);
            throw new \Exception("Tax rate creation by curl handler was not successful!");
        }

        preg_match("~Location: [^\s]*\/rule\/(\d+)~", $response, $matches);
        $id = isset($matches[1]) ? $matches[1] : null;

        return ['id' => $id];
    }

    /**
     * Returns data for Web API params.
     *
     * @param TaxRule $fixture
     * @return array
     */
    protected function prepareData(TaxRule $fixture)
    {
        $data = $fixture->getData();
        $data = $this->prepareFieldData($fixture, $data, 'tax_rate');
        $data = $this->prepareFieldData($fixture, $data, 'tax_product_class');
        $data = $this->prepareFieldData($fixture, $data, 'tax_customer_class');

        return $data;
    }

    /**
     * Prepare tax rule field data using new field.
     *
     * @param TaxRule $fixture
     * @param array $data
     * @param string $fixtureField
     * @param string $newField
     * @return array
     */
    public function prepareFieldData(TaxRule $fixture, array $data, $fixtureField, $newField = null)
    {
        $newField = $newField === null ? $fixtureField : $newField;
        unset($data[$fixtureField]);

        if (!$fixture->hasData($fixtureField)) {
            $data[$newField][] = $this->defaultTaxClasses[$fixtureField];
        } else {
            foreach ($fixture->getDataFieldConfig($fixtureField)['source']->getFixture() as $taxField) {
                if (!$taxField->hasData('id')) {
                    $taxField->persist();
                }
                $data[$newField][] = $taxField->getId();
            }
        }

        return $data;
    }
}


text:
// PathVisio,
// a tool for data visualization and analysis using Biological Pathways
// Copyright 2006-2011 BiGCaT Bioinformatics
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package org.pathvisio.gui;

import java.io.File;
import javax.swing.filechooser.FileFilter;

import org.pathvisio.core.model.PathwayIO;

/**
 * A filefilter that filters files for a given {@link PathwayImporter} or {@link PathwayExporter}.
 * Can be used to create a {@link FileDialog} for importers or exporters.
 * @author thomas
 */
public class PathwayFileFilter extends FileFilter {
	String[] exts;
	String name;

	public PathwayFileFilter(PathwayIO imp) {
		exts = imp.getExtensions();
		name = imp.getName();
	}

	public String getDefaultExtension() {
		return exts[0];
	}

	public boolean accept(File f) {
		if(f.isDirectory()) return true;

		String fn = f.toString();
		int i = fn.lastIndexOf('.');
		if(i > 0) {
			String ext = fn.substring(i + 1);
			for(String impExt : exts) {
				if(impExt.equalsIgnoreCase(ext)) {
					return true;
				}
			}
		}
		return false;
	}

	public String getDescription() {
		StringBuilder extstr = new StringBuilder();
		for(String e : exts) {
			extstr.append(".");
			extstr.append(e);
			extstr.append(", ");
		}
		String str = extstr.substring(0, extstr.length() - 2);
		return name + " (" + str + ")";
	}
}


text:
using System.Security.Claims;
using Microsoft.AspNetCore.Http;

namespace Microsoft.AspNetCore.Authentication;

/// <summary>
/// Base context for events that produce AuthenticateResults.
/// </summary>
public abstract class ResultContext<TOptions> : BaseContext<TOptions> where TOptions : AuthenticationSchemeOptions
{
    private AuthenticationProperties? _properties;

    /// <summary>
    /// Initializes a new instance of <see cref="ResultContext{TOptions}"/>.
    /// </summary>
    /// <param name="context">The context.</param>
    /// <param name="scheme">The authentication scheme.</param>
    /// <param name="options">The authentication options associated with the scheme.</param>
    protected ResultContext(HttpContext context, AuthenticationScheme scheme, TOptions options)
        : base(context, scheme, options) { }

    /// <summary>
    /// Gets or sets the <see cref="ClaimsPrincipal"/> containing the user claims.
    /// </summary>
    public ClaimsPrincipal? Principal { get; set; }

    /// <summary>
    /// Gets or sets the <see cref="AuthenticationProperties"/>.
    /// </summary>
    public AuthenticationProperties Properties
    {
        get
        {
            _properties ??= new AuthenticationProperties();
            return _properties;
        }
        set => _properties = value;
    }

    /// <summary>
    /// Gets the <see cref="AuthenticateResult"/> result.
    /// </summary>
    public AuthenticateResult Result { get; private set; } = default!;

    /// <summary>
    /// Calls success creating a ticket with the <see cref="Principal"/> and <see cref="Properties"/>.
    /// </summary>
    public void Success() => Result = HandleRequestResult.Success(new AuthenticationTicket(Principal!, Properties, Scheme.Name));

    /// <summary>
    /// Indicates that there was no information returned for this authentication scheme.
    /// </summary>
    public void NoResult() => Result = AuthenticateResult.NoResult();

    /// <summary>
    /// Indicates that there was a failure during authentication.
    /// </summary>
    /// <param name="failure"></param>
    public void Fail(Exception failure) => Result = AuthenticateResult.Fail(failure);

    /// <summary>
    /// Indicates that there was a failure during authentication.
    /// </summary>
    /// <param name="failureMessage"></param>
    public void Fail(string failureMessage) => Result = AuthenticateResult.Fail(failureMessage);
}


text:
.class public interface abstract Landroid/hardware/display/DisplayManager$DisplayListener;
.super Ljava/lang/Object;
.source "DisplayManager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/hardware/display/DisplayManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x609
    name = "DisplayListener"
.end annotation

# virtual methods
.method public abstract onDisplayAdded(I)V
.end method

.method public abstract onDisplayChanged(I)V
.end method

.method public abstract onDisplayRemoved(I)V
.end method


text:
    <java-class-file name="D:\Experiments\Analisi di Sopravvivenza\Progetto16715\ProgettiDaAnalizzare\jhotdraw\JHotDraw 7.4.1\JHotDraw 7.4.1\Source\jhotdraw7\src\main\java\org\jhotdraw\draw\tool\TextCreationTool.java">
        <package-decl name="org.jhotdraw.draw.tool"/>
        <class name="TextCreationTool" visibility="public">
            <constructor visibility="public" name="TextCreationTool">
            </constructor>
            <constructor visibility="public" name="TextCreationTool">
            </constructor>
            <method name="deactivate" visibility="public">
            </method>
            <method name="mousePressed" visibility="public">
            </method>
            <method name="mouseDragged" visibility="public">
            </method>
            <method name="beginEdit" visibility="protected">
            </method>
            <method name="mouseReleased" visibility="public">
            </method>
            <method name="endEdit" visibility="protected">
                                            <method name="getPresentationName" visibility="public">
                                            </method>
                                            <method name="undo" visibility="public">
                                            </method>
                                            <method name="redo" visibility="public">
                                            </method>
            </method>
            <method name="keyReleased" visibility="public">
            </method>
            <method name="actionPerformed" visibility="public">
            </method>
            <method name="creationFinished" visibility="protected">
            </method>
            <method name="isEditing" visibility="public">
            </method>
            <method name="updateCursor" visibility="public">
            </method>
        </class>
    </java-class-file>


text:
import os
from sys import argv

try:
    from SimpleHTTPServer import SimpleHTTPRequestHandler as Handler
    from SocketServer import TCPServer as Server
except ImportError:
    from http.server import SimpleHTTPRequestHandler as Handler
    from http.server import HTTPServer as Server

PORT = int(os.getenv('DRAGONVIEW_PORT', 8000))

DATA_DIR = 'sim'
if len(argv) == 2:
    DATA_DIR = argv[1]
#if DATA_DIR[-1:] != '/':
#    DATA_DIR += '/'

DATA_DIR = '/data/'+DATA_DIR

class MyHandler(Handler):
    def do_GET(self):
        print 'PATH: ', self.path[:5]
        if self.path[:5] == '/data':
            print 'path:', self.path
            self.path = DATA_DIR + self.path[5:]
            print 'new path:', self.path
        Handler.do_GET(self)

httpd = Server(("", PORT), MyHandler)
print 'Port %i \nDATA %s' % (PORT, DATA_DIR)
httpd.serve_forever()


text:
Twitter auto like bot

> Where does likelo's idea come from?
>
> I have a friend named [Arash](https://github.com/ara4sh)([AraaX on twitter](https://twitter.com/Ara4Sh)) who follows me in twitter,
> every time I post something or even reply to my friend,
> after a short period of time, I get a notification which says Arash liked my post or reply :)
>
> Likelo simulates Arash for your followers :))

## How To Start To Liking, Like A Bot :)

### Dependency
Note: You will need **[Go 1.7](https://golang.org/dl/)** or newer.

### Create a twitter application
While signed in under your Twitter account, visit [https://apps.twitter.com](https://apps.twitter.com).
Click Create an application.
Assign a name, description, and URL to the application. If you don't know the URL of your application yet, that's fine, you can change it later when you know (actually this is not required for likelo). Click the Yes, I agree check box, fill out the CAPTCHA, and click Create your Twitter application.
Once the application has successfully created, visit the Settings tab for the application. Select the Read and Write radio button and click Update this Twitter application's settings. This sets the proper permissions for the application to query and post new tweets to the account.
Visit the Keys and Access Tokens tab. Take note of the consumer key, consumer secret, access token, and access secret — you'll need these for likelo bot. If the access token/secret are not shown, click Create my access token at the bottom of the page.

> #### consumer key, consumer secret, access token, and access secret is required for using in likelo config.

### Download likelo
download likelo with go get

```bash
go get github.com/arastu/likelo
```

Copy sample config file(.likelo.config.sample.yaml) from likelo folder to your home folder and rename it to .likelo.yaml
```bash
cd $GOPATH/src/github.com/arastu/likelo
cp .likelo.config.sample.yaml $HOME/.likelo.yaml
```
    Then edit .likelo.yaml and add consumer key, consumer secret, access token, and access secret.

### Building from Source
```bash
cd $GOPATH/src/github.com/arastu/likelo
make likelo
```
This will create likelo binary executable file in $GOPATH/src/github.com/arastu/likelo folder.

### Run likelo
```bash
./likelo
Using config file: /Users/arastu/.likelo.yaml
Starting Stream...
```


text:
package org.shaolin.bmdp.runtime.mq;

import java.io.IOException;
import java.util.concurrent.CopyOnWriteArrayList;

import org.shaolin.bmdp.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.AMQP.BasicProperties;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Consumer;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;

public class RabbitMQExchanger implements Consumer {

	private static final Logger logger = LoggerFactory.getLogger(RabbitMQExchanger.class);

	private final String host;

	private final int port;

	private final String exchangeName;

	private final BuiltinExchangeType policy;

	private Channel channel;

	private final CopyOnWriteArrayList<String> requestAckQueue = new CopyOnWriteArrayList<String>();

	private RPCEventHandler eventHandler;

	public RabbitMQExchanger(String host, int port, String exchangeName, BuiltinExchangeType policy) throws Exception {
		this.host = host;
		this.port = port;
		this.exchangeName = exchangeName;
		this.policy = policy;
		init();
	}

	public RabbitMQExchanger(String host, int port, String exchangeName, BuiltinExchangeType policy, RPCEventHandler eventHandler) throws Exception {
		this.host = host;
		this.port = port;
		this.exchangeName = exchangeName;
		this.policy = policy;
		this.eventHandler = eventHandler;
		init();
	}

	private void init() throws Exception {
		ConnectionFactory factory = new ConnectionFactory();
		factory.setHost(host);
		factory.setPort(port);
		Connection connection = factory.newConnection();
		Channel channel = connection.createChannel();
		channel.exchangeDeclare(exchangeName, policy, true, false, null);
		this.channel = channel;
	}

	public void send(String message, BasicProperties property) throws Exception {
		channel.basicPublish(exchangeName, "", property, message.getBytes("UTF-8"));
		if (logger.isDebugEnabled()) {
			logger.debug("Sent a message: " + message);
		}
	}

	public void send(byte[] message, BasicProperties property) throws Exception {
		channel.basicPublish("", exchangeName, property, message);
		if (logger.isDebugEnabled()) {
			logger.debug("Sent a message: " + message);
		}
	}

	public void send(byte[] message, String topicKey, BasicProperties property) throws Exception {
		channel.basicPublish(exchangeName, topicKey, property, message);
		if (logger.isDebugEnabled()) {
			logger.debug("Sent a message: " + message + ",topicKey: " + topicKey);
		}
	}

	public void sendWithAck(String message, String topicKey, BasicProperties property) throws Exception {
		if (property.getCorrelationId() == null || property.getCorrelationId().length() ==0) {
			throw new IllegalArgumentException("CorrelationId must set for acknowlegal case!");
		}
		if (!requestAckQueue.addIfAbsent(property.getCorrelationId())) {
			throw new IllegalArgumentException("CorrelationId has duplicated! " + property.getCorrelationId());
		}

		channel.basicPublish(exchangeName, topicKey, property, message.getBytes("UTF-8"));
		if (logger.isDebugEnabled()) {
			logger.debug("Sent a message: " + message + ",topicKey: " + topicKey);
		}
	}

	public void send(JSONObject json, BasicProperties property) throws Exception {
		send(json.toString(), property);
	}

	public void close() {
		try {
			channel.getConnection().close();
		} catch (IOException e) {
			logger.warn("Failed to close RabbitMQ channel! msg: " + e.getMessage(), e);
		}
	}

	@Override
	public void handleConsumeOk(String consumerTag) {
	}
	@Override
	public void handleCancelOk(String consumerTag) {
	}
	@Override
	public void handleCancel(String consumerTag) throws IOException {
		logger.warn("handleCancel event! tag: " + consumerTag);
	}
	@Override
	public void handleDelivery(String consumerTag,
            Envelope envelope,
            AMQP.BasicProperties properties,
            byte[] body) throws IOException {
		if (requestAckQueue.contains(properties.getCorrelationId())) {
			eventHandler.notifyAcked(properties.getCorrelationId(), body);
        } else {
        	eventHandler.notifyDiscard(properties.getCorrelationId(), body);
        	logger.warn("response mismatching due to request id does not exist! correction id: " + properties.getCorrelationId());
        }
	}

	@Override
	public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) {

	}

	@Override
	public void handleRecoverOk(String consumerTag) {

	}
}


text:
0.0.3 / 2012-08-07
------------------
* Removed CoffeeScript dev dependence.
* Added `homedir()` method.


text:
#ifndef MIPS_TDEP_H
#define MIPS_TDEP_H

#include "objfiles.h"

struct gdbarch;

/* All the possible MIPS ABIs.  */
enum mips_abi
  {
    MIPS_ABI_UNKNOWN = 0,
    MIPS_ABI_N32,
    MIPS_ABI_O32,
    MIPS_ABI_N64,
    MIPS_ABI_O64,
    MIPS_ABI_EABI32,
    MIPS_ABI_EABI64,
    MIPS_ABI_LAST
  };

/* Return the MIPS ABI associated with GDBARCH.  */
enum mips_abi mips_abi (struct gdbarch *gdbarch);

/* Base and compressed MIPS ISA variations.  */
enum mips_isa
  {
    ISA_MIPS = -1,		/* mips_compression_string depends on it.  */
    ISA_MIPS16,
    ISA_MICROMIPS
  };

/* Return the MIPS ISA's register size.  Just a short cut to the BFD
   architecture's word size.  */
extern int mips_isa_regsize (struct gdbarch *gdbarch);

/* Return the current index for various MIPS registers.  */
struct mips_regnum
{
  int pc;
  int fp0;
  int fp_implementation_revision;
  int fp_control_status;
  int badvaddr;		/* Bad vaddr for addressing exception.  */
  int cause;		/* Describes last exception.  */
  int hi;		/* Multiply/divide temp.  */
  int lo;		/* ...  */
  int dspacc;		/* SmartMIPS/DSP accumulators.  */
  int dspctl;		/* DSP control.  */
};
extern const struct mips_regnum *mips_regnum (struct gdbarch *gdbarch);

/* Some MIPS boards don't support floating point while others only
   support single-precision floating-point operations.  */

enum mips_fpu_type
{
  MIPS_FPU_DOUBLE,		/* Full double precision floating point.  */
  MIPS_FPU_SINGLE,		/* Single precision floating point (R4650).  */
  MIPS_FPU_NONE			/* No floating point.  */
};

/* MIPS specific per-architecture information.  */
struct gdbarch_tdep
{
  /* from the elf header */
  int elf_flags;

  /* mips options */
  enum mips_abi mips_abi;
  enum mips_abi found_abi;
  enum mips_isa mips_isa;
  enum mips_fpu_type mips_fpu_type;
  int mips_last_arg_regnum;
  int mips_last_fp_arg_regnum;
  int default_mask_address_p;
  /* Is the target using 64-bit raw integer registers but only
     storing a left-aligned 32-bit value in each?  */
  int mips64_transfers_32bit_regs_p;
  /* Indexes for various registers.  IRIX and embedded have
     different values.  This contains the "public" fields.  Don't
     add any that do not need to be public.  */
  const struct mips_regnum *regnum;
  /* Register names table for the current register set.  */
  const char **mips_processor_reg_names;

  /* The size of register data available from the target, if known.
     This doesn't quite obsolete the manual
     mips64_transfers_32bit_regs_p, since that is documented to force
     left alignment even for big endian (very strange).  */
  int register_size_valid_p;
  int register_size;

  /* General-purpose registers.  */
  struct regset *gregset;
  struct regset *gregset64;

  /* Floating-point registers.  */
  struct regset *fpregset;
  struct regset *fpregset64;

  /* Return the expected next PC if FRAME is stopped at a syscall
     instruction.  */
  CORE_ADDR (*syscall_next_pc) (struct frame_info *frame);
};

/* Register numbers of various important registers.  */

enum
{
  MIPS_ZERO_REGNUM = 0,		/* Read-only register, always 0.  */
  MIPS_AT_REGNUM = 1,
  MIPS_V0_REGNUM = 2,		/* Function integer return value.  */
  MIPS_A0_REGNUM = 4,		/* Loc of first arg during a subr call.  */
  MIPS_S0_REGNUM = 16,
  MIPS_S1_REGNUM = 17,
  MIPS_S2_REGNUM = 18,		/* Contains return address in MIPS16 thunks. */
  MIPS_S3_REGNUM = 19,
  MIPS_S4_REGNUM = 20,
  MIPS_S5_REGNUM = 21,
  MIPS_S6_REGNUM = 22,
  MIPS_S7_REGNUM = 23,
  MIPS_T8_REGNUM = 24,
  MIPS_T9_REGNUM = 25,		/* Contains address of callee in PIC.  */
  MIPS_GP_REGNUM = 28,
  MIPS_SP_REGNUM = 29,
  MIPS_S8_REGNUM = 30,
  MIPS_RA_REGNUM = 31,
  MIPS_PS_REGNUM = 32,		/* Contains processor status.  */
  MIPS_EMBED_LO_REGNUM = 33,
  MIPS_EMBED_HI_REGNUM = 34,
  MIPS_EMBED_BADVADDR_REGNUM = 35,
  MIPS_EMBED_CAUSE_REGNUM = 36,
  MIPS_EMBED_PC_REGNUM = 37,
  MIPS_EMBED_FP0_REGNUM = 38,
  MIPS_UNUSED_REGNUM = 73,	/* Never used, FIXME.  */
  MIPS_FIRST_EMBED_REGNUM = 74,	/* First CP0 register for embedded use.  */
  MIPS_PRID_REGNUM = 89,	/* Processor ID.  */
  MIPS_LAST_EMBED_REGNUM = 89	/* Last one.  */
};

/* Defined in mips-tdep.c and used in remote-mips.c.  */
extern void deprecated_mips_set_processor_regs_hack (void);

/* Instruction sizes and other useful constants.  */
enum
{
  MIPS_INSN16_SIZE = 2,
  MIPS_INSN32_SIZE = 4,
  /* The number of floating-point or integer registers.  */
  MIPS_NUMREGS = 32
};

/* Single step based on where the current instruction will take us.  */
extern int mips_software_single_step (struct frame_info *frame);

/* Tell if the program counter value in MEMADDR is in a standard
   MIPS function.  */
extern int mips_pc_is_mips (bfd_vma memaddr);

/* Tell if the program counter value in MEMADDR is in a MIPS16
   function.  */
extern int mips_pc_is_mips16 (struct gdbarch *gdbarch, bfd_vma memaddr);

/* Tell if the program counter value in MEMADDR is in a microMIPS
   function.  */
extern int mips_pc_is_micromips (struct gdbarch *gdbarch, bfd_vma memaddr);

/* Return the currently configured (or set) saved register size.  */
extern unsigned int mips_abi_regsize (struct gdbarch *gdbarch);

/* Make PC the address of the next instruction to execute.  */
extern void mips_write_pc (struct regcache *regcache, CORE_ADDR pc);

/* Target descriptions which only indicate the size of general
   registers.  */
extern struct target_desc *mips_tdesc_gp32;
extern struct target_desc *mips_tdesc_gp64;

/* Return non-zero if PC is in a MIPS SVR4 lazy binding stub section.  */

static inline int
in_mips_stubs_section (CORE_ADDR pc)
{
  return pc_in_section (pc, ".MIPS.stubs");
}

#endif /* MIPS_TDEP_H */


text:
package com.intellij.openapi.externalSystem.service.project.manage;

import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.externalSystem.model.DataNode;
import com.intellij.openapi.externalSystem.model.Key;
import com.intellij.openapi.externalSystem.model.ProjectKeys;
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
import com.intellij.openapi.externalSystem.model.project.ContentRootData;
import com.intellij.openapi.externalSystem.model.project.ContentRootData.SourceRoot;
import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType;
import com.intellij.openapi.externalSystem.model.project.ModuleData;
import com.intellij.openapi.externalSystem.service.project.PlatformFacade;
import com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings;
import com.intellij.openapi.externalSystem.settings.ExternalProjectSettings;
import com.intellij.openapi.externalSystem.util.DisposeAwareProjectChange;
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
import com.intellij.openapi.externalSystem.util.ExternalSystemConstants;
import com.intellij.openapi.externalSystem.util.Order;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ContentEntry;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ModuleRootModificationUtil;
import com.intellij.openapi.roots.SourceFolder;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
import com.intellij.util.containers.ContainerUtilRt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.java.JavaModuleSourceRootTypes;
import org.jetbrains.jps.model.java.JavaResourceRootType;
import org.jetbrains.jps.model.java.JavaSourceRootProperties;
import org.jetbrains.jps.model.java.JavaSourceRootType;
import org.jetbrains.jps.model.module.JpsModuleSourceRootType;

import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * Thread-safe.
 *
 * @author Denis Zhdanov
 * @since 2/7/12 3:20 PM
 */
@Order(ExternalSystemConstants.BUILTIN_SERVICE_ORDER)
public class ContentRootDataService implements ProjectDataServiceEx<ContentRootData, ContentEntry> {

  private static final Logger LOG = Logger.getInstance("#" + ContentRootDataService.class.getName());

  @NotNull
  @Override
  public Key<ContentRootData> getTargetDataKey() {
    return ProjectKeys.CONTENT_ROOT;
  }

  public void importData(@NotNull final Collection<DataNode<ContentRootData>> toImport,
                         @NotNull final Project project,
                         final boolean synchronous) {
    final PlatformFacade platformFacade = ServiceManager.getService(PlatformFacade.class);
    importData(toImport, project, platformFacade, synchronous);
  }

  @Override
  public void importData(@NotNull final Collection<DataNode<ContentRootData>> toImport,
                         @NotNull final Project project,
                         @NotNull final PlatformFacade platformFacade,
                         final boolean synchronous) {
    if (toImport.isEmpty()) {
      return;
    }

    Map<DataNode<ModuleData>, List<DataNode<ContentRootData>>> byModule = ExternalSystemApiUtil.groupBy(toImport, ProjectKeys.MODULE);
    for (Map.Entry<DataNode<ModuleData>, List<DataNode<ContentRootData>>> entry : byModule.entrySet()) {
      final Module module = platformFacade.findIdeModule(entry.getKey().getData(), project);
      if (module == null) {
        LOG.warn(String.format(
          "Can't import content roots. Reason: target module (%s) is not found at the ide. Content roots: %s",
          entry.getKey(), entry.getValue()
        ));
        continue;
      }
      importData(entry.getValue(), module, synchronous);
    }
  }

  private static void importData(@NotNull final Collection<DataNode<ContentRootData>> data,
                                 @NotNull final Module module,
                                 boolean synchronous) {
    ExternalSystemApiUtil.executeProjectChangeAction(synchronous, new DisposeAwareProjectChange(module) {
      @Override
      public void execute() {
        ModuleRootModificationUtil.updateModel(module, new Consumer<ModifiableRootModel>() {
          @Override
          public void consume(ModifiableRootModel model) {
            final ContentEntry[] contentEntries = model.getContentEntries();
            final Map<String, ContentEntry> contentEntriesMap = ContainerUtilRt.newHashMap();
            for(ContentEntry contentEntry : contentEntries) {
              contentEntriesMap.put(contentEntry.getUrl(), contentEntry);
            }

            boolean createEmptyContentRootDirectories = false;
            if (!data.isEmpty()) {
              ProjectSystemId projectSystemId = data.iterator().next().getData().getOwner();
              AbstractExternalSystemSettings externalSystemSettings =
                ExternalSystemApiUtil.getSettings(module.getProject(), projectSystemId);

              String path = module.getOptionValue(ExternalSystemConstants.ROOT_PROJECT_PATH_KEY);
              if (path != null) {
                ExternalProjectSettings projectSettings = externalSystemSettings.getLinkedProjectSettings(path);
                createEmptyContentRootDirectories = projectSettings != null && projectSettings.isCreateEmptyContentRootDirectories();
              }
            }

            for (final DataNode<ContentRootData> node : data) {
              final ContentRootData contentRoot = node.getData();

              final ContentEntry contentEntry = findOrCreateContentRoot(model, contentRoot.getRootPath());
              contentEntry.clearExcludeFolders();
              contentEntry.clearSourceFolders();
              LOG.info(String.format("Importing content root '%s' for module '%s'", contentRoot.getRootPath(), module.getName()));
              for (SourceRoot path : contentRoot.getPaths(ExternalSystemSourceType.SOURCE)) {
                createSourceRootIfAbsent(contentEntry, path, module.getName(), JavaSourceRootType.SOURCE, false, createEmptyContentRootDirectories);
              }
              for (SourceRoot path : contentRoot.getPaths(ExternalSystemSourceType.TEST)) {
                createSourceRootIfAbsent(contentEntry, path, module.getName(), JavaSourceRootType.TEST_SOURCE, false, createEmptyContentRootDirectories);
              }
              for (SourceRoot path : contentRoot.getPaths(ExternalSystemSourceType.RESOURCE)) {
                createSourceRootIfAbsent(contentEntry, path, module.getName(), JavaResourceRootType.RESOURCE, false, createEmptyContentRootDirectories);
              }
              for (SourceRoot path : contentRoot.getPaths(ExternalSystemSourceType.TEST_RESOURCE)) {
                createSourceRootIfAbsent(contentEntry, path, module.getName(), JavaResourceRootType.TEST_RESOURCE, false, createEmptyContentRootDirectories);
              }
              for (SourceRoot path : contentRoot.getPaths(ExternalSystemSourceType.SOURCE_GENERATED)) {
                createSourceRootIfAbsent(contentEntry, path, module.getName(), JavaSourceRootType.SOURCE, true, createEmptyContentRootDirectories);
              }
              for (SourceRoot path : contentRoot.getPaths(ExternalSystemSourceType.TEST_GENERATED)) {
                createSourceRootIfAbsent(contentEntry, path, module.getName(), JavaSourceRootType.TEST_SOURCE, true, createEmptyContentRootDirectories);
              }
              for (SourceRoot path : contentRoot.getPaths(ExternalSystemSourceType.EXCLUDED)) {
                createExcludedRootIfAbsent(contentEntry, path, module.getName(), module.getProject());
              }
              contentEntriesMap.remove(contentEntry.getUrl());
            }
            for(ContentEntry contentEntry : contentEntriesMap.values()) {
              model.removeContentEntry(contentEntry);
            }
          }
        });
      }
    });
  }

  @NotNull
  private static ContentEntry findOrCreateContentRoot(@NotNull ModifiableRootModel model, @NotNull String path) {
    ContentEntry[] entries = model.getContentEntries();

    for (ContentEntry entry : entries) {
      VirtualFile file = entry.getFile();
      if (file == null) {
        continue;
      }
      if (ExternalSystemApiUtil.getLocalFileSystemPath(file).equals(path)) {
        return entry;
      }
    }
    return model.addContentEntry(toVfsUrl(path));
  }

  private static void createSourceRootIfAbsent(
    @NotNull ContentEntry entry, @NotNull SourceRoot root, @NotNull String moduleName,
    @NotNull JpsModuleSourceRootType sourceRootType, boolean generated, boolean createEmptyContentRootDirectories) {
    List<SourceFolder> folders = entry.getSourceFolders(sourceRootType);
    for (SourceFolder folder : folders) {
      VirtualFile file = folder.getFile();
      if (file == null) {
        continue;
      }
      if (ExternalSystemApiUtil.getLocalFileSystemPath(file).equals(root.getPath())) {
        return;
      }
    }
    LOG.info(String.format("Importing %s for content root '%s' of module '%s'", root, entry.getUrl(), moduleName));
    SourceFolder sourceFolder = entry.addSourceFolder(toVfsUrl(root.getPath()), sourceRootType);
    if (!StringUtil.isEmpty(root.getPackagePrefix())) {
      sourceFolder.setPackagePrefix(root.getPackagePrefix());
    }
    if (generated) {
      JavaSourceRootProperties properties = sourceFolder.getJpsElement().getProperties(JavaModuleSourceRootTypes.SOURCES);
      if(properties != null) {
        properties.setForGeneratedSources(true);
      }
    }
    if(createEmptyContentRootDirectories) {
      try {
        VfsUtil.createDirectoryIfMissing(root.getPath());
      }
      catch (IOException e) {
        LOG.warn(String.format("Unable to create directory for the path: %s", root.getPath()), e);
      }
    }
  }

  private static void createExcludedRootIfAbsent(@NotNull ContentEntry entry, @NotNull SourceRoot root, @NotNull String moduleName, @NotNull Project project) {
    String rootPath = root.getPath();
    for (VirtualFile file : entry.getExcludeFolderFiles()) {
      if (ExternalSystemApiUtil.getLocalFileSystemPath(file).equals(rootPath)) {
        return;
      }
    }
    LOG.info(String.format("Importing excluded root '%s' for content root '%s' of module '%s'", root, entry.getUrl(), moduleName));
    entry.addExcludeFolder(toVfsUrl(rootPath));
    if (!Registry.is("ide.hide.excluded.files")) {
      ChangeListManager.getInstance(project).addDirectoryToIgnoreImplicitly(rootPath);
    }
  }

  @Override
  public void removeData(@NotNull Collection<? extends ContentEntry> toRemove, @NotNull Project project, boolean synchronous) {
  }

  @Override
  public void removeData(@NotNull Collection<? extends ContentEntry> toRemove,
                         @NotNull Project project,
                         @NotNull PlatformFacade platformFacade,
                         boolean synchronous) {
  }

  private static String toVfsUrl(@NotNull String path) {
    return LocalFileSystem.PROTOCOL_PREFIX + path;
  }
}


text:
/**
 * Created by Prescott on 2014. 9. 5..
 */

var page = require('webpage').create(),
    memoryMeter = require('./'),
    url = 'http://www.phantomjs.org/';

console.log( memoryMeter.toHumanReadSize(1024*1024) ); // equals 1MB
memoryMeter.logUsedMemory(null, "Phantom:Init");

memoryMeter.getUsedMemoryByte(null, function (err, size, pid) {
    if(err) {
        throw err;
    }
    console.log("PhantomJS Executed (size: " + size + ", pid: " + pid + ")");
});

page.open(url, function (status) {
    memoryMeter.getUsedMemoryHumanSize(null, function (err, size, pid) {
        console.log("Page is loaded! (status: " + status + ", memSize: " + size + ", pid: " + pid + ")");

    });

});


text:
module.exports = {
  root: true,
  parserOptions: {
    ecmaVersion: 2017,
    sourceType: 'module'
  },
  extends: [
    'eslint:recommended',
    'plugin:ember-suave/recommended'
  ],
  env: {
    browser: true
  },
  rules: {
    'ember-suave/no-direct-property-access': 0
  }
};


text:
package io.github.bckfnn.taggersty;

/**
 * Output interface for taggersty.
 */
public interface TagsOutput {

    /**
     * Emit a String.
     * @param s the value
     */
    public void write(String s);

    /**
     * Emit a char array.
     * @param s the value
     */
    public void write(char[] s);

    /**
     * Emit a single character.
     * @param c the value
     */
    public void write(char c);

    /**
     * Flush the accumulated output.
     */
    public void flush();

    /**
     * Close the output.
     */
    public void close();

}


text:
/*******************************************************************
 *
 * A Common Lisp compiler/interpretor, written in Prolog
 *
 * (symbol_places.pl)
 *
 *
 * Douglas'' Notes:
 *
 * (c) Douglas Miles, 2017
 *
 * The program is a *HUGE* common-lisp compiler/interpreter. It is written for YAP/SWI-Prolog .
 *
 *******************************************************************/
:- module(aray, []).

:- include('./header').

% make-array dimensions &key element-type initial-element initial-contents adjustable fill-pointer displaced-to displaced-index-offset

f_adjustable_array_p(Obj,RetVal):-
  t_or_nil(get_opv(Obj,adjustable,t),RetVal).

f_array_dimensions(Obj,RetVal):- always(get_opv(Obj,dims,RetVal)).
f_array_dimension(Obj,Axis,RetVal):- get_opv(Obj,dims,Elements),nth0(Axis,Elements,RetVal).

wl:init_args(1,aref).
f_aref(Obj,Indexes,RetVal):- get_adata(Obj,Elements),!,nth_index(Indexes,Elements,RetVal).
f_aset(Obj,Indexes,Value,RetVal):- get_adata(Obj,Elements),!,set_nth_index(Indexes,Elements,Value,RetVal).
%f_aref(Elements,Index,RetVal):- f_nthcdr(Elements,Index,RetVal).

get_adata('$ARRAY'(_,_,Elements),Elements):- !,nonvar(Elements).
get_adata('$OBJ'(_,Value),Elements):- !,nonvar(Value),get_adata(Value,Elements).
get_adata(Elements,Elements):- is_list(Elements),!.
get_adata(Obj,Elements):- get_opv(Obj,data,Elements),!.
get_adata(Obj,Elements):- get_opv(Obj,array,Array),!,get_adata(Array,Elements).
get_adata(Obj,Elements):- get_opv(Obj,dims,Indexes),!,
   create_array_data(Indexes,Data),
   set_opv(Obj,data,Data),get_opv(Obj,data,Elements).
get_adata(Obj,Elements):- get_opv(Obj,value,Data),!,get_adata(Data,Elements).

create_array_data([Len|Indexes],Obj):-
   create_array_data(Indexes,Elements),!,
   init_list_with_copy_data(Len,Elements,Obj).
create_array_data([],[]).
create_array_data(Len,Elements):-
  init_list_with_copy_data(Len,[],Elements).

init_list_with_copy_data(0,_,[]):-!.
init_list_with_copy_data(Len,Elements,[CData|Obj]):-
  copy_term(Elements,CData),
  LenM is Len-1,
  init_list_with_copy_data(LenM,Elements,Obj).

% svref simple-vector index => element
% (setf (svref simple-vector index) new-element)

wl:init_args(0,make_array).
f_make_array(Dims,RetVal):- listify(Dims,DimsL),
 create_object(claz_array,[dims=DimsL],RetVal).
f_make_array(Dims,Keys,RetVal):- listify(Dims,DimsL),
 create_object(claz_array,[dims=DimsL|Keys],RetVal).

wl:init_args(0,vector).
f_vector(Size,RetVal):-
 create_array_data([Size],Elements),
 create_struct(claz_array,[dims=[Size],data=Elements],RetVal).

% GROVELED f_vectorp(Obj,RetVal):- t_or_nil(is_vectorp(Obj),RetVal).
% GROVELED f_arrayp(Obj,RetVal):- t_or_nil(is_arrayp(Obj),RetVal).

is_vectorp(Obj):- get_opv(Obj,dims,Dims),Dims=[_].
is_arrayp(Obj):- get_opv(Obj,type_of,array).

:- fixup_exports.


text:
This example deploys [CockroachDB](https://cockroachlabs.com) on Kubernetes as
a PetSet. CockroachDB is a distributed, scalable NewSQL database. Please see
[the homepage](https://cockroachlabs.com) and the
[documentation](https://www.cockroachlabs.com/docs/) for details.

## Limitations

### PetSet limitations

Standard PetSet limitations apply: There is currently no possibility to use
node-local storage (outside of single-node tests), and so there is likely
a performance hit associated with running CockroachDB on some external storage.
Note that CockroachDB already does replication and thus should not be deployed on
a persistent volume which already replicates internally.
High-performance use cases on a private Kubernetes cluster should consider
a DaemonSet deployment.

### Recovery after persistent storage failure

A persistent storage failure (e.g. losing the hard drive) is gracefully handled
by CockroachDB as long as enough replicas survive (two out of three by
default). Due to the bootstrapping in this deployment, a storage failure of the
first node is special in that the administrator must manually prepopulate the
"new" storage medium by running an instance of CockroachDB with the `--join`
parameter. If this is not done, the first node will bootstrap a new cluster,
which will lead to a lot of trouble.

### Dynamic provisioning

The deployment is written for a use case in which dynamic provisioning is
available. When that is not the case, the persistent volume claims need
to be created manually. See [minikube.sh](minikube.sh) for the necessary
steps.

## Testing locally on minikube

Follow the steps in [minikube.sh](minikube.sh) (or simply run that file).

## Accessing the database

Along with our PetSet configuration, we expose a standard Kubernetes service
that offers a load-balanced virtual IP for clients to access the database
with. In our example, we've called this service `cockroachdb-public`.

Start up a client pod and open up an interactive, (mostly) Postgres-flavor
SQL shell using:

```console
$ kubectl run -it cockroach-client --image=cockroachdb/cockroach --restart=Never --command -- bash
root@cockroach-client # ./cockroach sql --host cockroachdb-public
```

You can see example SQL statements for inserting and querying data in the
included [demo script](demo.sh), but can use almost any Postgres-style SQL
commands. Some more basic examples can be found within
[CockroachDB's documentation](https://www.cockroachlabs.com/docs/learn-cockroachdb-sql.html).

## Simulating failures

When all (or enough) nodes are up, simulate a failure like this:

```shell
kubectl exec cockroachdb-0 -- /bin/bash -c "while true; do kill 1; done"
```

You can then reconnect to the database as demonstrated above and verify
that no data was lost. The example runs with three-fold replication, so
it can tolerate one failure of any given node at a time. Note also that
there is a brief period of time immediately after the creation of the
cluster during which the three-fold replication is established, and during
which killing a node may lead to unavailability.

The [demo script](demo.sh) gives an example of killing one instance of the
database and ensuring the other replicas have all data that was written.

## Scaling up or down

Simply edit the PetSet (but note that you may need to create a new persistent
volume claim first). If you ran `minikube.sh`, there's a spare volume so you
can immediately scale up by one. Convince yourself that the new node
immediately serves reads and writes.

## Cleaning up when you're done

Because all of the resources in this example have been tagged with the label `app=cockroachdb`,
we can clean up everything that we created in one quick command using a selector on that label:

```shell
kubectl delete petsets,pods,persistentvolumes,persistentvolumeclaims,services -l app=cockroachdb
```

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/cockroachdb/README.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->


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

	    <title>#title#</title>#include#
	    <link rel="stylesheet" href="#path#/css/colorbox.css" />

#header#

           #navi#

          #posts#

                                                            #poo#

#footer#

         #editor#


text:
<template>

            Back

Text Editor

Framework7 comes with a touch-friendly Rich Text Editor component. It is based on modern "contenteditable" API so it should work everywhere as is.

It comes with the basic set of formatting features. But its functionality can be easily extended and customized to fit any requirements.

Default Setup

With Placeholder

With Default Value

Lorem, ipsum dolor sit amet consectetur adipisicing elit. Consequatur sunt, sapiente quis eligendi consectetur hic asperiores assumenda quidem dolore quasi iusto tenetur commodi qui ullam sint sed alias! Consequatur, dolor!

Provident reiciendis exercitationem reprehenderit amet repellat laborum, sequi id quam quis quo quos facere veniam ad libero dolorum animi. Nobis, illum culpa explicabo dolorem vitae ut dolor at reprehenderit magnam?

Qui, animi. Dolores dicta, nobis aut expedita enim eum assumenda modi, blanditiis voluptatibus excepturi non pariatur. Facilis fugit facere sequi molestias nemo in, suscipit inventore consequuntur, repellat perferendis, voluptas odit.

Tempora voluptates, doloribus architecto eligendi numquam facilis perspiciatis autem quam voluptas maxime ratione harum laudantium cum deleniti. In, alias deserunt voluptatibus eligendi libero nobis est unde et perspiciatis cumque voluptatum.

Quam error doloribus qui laboriosam eligendi. Aspernatur quam pariatur perspiciatis reprehenderit atque dicta culpa, aut rem? Assumenda, quibusdam? Reprehenderit necessitatibus facere nemo iure maiores porro voluptates accusamus quibusdam. Nesciunt, assumenda?

Specific Buttons

It is possible to customize which buttons (commands) to show.

Custom Button

It is possible to create custom editor buttons. Here is the custom "hr" button that adds horizontal rule:

Resizable

Editor will be resized based on its content.

Popover Mode

In this mode, there is no toolbar with buttons, but they appear as popover when you select any text in editor.

Keyboard Toolbar Mode

In this mode, toolbar with buttons will appear on top of virtual keyboard when editor is in the focus. It is supported only in iOS, Android cordova apps and in Android Chrome. When not supported it will fallback to "popover" mode.

As List Input

Text editor can be used in list with other inputs. In this example it is enabled with "keyboard-toolbar"/"popover" type for "About" field.

Name

                <input type="text" placeholder="Your name">

About

</template>


text:
module Octokit
  class Client
    # Methods for the Repository Statistics API
    #
    # @see https://developer.github.com/v3/repos/statistics/
    module Stats
      # Get contributors list with additions, deletions, and commit counts
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @option retry_timeout [Number] How long Octokit should keep trying to get stats (in seconds)
      # @option retry_wait [Number] How long Octokit should wait between retries.
      # @return [Array<Sawyer::Resource>] Array of contributor stats
      # @see https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts
      # @example Get contributor stats for octokit
      #   @client.contributors_stats('octokit/octokit.rb')
      def contributors_stats(repo, options = {})
        get_stats(repo, 'contributors', options)
      end
      alias contributor_stats contributors_stats

      # Get the last year of commit activity data
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @option retry_timeout [Number] How long Octokit should keep trying to get stats (in seconds)
      # @option retry_wait [Number] How long Octokit should wait between retries.
      # @return [Array<Sawyer::Resource>] The last year of commit activity grouped by
      #   week. The days array is a group of commits per day, starting on Sunday.
      # @see https://developer.github.com/v3/repos/statistics/#get-the-last-year-of-commit-activity-data
      # @example Get commit activity for octokit
      #   @client.commit_activity_stats('octokit/octokit.rb')
      def commit_activity_stats(repo, options = {})
        get_stats(repo, 'commit_activity', options)
      end

      # Get the number of additions and deletions per week
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @option retry_timeout [Number] How long Octokit should keep trying to get stats (in seconds)
      # @option retry_wait [Number] How long Octokit should wait between retries.
      # @return [Array<Sawyer::Resource>] Weekly aggregate of the number of additions
      #   and deletions pushed to a repository.
      # @see https://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week
      # @example Get code frequency stats for octokit
      #   @client.code_frequency_stats('octokit/octokit.rb')
      def code_frequency_stats(repo, options = {})
        get_stats(repo, 'code_frequency', options)
      end

      # Get the weekly commit count for the repo owner and everyone else
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @option retry_timeout [Number] How long Octokit should keep trying to get stats (in seconds)
      # @option retry_wait [Number] How long Octokit should wait between retries.
      # @return [Sawyer::Resource] Total commit counts for the owner and total commit
      #   counts in all. all is everyone combined, including the owner in the last
      #   52 weeks. If you'd like to get the commit counts for non-owners, you can
      #   subtract all from owner.
      # @see https://developer.github.com/v3/repos/statistics/#get-the-weekly-commit-count-for-the-repository-owner-and-everyone-else
      # @example Get weekly commit counts for octokit
      #   @client.participation_stats("octokit/octokit.rb")
      def participation_stats(repo, options = {})
        get_stats(repo, 'participation', options)
      end

      # Get the number of commits per hour in each day
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @option retry_timeout [Number] How long Octokit should keep trying to get stats (in seconds)
      # @option retry_wait [Number] How long Octokit should wait between retries.
      # @return [Array<Array>] Arrays containing the day number, hour number, and
      #   number of commits
      # @see https://developer.github.com/v3/repos/statistics/#get-the-number-of-commits-per-hour-in-each-day
      # @example Get octokit punch card
      #   @octokit.punch_card_stats
      def punch_card_stats(repo, options = {})
        get_stats(repo, 'punch_card', options)
      end
      alias punch_card punch_card_stats

      private

      # @private Get stats for a repository
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @param metric [String] The metrics you are looking for
      # @return [Array<Sawyer::Resource> or nil] Stats in metric-specific format, or nil if not yet calculated.
      # @see https://developer.github.com/v3/repos/statistics/
      def get_stats(repo, metric, options = {})
        options = options.dup
        if retry_timeout = options.delete(:retry_timeout)
          retry_wait = options.delete(:retry_wait) || 0.5
          timeout = Time.now + retry_timeout
        end
        loop do
          data = get("#{Repository.path repo}/stats/#{metric}", options)
          return data if last_response.status == 200
          return [] if last_response.status == 204
          return nil unless retry_timeout
          return nil if Time.now >= timeout

          sleep retry_wait if retry_wait
        end
      end
    end
  end
end


text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration
  PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
  <session-factory>

  	<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

    <property name="hibernate.generate_statistics">true</property>
    <property name="hibernate.cache.use_query_cache">true</property>

    <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
    <property name="connection.url">jdbc:hsqldb:hsql://localhost:9001/hibernate</property>
    <property name="connection.username">hibuser</property>
    <property name="connection.password">password</property>
    <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
    <property name="connection.pool_size">10</property>
    <property name="show_sql">false</property>
    <property name="hibernate.jdbc.use_streams_for_binary">true</property>
    <!-- replaces DefinitionVersionManager -->
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!-- load resource from classpath -->
    <mapping resource="hibernate/hsql.hbm.xml" />
    <!--  This is only used by Pentaho Administration Console. Spring Security will not use these mapping files -->
    <mapping resource="PentahoUser.hbm.xml" />
    <mapping resource="PentahoRole.hbm.xml" />
    <mapping resource="PentahoUserRoleMapping.hbm.xml" />

  </session-factory>
</hibernate-configuration>


text:
package jeffaschenk.commons.standards.statecodes;

import jeffaschenk.commons.standards.CountryCode;

/**
 * Official ISO-3166 State/Province Codes
 * <p/>
 * Country: Seychelles
 *
 * @author jeffaschenk@gmail.com
 *         Date: May 19, 2010
 *         Time: 12:12:11 PM
 */
@SuppressWarnings("unused")
public enum StateCodes_SC {
    /**
     * State Code Enumerator
     */
    SC_01("Anse aux Pins","SC-01","District","18014", CountryCode.SEYCHELLES),
    SC_02("Anse Boileau","SC-02","District","18017",CountryCode.SEYCHELLES),
    SC_04("Anse Louis","SC-04","District","18019",CountryCode.SEYCHELLES),
    SC_05("Anse Royale","SC-05","District","18015",CountryCode.SEYCHELLES),
    SC_03("Anse \u0233toile","SC-03","District","18018",CountryCode.SEYCHELLES),
    SC_06("Baie Lazare","SC-06","District","18006",CountryCode.SEYCHELLES),
    SC_07("Baie Sainte Anne","SC-07","District","18020",CountryCode.SEYCHELLES),
    SC_08("Beau Vallon","SC-08","District","18021",CountryCode.SEYCHELLES),
    SC_09("Bel Air","SC-09","District","18025",CountryCode.SEYCHELLES),
    SC_10("Bel Ombre","SC-10","District","18022",CountryCode.SEYCHELLES),
    SC_11("Cascade","SC-11","District","18029",CountryCode.SEYCHELLES),
    SC_12("Glacis","SC-12","District","18024",CountryCode.SEYCHELLES),
    SC_13("Grand' Anse (Mah\u0233)","SC-13","District","18028",CountryCode.SEYCHELLES),
    SC_14("Grand' Anse (Praslin)","SC-14","District","18007",CountryCode.SEYCHELLES),
    SC_15("La Digue","SC-15","District","18027",CountryCode.SEYCHELLES),
    SC_16("La Rivi\u0232re Anglaise","SC-16","District","18023",CountryCode.SEYCHELLES),
    SC_17("Mont Buxton","SC-17","District","18009",CountryCode.SEYCHELLES),
    SC_18("Mont Fleuri","SC-18","District","18030",CountryCode.SEYCHELLES),
    SC_19("Plaisance","SC-19","District","18026",CountryCode.SEYCHELLES),
    SC_20("Pointe La Rue","SC-20","District","18011",CountryCode.SEYCHELLES),
    SC_21("Port Glaud","SC-21","District","18012",CountryCode.SEYCHELLES),
    SC_22("Saint Louis","SC-22","District","18013",CountryCode.SEYCHELLES),
    SC_23("Takamaka","SC-23","District","18005",CountryCode.SEYCHELLES);

    // *************************************
    // Common Enum Structure for all
    // States of the World
    private final String stateProvinceName;

    private final String stateCode;

    private final String stateProvinceType;

    private final String stateNumericCode;

    private final CountryCode countryCode;

    StateCodes_SC(String stateProvinceName, String stateCode, String stateProvinceType, String stateNumericCode, CountryCode countryCode) {
        this.stateProvinceName = stateProvinceName;
        this.stateCode = stateCode;
        this.stateProvinceType = stateProvinceType;
        this.stateNumericCode = stateNumericCode;
        this.countryCode = countryCode;
    }

    public String stateProvinceName() {
        return this.stateProvinceName;
    }

    public String stateCode() {
        return this.stateCode;
    }

    public String stateProvinceType() {
        return this.stateProvinceType;
    }

    public String stateNumericCode() {
        return this.stateNumericCode;
    }

    public CountryCode countryCode() {
        return this.countryCode;
    }

}