text:
<!DOCTYPE html>

    <title>Atributos de los nodos</title>

El primer enlace

El segundo enlace

El tercer enlace


text:
#include "cyber/record/record_reader.h"

#include <utility>

namespace apollo {
namespace cyber {
namespace record {

using proto::SectionType;

RecordReader::~RecordReader() {}

RecordReader::RecordReader(const std::string& file) {
  file_reader_.reset(new RecordFileReader());
  if (!file_reader_->Open(file)) {
    AERROR << "Open record file failed, file: " << file;
    return;
  }
  is_valid_ = true;
  header_ = file_reader_->GetHeader();
  if (file_reader_->ReadIndex()) {
    index_ = file_reader_->GetIndex();
    const int kIndexSize = index_.indexes_size();
    for (int i = 0; i < kIndexSize; ++i) {
      auto single_idx = index_.mutable_indexes(i);
      if (single_idx->type() != SectionType::SECTION_CHANNEL) {
        continue;
      }
      if (!single_idx->has_channel_cache()) {
        AERROR << "single channel index does not have channel_cache.";
        continue;
      }
      auto channel_cache = single_idx->mutable_channel_cache();
      channel_info_.insert(
          std::make_pair(channel_cache->name(), *channel_cache));
    }
  }
  file_reader_->Reset();
}

void RecordReader::Reset() {
  file_reader_->Reset();
  reach_end_ = false;
  message_index_ = 0;
  chunk_ = ChunkBody();
}

std::set<std::string> RecordReader::GetChannelList() const {
  std::set<std::string> channel_list;
  for (auto& item : channel_info_) {
    channel_list.insert(item.first);
  }
  return channel_list;
}

bool RecordReader::ReadMessage(RecordMessage* message, uint64_t begin_time,
                               uint64_t end_time) {
  if (!is_valid_) {
    return false;
  }

  if (begin_time > header_.end_time() || end_time < header_.begin_time()) {
    return false;
  }

  while (message_index_ < chunk_.messages_size()) {
    const auto& next_message = chunk_.messages(message_index_);
    uint64_t time = next_message.time();
    if (time > end_time) {
      return false;
    }
    ++message_index_;
    if (time < begin_time) {
      continue;
    }

    message->channel_name = next_message.channel_name();
    message->content = next_message.content();
    message->time = time;
    return true;
  }

  ADEBUG << "read next chunk.";
  if (ReadNextChunk(begin_time, end_time)) {
    ADEBUG << "read chunk successfully.";
    message_index_ = 0;
    return ReadMessage(message, begin_time, end_time);
  }
  ADEBUG << "no chunk to read.";
  return false;
}

bool RecordReader::ReadNextChunk(uint64_t begin_time, uint64_t end_time) {
  bool skip_next_chunk_body = false;
  while (!reach_end_) {
    Section section;
    if (!file_reader_->ReadSection(&section)) {
      AERROR << "Read section failed, file: " << file_reader_->GetPath();
      return false;
    }
    switch (section.type) {
      case SectionType::SECTION_INDEX: {
        file_reader_->SkipSection(section.size);
        reach_end_ = true;
        break;
      }
      case SectionType::SECTION_CHANNEL: {
        ADEBUG << "Read channel section of size: " << section.size;
        Channel channel;
        if (!file_reader_->ReadSection<Channel>(section.size, &channel)) {
          AERROR << "Failed to read channel section.";
          return false;
        }
        break;
      }
      case SectionType::SECTION_CHUNK_HEADER: {
        ADEBUG << "Read chunk header section of size: " << section.size;
        ChunkHeader header;
        if (!file_reader_->ReadSection<ChunkHeader>(section.size, &header)) {
          AERROR << "Failed to read chunk header section.";
          return false;
        }
        if (header.end_time() < begin_time) {
          skip_next_chunk_body = true;
        }
        if (header.begin_time() > end_time) {
          return false;
        }
        break;
      }
      case SectionType::SECTION_CHUNK_BODY: {
        if (skip_next_chunk_body) {
          file_reader_->SkipSection(section.size);
          skip_next_chunk_body = false;
          break;
        }
        if (!file_reader_->ReadSection<ChunkBody>(section.size, &chunk_)) {
          AERROR << "Failed to read chunk body section.";
          return false;
        }
        return true;
      }
      default: {
        AERROR << "Invalid section, type: " << section.type
               << ", size: " << section.size;
        return false;
      }
    }
  }
  return false;
}

uint64_t RecordReader::GetMessageNumber(const std::string& channel_name) const {
  auto search = channel_info_.find(channel_name);
  if (search == channel_info_.end()) {
    return 0;
  }
  return search->second.message_number();
}

const std::string& RecordReader::GetMessageType(
    const std::string& channel_name) const {
  auto search = channel_info_.find(channel_name);
  if (search == channel_info_.end()) {
    return null_type_;
  }
  return search->second.message_type();
}

const std::string& RecordReader::GetProtoDesc(
    const std::string& channel_name) const {
  auto search = channel_info_.find(channel_name);
  if (search == channel_info_.end()) {
    return null_type_;
  }
  return search->second.proto_desc();
}

}  // namespace record
}  // namespace cyber
}  // namespace apollo

redpajama_set_name: RedPajamaGithub


text:
/**
 * \addtogroup group_hal_impl_quaddec QuadDec (Quadrature Decoder)
 * \ingroup group_hal_impl
 * \{
 * \section section_hal_impl_quaddec_pins Selecting Pins for Quadrature Decoding
 * To identify the pins that are available to use with the Quadrature Decoder, open the PSoC
 * device datasheet and navigate to the 'Multiple Alternate Functions' table.  Any pin that has
 * the peri.tr_io_input function can be used.
 *
 * \} group_hal_impl_quaddec
 */

#if defined(COMPONENT_CAT2)
/**
 * \addtogroup group_hal_impl_quaddec QuadDec (Quadrature Decoder)
 * \ingroup group_hal_impl
 * \{
 * \note The cyhal_quaddec_connect_digital() and cyhal_quaddec_disconnect_digital() functions are
 * not supported with this device and will return a CYHAL_QUADDEC_RSLT_ERR_NOT_SUPPORTED error if
 * it is called.  This device does not have the internal circuitry routing that this function is
 * used to configure.
 *
 * \} group_hal_impl_quaddec
 */
#endif

#include "cy_tcpwm.h"
#include "cy_tcpwm_quaddec.h"
#include "cyhal_clock.h"
#include "cyhal_gpio.h"
#include "cyhal_hwmgr.h"
#include "cyhal_interconnect.h"
#include "cyhal_quaddec.h"
#include "cyhal_syspm.h"
#include "cyhal_tcpwm_common.h"
#include "cyhal_utils.h"

#include <string.h>

#if defined(__cplusplus)
extern "C" {
#endif

#define _CYHAL_CNT_NUM _CYHAL_TCPWM_CNT_NUMBER(obj->tcpwm.resource)

#if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)
static cyhal_tcpwm_input_t _cyhal_quaddec_translate_input_signal(cyhal_quaddec_input_t signal);
#endif

static inline cy_rslt_t _cyhal_quaddec_configure_clock(cyhal_tcpwm_t *tcpwm, en_clk_dst_t pclk, uint32_t frequency)
{
    cy_rslt_t rslt;

    const cyhal_clock_tolerance_t tolerance = {
        .type = CYHAL_TOLERANCE_PERCENT,
        .value = 2,
    };

    #if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)
    rslt = _cyhal_utils_allocate_clock(&tcpwm->clock, &tcpwm->resource, CYHAL_CLOCK_BLOCK_PERIPHERAL_16BIT, true);
    #elif defined(COMPONENT_CAT2)
    rslt = cyhal_clock_allocate(&tcpwm->clock, CYHAL_CLOCK_BLOCK_PERIPHERAL_16BIT);
    #endif

    if (rslt == CY_RSLT_SUCCESS)
    {
        tcpwm->dedicated_clock = true;

        if (cyhal_clock_set_frequency(&tcpwm->clock, frequency, &tolerance) == CY_RSLT_SUCCESS)
        {
            if (Cy_SysClk_PeriphAssignDivider(pclk, (cy_en_divider_types_t)tcpwm->clock.block, tcpwm->clock.channel) ==
                CY_SYSCLK_SUCCESS)
            {
                cyhal_clock_set_enabled(&tcpwm->clock, true, false);
                return CY_RSLT_SUCCESS;
            }
        }
    }

    return CYHAL_QUADDEC_RSLT_ERR_CLOCK_INIT;
}

#if defined(COMPONENT_CAT2)
//--------------------------------------------------------------------------------------------------
// _cyhal_quaddec_connect_pin
//
// NOTE: This function should be called after the pin has been initialized with cyhal_gpio_init().
//--------------------------------------------------------------------------------------------------
cy_rslt_t _cyhal_quaddec_connect_pin(cyhal_quaddec_input_t signal, cyhal_gpio_t pin,
                                     TCPWM_Type* base, uint8_t channel_num)
{
#if defined(CYHAL_PIN_MAP_TCPWM_TR_IN)
    bool found = false;
    uint8_t index;
    uint8_t array_size = sizeof(cyhal_pin_map_tcpwm_tr_in) / sizeof(cyhal_resource_pin_mapping_t);
    cyhal_resource_pin_mapping_t mapping;

    // Search through cyhal_pin_map_tcpwm_tr_in to determine if pin can be
    // used to drive a trigger line.
    for (index = 0; index < array_size; index++)
    {
        mapping = cyhal_pin_map_tcpwm_tr_in[index];

        if (mapping.pin == pin)
        {
            found = true;
            Cy_GPIO_SetHSIOM(CYHAL_GET_PORTADDR(pin), CYHAL_GET_PIN(pin), mapping.hsiom);
            break;
        }
    }

    if (!found)
    {
        return CYHAL_GPIO_RSLT_ERR_NO_OUTPUT_SIGNAL;
    }

    switch (signal)
    {
        case CYHAL_QUADDEC_INPUT_PHI_A:
            TCPWM_CNT_TR_CTRL0(base, channel_num) &= ~TCPWM_CNT_TR_CTRL0_COUNT_SEL_Msk;
            TCPWM_CNT_TR_CTRL0(base, channel_num) |= _VAL2FLD(TCPWM_CNT_TR_CTRL0_COUNT_SEL,
                                                              (uint32_t)(mapping.inst) + 2);
            TCPWM_CNT_TR_CTRL1(base, channel_num) &= ~TCPWM_CNT_TR_CTRL1_COUNT_EDGE_Msk;
            TCPWM_CNT_TR_CTRL1(base, channel_num) |= _VAL2FLD(TCPWM_CNT_TR_CTRL1_COUNT_EDGE,
                                                              CYHAL_EDGE_TYPE_RISING_EDGE);
            break;

        case CYHAL_QUADDEC_INPUT_PHI_B:
            TCPWM_CNT_TR_CTRL0(base, channel_num) &= ~TCPWM_CNT_TR_CTRL0_START_SEL_Msk;
            TCPWM_CNT_TR_CTRL0(base, channel_num) |= _VAL2FLD(TCPWM_CNT_TR_CTRL0_START_SEL,
                                                              (uint32_t)(mapping.inst) + 2);
            TCPWM_CNT_TR_CTRL1(base, channel_num) &= ~TCPWM_CNT_TR_CTRL1_START_EDGE_Msk;
            TCPWM_CNT_TR_CTRL1(base, channel_num) |= _VAL2FLD(TCPWM_CNT_TR_CTRL1_START_EDGE,
                                                              CYHAL_EDGE_TYPE_RISING_EDGE);
            break;

        case CYHAL_QUADDEC_INPUT_INDEX:
            TCPWM_CNT_TR_CTRL0(base, channel_num) &= ~TCPWM_CNT_TR_CTRL0_RELOAD_SEL_Msk;
            TCPWM_CNT_TR_CTRL0(base, channel_num) |= _VAL2FLD(TCPWM_CNT_TR_CTRL0_RELOAD_SEL,
                                                              (uint32_t)(mapping.inst) + 2);
            TCPWM_CNT_TR_CTRL1(base, channel_num) &= ~TCPWM_CNT_TR_CTRL1_RELOAD_EDGE_Msk;
            TCPWM_CNT_TR_CTRL1(base, channel_num) |= _VAL2FLD(TCPWM_CNT_TR_CTRL1_RELOAD_EDGE,
                                                              CYHAL_EDGE_TYPE_RISING_EDGE);
            break;

        default:
            return CYHAL_GPIO_RSLT_ERR_NO_OUTPUT_SIGNAL;
    }

    return CY_RSLT_SUCCESS;
#else
    CY_UNUSED_PARAMETER(signal);
    CY_UNUSED_PARAMETER(pin);
    CY_UNUSED_PARAMETER(base);
    CY_UNUSED_PARAMETER(channel_num);

    return CYHAL_GPIO_RSLT_ERR_NO_OUTPUT_SIGNAL;
#endif /* defined(CYHAL_PIN_MAP_TCPWM_TR_IN) */
}
#endif

cy_rslt_t cyhal_quaddec_init(cyhal_quaddec_t *obj, cyhal_gpio_t phi_a, cyhal_gpio_t phi_b,
                             cyhal_gpio_t index, cyhal_quaddec_resolution_t resolution,
                             const cyhal_clock_t *clk, uint32_t frequency)
{
    CY_ASSERT(obj != NULL);

    cy_rslt_t rslt = CY_RSLT_SUCCESS;

    // Initialize the quadrature object
    // Explicitly marked not allocated resources as invalid to prevent freeing them.
    memset(obj, 0, sizeof(cyhal_quaddec_t));
    obj->phi_a = NC;
    obj->phi_b = NC;
    obj->index = NC;
    obj->tcpwm.resource.type = CYHAL_RSC_INVALID;
    obj->last_counter_value = 1 << (_CYHAL_TCPWM_DATA[obj->tcpwm.resource.block_num].max_count - 1);

    // Allocate TCPWM resource
    rslt = cyhal_hwmgr_allocate(CYHAL_RSC_TCPWM, &obj->tcpwm.resource);

    // Basic configuration of TCPWM for quadrature functionality
    if (rslt == CY_RSLT_SUCCESS)
    {
        cy_stc_tcpwm_quaddec_config_t config;

        obj->tcpwm.base = _CYHAL_TCPWM_DATA[obj->tcpwm.resource.block_num].base;
        _cyhal_tcpwm_init_data(&obj->tcpwm);

        memset(&config, 0, sizeof(cy_stc_tcpwm_quaddec_config_t));

        config.resolution = resolution;

        #if (CY_IP_MXTCPWM_VERSION >= 2U)
        config.phiAInputMode  = CY_TCPWM_INPUT_LEVEL;                // Pass thorugh (no edge detection)
        config.phiBInputMode  = CY_TCPWM_INPUT_LEVEL;                // Pass thorugh (no edge detection)
        config.trigger0Event  = CY_TCPWM_CNT_TRIGGER_ON_DISABLED;    // Disable output trigger0 event generation
        config.trigger1Event  = CY_TCPWM_CNT_TRIGGER_ON_DISABLED;    // Disable output trigger1 event generation
        #endif

        // This function is only used to set the resolution and configure the TCPWM for quadrature mode.
        // It also configures the inputs, but that will be overwritten by cyhal_quaddec_connect_digital().
        // So, this must be called before that function is called.
        rslt = Cy_TCPWM_QuadDec_Init(obj->tcpwm.base, _CYHAL_CNT_NUM, &config);
    }

    // Pin configuration
    if (rslt == CY_RSLT_SUCCESS)
    {
        rslt = cyhal_gpio_init(phi_a, CYHAL_GPIO_DIR_INPUT, CYHAL_GPIO_DRIVE_NONE, false);

        if (rslt == CY_RSLT_SUCCESS)
        {
            obj->phi_a = phi_a;
            #if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)
            uint8_t idx = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_PHI_A);
            rslt = cyhal_gpio_enable_output(phi_a, &(obj->tcpwm.inputs[idx]));
            #endif
        }

        if (rslt == CY_RSLT_SUCCESS)
        {
            rslt = cyhal_gpio_init(phi_b, CYHAL_GPIO_DIR_INPUT, CYHAL_GPIO_DRIVE_NONE, false);
        }

        if (rslt == CY_RSLT_SUCCESS)
        {
            obj->phi_b = phi_b;
            #if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)
            uint8_t idx = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_PHI_B);
            rslt = cyhal_gpio_enable_output(phi_b, &(obj->tcpwm.inputs[idx]));
            #endif
        }

        if (index != NC)
        {
            if (rslt == CY_RSLT_SUCCESS)
            {
                rslt = cyhal_gpio_init(index, CYHAL_GPIO_DIR_INPUT, CYHAL_GPIO_DRIVE_NONE, false);
            }

            if (rslt == CY_RSLT_SUCCESS)
            {
                obj->index = index;
                #if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)
                uint8_t idx = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_INDEX);
                rslt = cyhal_gpio_enable_output(index, &(obj->tcpwm.inputs[idx]));
                #endif
            }
        }
        #if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)
        else
        {
            uint8_t idx = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_INDEX);
            obj->tcpwm.inputs[idx] = CYHAL_TRIGGER_CPUSS_ZERO;
        }
        #endif

        if (rslt != CY_RSLT_SUCCESS)
        {
            rslt = CYHAL_QUADDEC_RSLT_ERR_BAD_ARGUMENT;
        }
    }

    #if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)

    // Internal signal configuration
    if (rslt == CY_RSLT_SUCCESS)
    {
        uint8_t idx = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_PHI_A);
        rslt = cyhal_quaddec_connect_digital(obj, obj->tcpwm.inputs[idx], CYHAL_QUADDEC_INPUT_PHI_A);
        if (rslt != CY_RSLT_SUCCESS)
        {
            obj->tcpwm.inputs[idx] = CYHAL_TRIGGER_CPUSS_ZERO;
        }
    }

    if (rslt == CY_RSLT_SUCCESS)
    {
        uint8_t idx = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_PHI_B);
        rslt = cyhal_quaddec_connect_digital(obj, obj->tcpwm.inputs[idx], CYHAL_QUADDEC_INPUT_PHI_B);
        if (rslt != CY_RSLT_SUCCESS)
        {
            obj->tcpwm.inputs[idx] = CYHAL_TRIGGER_CPUSS_ZERO;
        }
    }

    if ((rslt == CY_RSLT_SUCCESS) && (index != NC))
    {
        uint8_t idx = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_INDEX);
        rslt = cyhal_quaddec_connect_digital(obj, obj->tcpwm.inputs[idx], CYHAL_QUADDEC_INPUT_INDEX);
        if (rslt != CY_RSLT_SUCCESS)
        {
            obj->tcpwm.inputs[idx] = CYHAL_TRIGGER_CPUSS_ZERO;
        }
    }

    #elif defined(COMPONENT_CAT2)

    if (rslt == CY_RSLT_SUCCESS)
    {
        rslt = _cyhal_quaddec_connect_pin(CYHAL_QUADDEC_INPUT_PHI_A, obj->phi_a, obj->tcpwm.base,
                                          obj->tcpwm.resource.channel_num);
    }

    if (rslt == CY_RSLT_SUCCESS)
    {
        rslt = _cyhal_quaddec_connect_pin(CYHAL_QUADDEC_INPUT_PHI_B, obj->phi_b, obj->tcpwm.base,
                                          obj->tcpwm.resource.channel_num);
    }

    if ((rslt == CY_RSLT_SUCCESS) && (index != NC))
    {
        rslt = _cyhal_quaddec_connect_pin(CYHAL_QUADDEC_INPUT_INDEX, obj->index, obj->tcpwm.base,
                                          obj->tcpwm.resource.channel_num);
    }

    #endif

    // Clock configuration
    if (rslt == CY_RSLT_SUCCESS)
    {
        en_clk_dst_t pclk =
            (en_clk_dst_t)(_CYHAL_TCPWM_DATA[obj->tcpwm.resource.block_num].clock_dst +
                           obj->tcpwm.resource.channel_num);

        if (clk != NULL)
        {
            if (frequency != 0)
            {
                rslt = CYHAL_QUADDEC_RSLT_ERR_BAD_ARGUMENT;
            }
            else
            {
                obj->tcpwm.clock = *clk;
                _cyhal_utils_update_clock_format(&obj->tcpwm.clock);

                if (Cy_SysClk_PeriphAssignDivider(pclk, (cy_en_divider_types_t)obj->tcpwm.clock.block,
                                                  obj->tcpwm.clock.channel) != CY_SYSCLK_SUCCESS)
                {
                    rslt = CYHAL_QUADDEC_RSLT_ERR_CLOCK_INIT;
                }
            }
        }
        else
        {
            rslt = _cyhal_quaddec_configure_clock(&obj->tcpwm, pclk, frequency);
        }

        if (rslt == CY_RSLT_SUCCESS)
        {
            obj->tcpwm.clock_hz = cyhal_clock_get_frequency(&obj->tcpwm.clock);
        }
    }

    // Enable the quadrature function
    if (rslt == CY_RSLT_SUCCESS)
    {
        Cy_TCPWM_QuadDec_Enable(obj->tcpwm.base, _CYHAL_CNT_NUM);
    }
    else
    {
        cyhal_quaddec_free(obj);
    }

    return rslt;
}

void cyhal_quaddec_free(cyhal_quaddec_t *obj)
{
    CY_ASSERT(obj != NULL);
    #if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)
    uint8_t idx_phi_a = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_PHI_A);
    if ((obj->phi_a != NC) && (obj->tcpwm.inputs[idx_phi_a] != CYHAL_TRIGGER_CPUSS_ZERO))
    {
        cyhal_quaddec_disconnect_digital(obj, obj->tcpwm.inputs[idx_phi_a], CYHAL_QUADDEC_INPUT_PHI_A);
    }
    uint8_t idx_phi_b = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_PHI_B);
    if ((obj->phi_b != NC) && (obj->tcpwm.inputs[idx_phi_b] != CYHAL_TRIGGER_CPUSS_ZERO))
    {
        cyhal_quaddec_disconnect_digital(obj, obj->tcpwm.inputs[idx_phi_b], CYHAL_QUADDEC_INPUT_PHI_B);
    }
    uint8_t idx_index = (uint8_t)_cyhal_quaddec_translate_input_signal(CYHAL_QUADDEC_INPUT_INDEX);
    if ((obj->index != NC) && (obj->tcpwm.inputs[idx_index] != CYHAL_TRIGGER_CPUSS_ZERO))
    {
        cyhal_quaddec_disconnect_digital(obj, obj->tcpwm.inputs[idx_index], CYHAL_QUADDEC_INPUT_INDEX);
    }
    #endif
    _cyhal_utils_release_if_used(&obj->phi_a);
    _cyhal_utils_release_if_used(&obj->phi_b);
    _cyhal_utils_release_if_used(&obj->index);
    _cyhal_tcpwm_free(&obj->tcpwm);
}

cy_rslt_t cyhal_quaddec_start(cyhal_quaddec_t *obj)
{
    CY_ASSERT(obj != NULL);
    if (_cyhal_tcpwm_pm_transition_pending())
    {
        return CYHAL_SYSPM_RSLT_ERR_PM_PENDING;
    }
    Cy_TCPWM_QuadDec_Enable(obj->tcpwm.base, _CYHAL_CNT_NUM);

    // Trigger reload/index the QuadDec.
    // From the TRM, "A reload trigger must be provided through firmware to start the counter if
    // the hardware reload signal is not enabled."
    #if defined(CY_IP_MXTCPWM) && (CY_IP_MXTCPWM_VERSION >= 2)
    Cy_TCPWM_TriggerReloadOrIndex_Single(obj->tcpwm.base, _CYHAL_CNT_NUM);
    #else
    Cy_TCPWM_TriggerReloadOrIndex(obj->tcpwm.base, 1 << _CYHAL_CNT_NUM);
    #endif

    obj->last_counter_value = 1 << (_CYHAL_TCPWM_DATA[obj->tcpwm.resource.block_num].max_count - 1);

    return CY_RSLT_SUCCESS;
}

cy_rslt_t cyhal_quaddec_stop(cyhal_quaddec_t *obj)
{
    CY_ASSERT(obj != NULL);
    Cy_TCPWM_QuadDec_Disable(obj->tcpwm.base, _CYHAL_CNT_NUM);
    return CY_RSLT_SUCCESS;
}

int32_t cyhal_quaddec_get_delta(cyhal_quaddec_t *obj)
{
    CY_ASSERT(obj != NULL);

    uint32_t midpoint = 1 << (_CYHAL_TCPWM_DATA[obj->tcpwm.resource.block_num].max_count - 1);
    uint32_t max_delta = midpoint >> 1;
    uint32_t max_counter_value = (midpoint == 0x8000) ? 0xFFFF : 0xFFFFFFFF;
    uint32_t current_counter_value = Cy_TCPWM_QuadDec_GetCounter(obj->tcpwm.base, _CYHAL_CNT_NUM);
    int32_t  delta = current_counter_value - obj->last_counter_value;

    // Overflow has occurred
    if (delta < (int32_t)(-max_delta))
    {
        delta = max_counter_value - obj->last_counter_value;
        delta += current_counter_value - midpoint;
    }
    // Underflow has occurred
    else if (delta > (int32_t)max_delta)
    {
        delta = (int32_t)(-obj->last_counter_value);
        delta += current_counter_value - midpoint;
    }

    obj->last_counter_value = current_counter_value;

    return delta;
}

uint32_t cyhal_quaddec_read_counter(const cyhal_quaddec_t *obj)
{
    CY_ASSERT(obj != NULL);
    return Cy_TCPWM_QuadDec_GetCounter(obj->tcpwm.base, _CYHAL_CNT_NUM);
}

uint32_t cyhal_quaddec_read_capture(const cyhal_quaddec_t *obj)
{
    CY_ASSERT(obj != NULL);
    #if defined(CY_IP_MXTCPWM) && (CY_IP_MXTCPWM_VERSION >= 2)
    return Cy_TCPWM_QuadDec_GetCapture0Val(obj->tcpwm.base, _CYHAL_CNT_NUM);
    #else
    return Cy_TCPWM_QuadDec_GetCapture(obj->tcpwm.base, _CYHAL_CNT_NUM);
    #endif
}

#if defined(COMPONENT_CAT1A) || defined(COMPONENT_CAT1B)

static cyhal_tcpwm_input_t _cyhal_quaddec_translate_input_signal(cyhal_quaddec_input_t signal)
{
    switch (signal)
    {
        case CYHAL_QUADDEC_INPUT_PHI_A:
            return CYHAL_TCPWM_INPUT_COUNT;
        case CYHAL_QUADDEC_INPUT_PHI_B:
            return CYHAL_TCPWM_INPUT_START;
        case CYHAL_QUADDEC_INPUT_STOP:
            return CYHAL_TCPWM_INPUT_STOP;
        case CYHAL_QUADDEC_INPUT_INDEX:
            return CYHAL_TCPWM_INPUT_RELOAD;
    }
    CY_ASSERT(false);
    return (cyhal_tcpwm_input_t)0;
}

cy_rslt_t cyhal_quaddec_connect_digital(cyhal_quaddec_t *obj, cyhal_source_t source, cyhal_quaddec_input_t signal)
{
    cyhal_tcpwm_input_t tcpwm_signal;
    cyhal_edge_type_t input_type;

    switch (signal)
    {
        case CYHAL_QUADDEC_INPUT_PHI_A:
        case CYHAL_QUADDEC_INPUT_PHI_B:
            input_type = CYHAL_EDGE_TYPE_LEVEL;
            break;
        case CYHAL_QUADDEC_INPUT_STOP:
        case CYHAL_QUADDEC_INPUT_INDEX:
            input_type = CYHAL_EDGE_TYPE_RISING_EDGE;
            break;
        default:
            return CYHAL_QUADDEC_RSLT_ERR_BAD_ARGUMENT;
    }

    tcpwm_signal = _cyhal_quaddec_translate_input_signal(signal);

    return _cyhal_tcpwm_connect_digital(&(obj->tcpwm), source, tcpwm_signal, input_type);
}

cy_rslt_t cyhal_quaddec_disconnect_digital(cyhal_quaddec_t *obj, cyhal_source_t source, cyhal_quaddec_input_t signal)
{
    return _cyhal_tcpwm_disconnect_digital(&(obj->tcpwm), source,
                                           _cyhal_quaddec_translate_input_signal(signal));
}

#elif defined(COMPONENT_CAT2)

cy_rslt_t cyhal_quaddec_connect_digital(cyhal_quaddec_t *obj, cyhal_source_t source, cyhal_quaddec_input_t signal)
{
    CY_UNUSED_PARAMETER(obj);
    CY_UNUSED_PARAMETER(source);
    CY_UNUSED_PARAMETER(signal);
    return CYHAL_QUADDEC_RSLT_ERR_NOT_SUPPORTED;
}

cy_rslt_t cyhal_quaddec_disconnect_digital(cyhal_quaddec_t *obj, cyhal_source_t source, cyhal_quaddec_input_t signal)
{
    CY_UNUSED_PARAMETER(obj);
    CY_UNUSED_PARAMETER(source);
    CY_UNUSED_PARAMETER(signal);
    return CYHAL_QUADDEC_RSLT_ERR_NOT_SUPPORTED;
}

#endif

static cyhal_tcpwm_output_t _cyhal_quaddec_translate_output_signal(cyhal_quaddec_output_t signal)
{
    switch (signal)
    {
        case CYHAL_QUADDEC_OUTPUT_COMPARE_MATCH:
            return CYHAL_TCPWM_OUTPUT_COMPARE_MATCH;
    }
    CY_ASSERT(false);
    return (cyhal_tcpwm_output_t)0;
}

cy_rslt_t cyhal_quaddec_enable_output(cyhal_quaddec_t *obj, cyhal_quaddec_output_t signal, cyhal_source_t *source)
{
    if (signal != CYHAL_QUADDEC_OUTPUT_COMPARE_MATCH)
    {
        return CYHAL_QUADDEC_RSLT_ERR_BAD_ARGUMENT;
    }

    return _cyhal_tcpwm_enable_output(&(obj->tcpwm), _cyhal_quaddec_translate_output_signal(signal), source);
}

cy_rslt_t cyhal_quaddec_disable_output(cyhal_quaddec_t *obj, cyhal_quaddec_output_t signal)
{
    if (signal != CYHAL_QUADDEC_OUTPUT_COMPARE_MATCH)
        return CYHAL_QUADDEC_RSLT_ERR_BAD_ARGUMENT;

    return _cyhal_tcpwm_disable_output(&(obj->tcpwm), _cyhal_quaddec_translate_output_signal(signal));
}


text:
string(APPEND _ANDROID_ABI_INIT_CFLAGS
  " -funwind-tables"
  " -no-canonical-prefixes"
  )

if(CMAKE_ANDROID_NDK AND NOT CMAKE_ANDROID_NDK_DEPRECATED_HEADERS)
  string(APPEND _ANDROID_ABI_INIT_CFLAGS " -D__ANDROID_API__=${CMAKE_SYSTEM_VERSION}")
endif()

if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
    AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 16)
  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

cmake_policy(GET CMP0083 _CMP0083)
if(_CMP0083 STREQUAL NEW)
  # PIE Flags are managed by compiler configuration files
  if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 16)
    # ensure PIE flags are passed to the linker
    set(CMAKE_C_LINK_PIE_SUPPORTED YES CACHE INTERNAL "PIE (C)")
    set(CMAKE_CXX_LINK_PIE_SUPPORTED YES CACHE INTERNAL "PIE (CXX)")
    if(CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 21)
      # no PIE executable are no longer supported
      set(CMAKE_C_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (C)")
      set(CMAKE_CXX_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (CXX)")
    endif()
  endif()
else()
  if(CMAKE_POSITION_INDEPENDENT_CODE)
    string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie")
  endif()
endif()
unset(_CMP0083)

string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")

if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)
  string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,-z,nocopyreloc")
endif()


text:
import dateHelper from 'appkit/utils/date'

export default Ember.ObjectController.extend({
  actions: {
    update: function() {
      // NOTE: avoid send() target naming conflict with the controller event
      return this.send('updateGoal', this.get('model'));
    },
    cancel: function() {
      return this.send('rollback', this.get('model'));
    },

    // Complete
    confirmingComplete: function() {
      this.toggleProperty('isConfirmingComplete');
    },
    complete: function() {
      var model = this.get('model');
      model.set('endDate', dateHelper.todayDate());

      return this.send('updateGoal', model);
    },
    nevermind: function() {
      this.toggleProperty('isConfirmingComplete');
    },

  }
});


text: print ('Master, I await your next world dominating command.')


text:
using System;

namespace PulseCat.Proxy
{
    public interface IProxyConnection : IDisposable
    {
        bool Connected { get; }
        Guid Id { get; }
        void BeginReceiveLoop();
        void Disconnect();
    }
}


text:
require 'test/unit'
require_relative '../../app/core'
require_relative '../../app/mock'
require_relative '../../processor/frame'

module UnitHelper

  def common_setup
    @dbg      ||= Trepan::MockDebugger.new(:nx => true)
    @core     ||= Trepan::Core.new(@dbg)
    @cmdproc  ||= @core.processor = Trepan::CmdProcessor.new(@core)
    @cmds     ||= @cmdproc.commands

    def @cmdproc.msg(message, opts={})
      @msgs << message
    end
    def @cmdproc.markdown(message, opts={})
      @msgs << message
    end
    def @cmdproc.msgs
      @msgs
    end
    def @cmdproc.errmsg(message, opts={})
      @errmsgs << message
    end
    def @cmdproc.errmsgs
      @errmsgs
    end
    def @cmdproc.section(message, opts={})
      @msgs << message
    end
    reset_cmdproc_vars
  end
  module_function :common_setup

  def reset_cmdproc_vars
    @cmdproc.instance_variable_set('@msgs', [])
    @cmdproc.instance_variable_set('@errmsgs', [])
  end
  module_function :reset_cmdproc_vars
end

if __FILE__ == $0
  include UnitHelper
  common_setup
  p @cmdproc.msgs
  p @dbg
end


text:
'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var _leaflet = require('leaflet');

var _leaflet2 = _interopRequireDefault(_leaflet);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactDom = require('react-dom');

jest.dontMock('../MapComponent');

var MapComponent = require('../MapComponent');

describe('MapComponent', function () {
  var Component = (function (_MapComponent) {
    _inherits(Component, _MapComponent);

    function Component() {
      _classCallCheck(this, Component);

      _get(Object.getPrototypeOf(Component.prototype), 'constructor', this).apply(this, arguments);
    }

    _createClass(Component, [{
      key: 'componentWillMount',
      value: function componentWillMount() {
        _get(Object.getPrototypeOf(Component.prototype), 'componentWillMount', this).call(this);
        this.leafletElement = _leaflet2['default'].map('test');
      }
    }, {
      key: 'render',
      value: function render() {
        return null;
      }
    }]);

    return Component;
  })(MapComponent);

  it('exposes a `leafletElement` getter', function () {
    document.body.innerHTML = '

';

    var component = _react2['default'].createElement(Component, null);
    var instance = (0, _reactDom.render)(component, document.getElementById('test'));

    expect(instance.leafletElement._container).toBeDefined();
  });

  it('binds the event', function () {
    document.body.innerHTML = '

';

    var callback = jest.genMockFn();
    var component = _react2['default'].createElement(Component, { onLeafletClick: callback });
    var instance = (0, _reactDom.render)(component, document.getElementById('test'));

    instance.fireLeafletEvent('click');
    expect(callback.mock.calls.length).toBe(1);
  });

  it('binds events as Leaflet events', function () {
    document.body.innerHTML = '

';

    var callback = jest.genMockFn();
    var component = _react2['default'].createElement(Component, { onClick: callback });
    var instance = (0, _reactDom.render)(component, document.getElementById('test'));

    instance.fireLeafletEvent('click');
    expect(callback.mock.calls.length).toBe(1);
  });

  it('unbinds the event', function () {
    document.body.innerHTML = '

';

    var callback = jest.genMockFn();

    var TestComponent = (function (_React$Component) {
      _inherits(TestComponent, _React$Component);

      function TestComponent() {
        _classCallCheck(this, TestComponent);

        _get(Object.getPrototypeOf(TestComponent.prototype), 'constructor', this).call(this);
        this.state = { bindEvent: true };
      }

      _createClass(TestComponent, [{
        key: 'dontBind',
        value: function dontBind() {
          this.setState({ bindEvent: false });
        }
      }, {
        key: 'fire',
        value: function fire() {
          this.refs.c.fireLeafletEvent('click');
        }
      }, {
        key: 'render',
        value: function render() {
          return this.state.bindEvent ? _react2['default'].createElement(Component, { onClick: callback, ref: 'c' }) : _react2['default'].createElement(Component, { ref: 'c' });
        }
      }]);

      return TestComponent;
    })(_react2['default'].Component);

    var component = _react2['default'].createElement(TestComponent, null);
    var instance = (0, _reactDom.render)(component, document.getElementById('test'));

    instance.fire();
    expect(callback.mock.calls.length).toBe(1);

    instance.dontBind();
    instance.fire();
    expect(callback.mock.calls.length).toBe(1);
  });

  it('replaces the event', function () {
    document.body.innerHTML = '

';

    var callback1 = jest.genMockFn();
    var callback2 = jest.genMockFn();

    var TestComponent = (function (_React$Component2) {
      _inherits(TestComponent, _React$Component2);

      function TestComponent() {
        _classCallCheck(this, TestComponent);

        _get(Object.getPrototypeOf(TestComponent.prototype), 'constructor', this).call(this);
        this.state = { cb: callback1 };
      }

      _createClass(TestComponent, [{
        key: 'replaceCallback',
        value: function replaceCallback() {
          this.setState({ cb: callback2 });
        }
      }, {
        key: 'fire',
        value: function fire() {
          this.refs.c.fireLeafletEvent('click');
        }
      }, {
        key: 'render',
        value: function render() {
          return _react2['default'].createElement(Component, { onClick: this.state.cb, ref: 'c' });
        }
      }]);

      return TestComponent;
    })(_react2['default'].Component);

    var component = _react2['default'].createElement(TestComponent, null);
    var instance = (0, _reactDom.render)(component, document.getElementById('test'));

    instance.fire();
    expect(callback1.mock.calls.length).toBe(1);
    expect(callback2.mock.calls.length).toBe(0);

    instance.replaceCallback();
    instance.fire();
    expect(callback1.mock.calls.length).toBe(1);
    expect(callback2.mock.calls.length).toBe(1);
  });
});


text:
<Type Name="ValueAnimationInfo" FullName="Urho.ValueAnimationInfo">
  <TypeSignature Language="C#" Value="public class ValueAnimationInfo : Urho.RefCounted" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ValueAnimationInfo extends Urho.RefCounted" />
  <AssemblyInfo>
    <AssemblyName>Urho</AssemblyName>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>Urho.RefCounted</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>

            Base class for a value animation instance, which includes animation runtime information and updates the target object's value automatically.

    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public ValueAnimationInfo (IntPtr handle);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int handle) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>Preserve</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="handle" Type="System.IntPtr" />
      </Parameters>
      <Docs>
        <param name="handle">Pointer to the raw unmanaged Urho object.</param>
        Constructs a new instance of Urho.ValueAnimationInfo, given a raw pointer to an unmanaged object
        <remarks>
          <para>This creates a new managed wrapper for the type using the raw pointer to an unmanaged object.</para>
          <para>Objects that are created in this fashion get registered with the UrhoSharp runtime.</para>
          <para>This is intended to be used by the UrhoSharp runtime, and is not intended to be used by users.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="protected ValueAnimationInfo (Urho.UrhoObjectFlag emptyFlag);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(valuetype Urho.UrhoObjectFlag emptyFlag) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>Preserve</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="emptyFlag" Type="Urho.UrhoObjectFlag" />
      </Parameters>
      <Docs>
        <param name="emptyFlag">Pass UrhoObjectFlag.Empty.</param>
        Empty constructor, chain to this constructor when you provide your own constructor that sets the handle field.
        <remarks>
          <para>This constructor should be invoked by your code if you provide your own constructor that sets the handle field.</para>
          <para>This essentially circumvents the default path that creates a new object and sets the handle and does not call RegisterObject on the target, you must do this on your own constructor.</para>
          <para>You would typically chain to this constructor from your own, and then set the handle to the unmanaged object from your code, and then register your object.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public ValueAnimationInfo (Urho.ValueAnimation animation, Urho.WrapMode wrapMode, float speed);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Urho.ValueAnimation animation, valuetype Urho.WrapMode wrapMode, float32 speed) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>Preserve</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="animation" Type="Urho.ValueAnimation" />
        <Parameter Name="wrapMode" Type="Urho.WrapMode" />
        <Parameter Name="speed" Type="System.Single" />
      </Parameters>
      <Docs>
        <param name="animation">To be added.</param>
        <param name="wrapMode">To be added.</param>
        <param name="speed">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public ValueAnimationInfo (Urho.UrhoObject target, Urho.ValueAnimation animation, Urho.WrapMode wrapMode, float speed);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Urho.UrhoObject target, class Urho.ValueAnimation animation, valuetype Urho.WrapMode wrapMode, float32 speed) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>Preserve</AttributeName>
        </Attribute>
      </Attributes>
      <Parameters>
        <Parameter Name="target" Type="Urho.UrhoObject" />
        <Parameter Name="animation" Type="Urho.ValueAnimation" />
        <Parameter Name="wrapMode" Type="Urho.WrapMode" />
        <Parameter Name="speed" Type="System.Single" />
      </Parameters>
      <Docs>
        <param name="target">To be added.</param>
        <param name="animation">To be added.</param>
        <param name="wrapMode">To be added.</param>
        <param name="speed">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Animation">
      <MemberSignature Language="C#" Value="public Urho.ValueAnimation Animation { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance class Urho.ValueAnimation Animation" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Urho.ValueAnimation</ReturnType>
      </ReturnValue>
      <Docs>

            Return animation.

        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="SetTime">
      <MemberSignature Language="C#" Value="public bool SetTime (float time);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool SetTime(float32 time) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="time" Type="System.Single" />
      </Parameters>
      <Docs>
        <param name="time">To be added.</param>
        To be added.
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Speed">
      <MemberSignature Language="C#" Value="public float Speed { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance float32 Speed" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Single</ReturnType>
      </ReturnValue>
      <Docs>

            Return speed.
            Or
            Set speed.

        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Target">
      <MemberSignature Language="C#" Value="public Urho.UrhoObject Target { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance class Urho.UrhoObject Target" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Urho.UrhoObject</ReturnType>
      </ReturnValue>
      <Docs>

            Return target object.

        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Time">
      <MemberSignature Language="C#" Value="public float Time { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance float32 Time" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Single</ReturnType>
      </ReturnValue>
      <Docs>
        Return time position.
        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Update">
      <MemberSignature Language="C#" Value="public bool Update (float timeStep);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Update(float32 timeStep) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="timeStep" Type="System.Single" />
      </Parameters>
      <Docs>
        <param name="timeStep">To be added.</param>

            Update. Return true when the animation is finished. No-op when the target object is not defined.

        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="WrapMode">
      <MemberSignature Language="C#" Value="public Urho.WrapMode WrapMode { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance valuetype Urho.WrapMode WrapMode" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Urho.WrapMode</ReturnType>
      </ReturnValue>
      <Docs>

            Return wrap mode.
            Or
            Set wrap mode.

        <value>To be added.</value>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>


text:
layout: post
date: 2017-04-21
title: "Jovani Pageant Dresses Cap Sleeve Empire Waist Dress 90422"
category: Jovani Pageant Dresses
tags: [Jovani Pageant Dresses]
---
### Jovani Pageant Dresses Cap Sleeve Empire Waist Dress 90422
Just **$459.99**
###

BRANDS	Jovani Pageant Dresses

Buy it: [https://www.readybrides.com/en/jovani-pageant-dresses/40486-cap-sleeve-empire-waist-dress-90422.html](https://www.readybrides.com/en/jovani-pageant-dresses/40486-cap-sleeve-empire-waist-dress-90422.html)


text:
<?php

namespace Elastica\Processor;

\trigger_deprecation('ruflin/elastica', '7.1.0', 'The "%s" class is deprecated, use "%s" instead. It will be removed in 8.0.', Sort::class, SortProcessor::class);

/**
 * Elastica Sort Processor.
 *
 * @author Federico Panini <fpanini@gmail.com>
 *
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-processor.html
 * @deprecated since version 7.1.0, use the SortProcessor class instead.
 */
class Sort extends SortProcessor
{
}


text:
namespace DeffiningClassesPart2
{
    using System.Collections.Generic;

    public static class PathStorage
    {
        private static List<string> savePaths;

        static PathStorage ()
        {
            SavePaths = new List<string>();
        }

        public static List<string> SavePaths
        {
            get
            {
                return savePaths;
            }

            set
            {
                savePaths = value;
            }
        }

        public static void Save()
        {

        }
    }
}


text:
<resources>
    <string name="app_name">DemoProject</string>
</resources>


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

namespace ShapingAPI.ViewModels
{
    public class ArtistViewModel
    {
        public ArtistViewModel()
        {
            Album = new HashSet<AlbumViewModel>();
        }

        public int ArtistId { get; set; }
        public string Name { get; set; }

        public virtual ICollection<AlbumViewModel> Album { get; set; }
    }
}


text:
def build_rules(search):
    """Return structure used to populate a QueryBuilder instance.

    `search` is a tree describing the search to be performed

    See https://querybuilder.js.org/#method-setRules for expected structure of rules.

    See TestAdvancedSearchHelpers.test_build_rules for an example.
    """

    rules = _build_rules_helper(search)
    if "condition" not in rules:
        rules = {"condition": "AND", "rules": [rules]}
    return rules

def _build_rules_helper(search):
    """Helper function for build_rules().

    A branch node like:

        ["and", [node1, node2]]

    will be transformed, recursively, into:

        {
            "condition": "AND",
            "rules": [_build_rules_helper(node1), _build_rules_helper(node2)]
        }

    A leaf node like:

        ["nm", "contains", "paracetamol"]

    will be transformed into:

        {"id": "nm", "operator": "contains", "value": "paracetamol"}
    """

    assert len(search) in [2, 3]

    if len(search) == 2:
        # branch node
        return {
            "condition": search[0].upper(),
            "rules": list(map(_build_rules_helper, search[1])),
        }
    else:
        # leaf node
        value = search[2]
        if value is True:
            value = 1
        elif value is False:
            value = 0

        return {"id": search[0], "operator": search[1], "value": value}


text:
package com.sankoudai.java.api.text;

import junit.framework.TestCase;
import org.junit.Assert;

import java.text.DecimalFormat;

public class TestDecimalFormat extends TestCase {
    public void test() {
        DecimalFormat format = new DecimalFormat("#0.00");
        Assert.assertEquals("3456.12", format.format(3456.123));
        Assert.assertEquals("4.12", format.format(4.123));
    }
}


text:
package evaluation.evalBench.io;

import ieg.util.xml.XmlCalendarConverter;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Iterator;
import java.util.Map.Entry;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;

import evaluation.evalBench.session.EvaluationSession;
import evaluation.evalBench.task.Insight;
import evaluation.evalBench.task.InsightTask;
import evaluation.evalBench.task.Question;
import evaluation.evalBench.task.Task;

/**
 * experiment journal for insights with XML output. This journal is optimized
 * for {@link InsightTask}s and does not store the task description with every
 * insight. All other tasks are ignored.
 *
 * @author Rind
 */
@Deprecated
public class XMLInsightJournal implements EvaluationSessionJournal {

    // StAX tutorial see http://java.kompf.de/jaxpstreamwriter.html

    // note that SAX cannot flush between insights (& is more complicated)

    private static final String URI_NS = "http://ieg.ifs.tuwien.ac.at/projects/evalbench/insight/";
    private static final String URI_NS_XHTML = "http://www.w3.org/1999/xhtml";

    private static final String FILE_SUFFIX = "_insights.xml";

    private XmlCalendarConverter timeConv;
    private XMLStreamWriter writer = null;
    private String participantId;
    private int index = 0;

    public XMLInsightJournal(EvaluationSession aSession) {
        setSession(aSession);
    }

    @Override
    public void setSession(EvaluationSession aSession) {
        if (writer != null) {
            Logger.getLogger(XMLInsightJournal.class).warn(
                    "Output is still open.");
            return;
        }

        File journalFile = aSession.getSessionGroup().getOutputManager()
                .getJournalFile(aSession.getTitle(), FILE_SUFFIX);
        participantId = aSession.getSessionGroup().getParticipantId();

        try {
            open(journalFile);
        } catch (Exception e) {
            Logger.getLogger(XMLInsightJournal.class).warn(
                    "Could not open insight journal", e);
            try {
                writer.close();
            } catch (XMLStreamException e1) {
            }
            writer = null;
        }
    }

    private void open(File file) throws FileNotFoundException,
            XMLStreamException, FactoryConfigurationError,
            DatatypeConfigurationException {
        // open writer
        FileOutputStream fos = new FileOutputStream(file);
        writer = XMLOutputFactory.newInstance().createXMLStreamWriter(fos,
                "UTF-8");

        // start document
        writer.setDefaultNamespace(URI_NS);
        writer.writeStartDocument("UTF-8", "1.0");
        writer.writeCharacters("\n");
        writer.writeStartElement(URI_NS, "insights");
        if (URI_NS.length() > 0) {
            writer.writeDefaultNamespace(URI_NS);
        }
        writer.writeNamespace("html", URI_NS_XHTML);
        writer.writeCharacters("\n");
        // writer.writeStartElement(URI_NS, "participant");
        // writer.writeCharacters(participantId);
        // writer.writeEndElement();

        // reset index
        index = 0;
        timeConv = new XmlCalendarConverter();
    }

    @Override
    public void recordTask(Task aTask) {

        // check correct task type
        Iterator<Question> i = aTask.getQuestions().iterator();
        if (i.hasNext()) {
            Question qu = i.next();
            if (qu instanceof InsightTask) {
                Insight insight;
                insight = ((InsightTask) qu).getInsight();

                // check still open
                if (writer == null) {
                    Logger.getLogger(XMLInsightJournal.class).warn(
                            "Output closed, could not tried record insight: "
                                    + StringUtils.abbreviate(insight.getText(), 32));
                    return;
                }

                try {
                    writer.writeStartElement(URI_NS, "insight");
                    writer.writeAttribute("participant", participantId);
                    writer.writeAttribute("index", Integer.toString(index++));
                    writer.writeCharacters("\n");

                    writer.writeStartElement(URI_NS, "date");
                    writer.writeCharacters(timeConv.toXML(aTask.getFinishDate()));
                    writer.writeEndElement();
                    writer.writeCharacters("\n");

                    writer.writeStartElement(URI_NS, "text");
                    this.writeWithLineBreaks(insight.getText());
                    writer.writeEndElement();
                    writer.writeCharacters("\n");

                    for (Entry<String, Integer> e : insight.getCharacteristicsValues()
                            .entrySet()) {
                        writer.writeStartElement(URI_NS, "criterion");
                        writer.writeAttribute("key", e.getKey());
                        if (e.getValue() != null) {
                            writer.writeCharacters(Integer.toString(e.getValue()));
                        }
                        writer.writeEndElement();
                        writer.writeCharacters("\n");
                    }

                    if (aTask.getScreenshotFilename() != null) {
                        writer.writeStartElement(URI_NS, "screenshot");
                        writer.writeCharacters(aTask.getScreenshotFilename());
                        writer.writeEndElement();
                        writer.writeCharacters("\n");
                    }

                    writer.writeEndElement();
                    writer.writeCharacters("\n");
                    writer.flush();
                } catch (XMLStreamException e) {
                    Logger.getLogger(XMLInsightJournal.class).warn(
                            "Could not record insight: "
                                    + StringUtils.abbreviate(insight.getText(), 32), e);
                }
            } else {
            Logger.getLogger(XMLInsightJournal.class).info(
                    "Skipped task (not an insight)");
            }
        }
    }

    private void writeWithLineBreaks(String in) throws XMLStreamException {
        String[] lines = in.split("\n");

        writer.writeCharacters(lines[0]);

        for (int i = 1; i < lines.length; i++) {
            writer.writeEmptyElement(URI_NS_XHTML, "br");
            writer.writeCharacters("\n");
            writer.writeCharacters(lines[i]);
        }
    }

    @Override
    public void sessionFinished() {
        if (writer == null) {
            Logger.getLogger(XMLInsightJournal.class).warn(
                    "Output closed, could not close it.");
            return;
        }
        try {
            writer.writeEndElement();
            writer.writeCharacters("\n");
            writer.writeEndDocument();
        } catch (XMLStreamException e) {
            Logger.getLogger(XMLInsightJournal.class).warn(
                    "Could not write end of document.", e);
        }
        try {
            writer.close();
        } catch (XMLStreamException e) {
            Logger.getLogger(XMLInsightJournal.class).warn(
                    "Could not close output.", e);
        }
        writer = null;
    }
}


text:
require 'spec_helper'

describe Puppet::Type.type(:local_security_policy) do
  [:name].each do |param|
    it "should have a #{param} parameter" do
      expect(Puppet::Type.type(:local_security_policy).attrtype(param)).to eq(:param)
    end
  end

  [:policy_type,:ensure, :ensure, :policy_setting, :policy_value].each do |param|
    it "should have an #{param} property" do
      expect(Puppet::Type.type(:local_security_policy).attrtype(param)).to eq(:property)
    end
  end

  describe 'test validation' do
    it 'can create a registry value' do
      resource = Puppet::Type.type(:local_security_policy).new(
          :name => 'Network access: Let Everyone permissions apply to anonymous users',
          :ensure => 'present',
          :policy_setting => 'MACHINE\System\CurrentControlSet\Control\Lsa\EveryoneIncludesAnonymous',
          :policy_type    => 'Registry Values',
          :policy_value   => '0')
      expect(resource[:policy_value]).to eq('4,0')
    end

    it 'raises an error with bad policy event audit value' do
      expect{
        Puppet::Type.type(:local_security_policy).new(
              :name => 'Audit account logon events',
              :ensure         => 'present',
              :policy_setting => "AuditAccountLogon",
              :policy_type    => "Event Audit",
              :policy_value   => 'xuccess,Failure',
          )}.to raise_error(Puppet::ResourceError)
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <FrameLayout
        android:id="@+id/sky"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.61"
        android:background="@color/blue_sky">

        <ImageView
            android:id="@+id/sun"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_gravity="center"
            android:src="@drawable/sun"/>

    </FrameLayout>

    <FrameLayout
        android:id="@+id/sea"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.39"
        android:background="@color/sea">

        <ImageView
            android:id="@+id/shadow"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_gravity="center_horizontal|bottom"
            android:src="@drawable/sun"/>

    </FrameLayout>

</LinearLayout>


text:
package com.google.aggregate.protocol.avro;

import javax.inject.Singleton;

/** Supplier of the Avro {@code Schema} for the output domain file schema */
@Singleton
public final class AvroOutputDomainSchemaSupplier extends AvroSchemaSupplier {

  @Override
  String schemaResourcePath() {
    return "/protocol/avro/output_domain.avsc";
  }
}


text:
javascript: new (function () {
    var ext = this; var recognized_speech = ''; var speaker = window.speechSynthesis;
    ext.recognize_speech = function (callback) {
        var recognition = new webkitSpeechRecognition();
        recognition.onresult = function (event) {
            if (event.results.length > 0) {
                recognized_speech = event.results[0][0].transcript;
                if (typeof callback == "function") callback()
            }
        };
        recognition.start()
    };
    ext.recognized_speech = function () {
        return recognized_speech
    }; ext.STTenabled = function () {
        return window.webkitSpeechRecognition != undefined
    }; ext._shutdown = function () { };
    ext._getStatus = function () {
        return {
            status: 2, msg: 'Ready'
        }
    };
    ext.getVoices = function() {
        return speaker.getVoices()
    };
    ext.setVoice = function(voice) {
        //speaker.voice = voice;
    };
    ext.speak_text = function (text, callback) {
        speaker.onend = function (event) {
            if (typeof callback == "function") callback()
        };
        speaker.speak(text.toString());
    };
    ext.TTSenabled = function () {
        return window.SpeechSynthesisUtterance != undefined
    }; ext._shutdown = function () { }; ext._getStatus = function () {
        if (window.SpeechSynthesisUtterance === undefined) {
            return {status: 1, msg: 'Your browser does not support text to speech. Try using Google Chrome or Safari.' }
        } return { status: 2, msg: 'Ready' }
    };
    var descriptor = { blocks: [['w', 'wait and recognize speech', 'recognize_speech'], ['r', 'recognized speech', 'recognized_speech'], ['b', 'speech to text enabled', 'STTenabled'], ['w', 'speak %s', 'speak_text', 'Hello!'], ['b', 'text to speech enabled', 'TTSenabled'], [' ', 'set voice to ', 'setVoice']]/*, menus:{speechChoices:getVoices()}*/ };
    ScratchExtensions.register('OneExt', descriptor, ext)
})();


text:
define([

  // ### Requirements

  // Handy third party functions
  'parsley/utils',
  // Parsley default configuration
  'parsley/defaults',
  // An abstract class shared by `ParsleyField` and `ParsleyForm`
  'parsley/abstract',
  // A proxy between Parsley and [Validator.js](http://validatorjs.org)
  'parsley/validator',
  // `ParsleyUI` static class. Handle all UI and UX
  'parsley/ui',
  // Handle default javascript config and DOM-API config
  'parsley/factory/options',
  // `ParsleyForm` Class. Handle form validation
  'parsley/form',
  // `ParsleyField` Class. Handle field validation
  'parsley/field',
  // `Multiple` Class. Extend `ParsleyField` to generate `ParsleyFieldMultiple`
  'parsley/multiple',
  // Tiny Parsley Pub / Sub mechanism, used for `ParsleyUI` and Listeners
  'parsley/pubsub',
  // Default en constraints messages
  'i18n/en'
], function (ParsleyUtils, ParsleyDefaults, ParsleyAbstract, ParsleyValidator, ParsleyUI, ParsleyOptionsFactory, ParsleyForm, ParsleyField, ParsleyMultiple) {
  // ### Parsley factory
  var Parsley = function (element, options, parsleyInstance) {
    this.__class__ = 'Parsley';
    this.__version__ = '@@version';
    this.__id__ = ParsleyUtils.hash(4);

    // Parsley must be instanciated with a DOM element or jQuery $element
    if ('undefined' === typeof element)
      throw new Error('You must give an element');

    return this.init($(element), options, parsleyInstance);
  };

  Parsley.prototype = {
    init: function ($element, options, parsleyInstance) {
      if (!$element.length)
        throw new Error('You must bind Parsley on an existing element.');

      this.$element = $element;

      // If element have already been binded, returns its saved Parsley instance
      if (this.$element.data('Parsley')) {
        var savedParsleyInstance = this.$element.data('Parsley');

        // If saved instance have been binded without a ParsleyForm parent and there is one given in this call, add it
        if ('undefined' !== typeof parsleyInstance && 'ParsleyField' === savedParsleyInstance.parsleyInstance.__proxy__)
          savedParsleyInstance.parsleyInstance = parsleyInstance;

        return savedParsleyInstance;
      }

      // Handle 'static' options
      this.OptionsFactory = new ParsleyOptionsFactory(ParsleyDefaults, ParsleyUtils.get(window, 'ParsleyConfig') || {}, options, this.getNamespace(options));
      this.options = this.OptionsFactory.get(this);

      // A ParsleyForm instance is obviously a `<form>` elem but also every node that is not an input and have `data-parsley-validate` attribute
      if (this.$element.is('form') || (ParsleyUtils.attr(this.$element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))
        return this.bind('parsleyForm', parsleyInstance);

      // Every other supported element and not excluded element is binded as a `ParsleyField` or `ParsleyFieldMultiple`
      else if (this.$element.is(this.options.inputs) && !this.$element.is(this.options.excluded))
        return this.isMultiple() ? this.handleMultiple(parsleyInstance) : this.bind('parsleyField', parsleyInstance);

      return this;
    },

    isMultiple: function () {
      return (this.$element.is('input[type=radio], input[type=checkbox]') && 'undefined' === typeof this.options.multiple) || (this.$element.is('select') && 'undefined' !== typeof this.$element.attr('multiple'));
    },

    // Multiples fields are a real nightmare :(
    handleMultiple: function (parsleyInstance) {
      var
        that = this,
        name,
        multiple,
        parsleyMultipleInstance;

      this.options = $.extend(this.options, ParsleyUtils.attr(this.$element, this.options.namespace));

      if (this.options.multiple) {
        multiple = this.options.multiple;
      } else if ('undefined' !== typeof this.$element.attr('name') && this.$element.attr('name').length) {
        multiple = name = this.$element.attr('name');
      } else if ('undefined' !== typeof this.$element.attr('id') && this.$element.attr('id').length) {
        multiple = this.$element.attr('id');
      }

      // Special select multiple input
      if (this.$element.is('select') && 'undefined' !== typeof this.$element.attr('multiple')) {
        return this.bind('parsleyFieldMultiple', parsleyInstance, multiple || this.__id__);

      // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it
      } else if ('undefined' === typeof multiple) {
        if (window.console && window.console.warn)
          window.console.warn('To be binded by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);

        return this;
      }

      // Remove special chars
      multiple = multiple.replace(/(:|\.|\[|\]|\$)/g, '');

      // Add proper `data-parsley-multiple` to siblings if we had a name
      if ('undefined' !== typeof name)
        $('input[name="' + name + '"]').each(function () {
          if ($(this).is('input[type=radio], input[type=checkbox]'))
            $(this).attr(that.options.namespace + 'multiple', multiple);
        });

      // Check here if we don't already have a related multiple instance saved
      if ($('[' + this.options.namespace + 'multiple=' + multiple +']').length)
        for (var i = 0; i < $('[' + this.options.namespace + 'multiple=' + multiple +']').length; i++)
          if ('undefined' !== typeof $($('[' + this.options.namespace + 'multiple=' + multiple +']').get(i)).data('Parsley')) {
            parsleyMultipleInstance = $($('[' + this.options.namespace + 'multiple=' + multiple +']').get(i)).data('Parsley');

            if (!this.$element.data('ParsleyFieldMultiple')) {
              parsleyMultipleInstance.addElement(this.$element);
              this.$element.attr(this.options.namespace + 'id', parsleyMultipleInstance.__id__);
            }

            break;
          }

      // Create a secret ParsleyField instance for every multiple field. It would be stored in `data('ParsleyFieldMultiple')`
      // And would be useful later to access classic `ParsleyField` stuff while being in a `ParsleyFieldMultiple` instance
      this.bind('parsleyField', parsleyInstance, multiple, true);

      return parsleyMultipleInstance || this.bind('parsleyFieldMultiple', parsleyInstance, multiple);
    },

    // Retrieve namespace used for DOM-API
    getNamespace: function (options) {
      // `data-parsley-namespace=<namespace>`
      if ('undefined' !== typeof this.$element.data('parsleyNamespace'))
        return this.$element.data('parsleyNamespace');
      if ('undefined' !== typeof ParsleyUtils.get(options, 'namespace'))
        return options.namespace;
      if ('undefined' !== typeof ParsleyUtils.get(window, 'ParsleyConfig.namespace'))
        return window.ParsleyConfig.namespace;

      return ParsleyDefaults.namespace;
    },

    // Return proper `ParsleyForm`, `ParsleyField` or `ParsleyFieldMultiple`
    bind: function (type, parentParsleyInstance, multiple, doNotStore) {
      var parsleyInstance;

      switch (type) {
        case 'parsleyForm':
          parsleyInstance = $.extend(
            new ParsleyForm(this.$element, parentParsleyInstance || this),
            new ParsleyAbstract(),
            window.ParsleyExtend
          ).init();
          break;
        case 'parsleyField':
          parsleyInstance = $.extend(
            new ParsleyField(this.$element, parentParsleyInstance || this),
            new ParsleyAbstract(),
            window.ParsleyExtend
          ).init();
          break;
        case 'parsleyFieldMultiple':
          parsleyInstance = $.extend(
            new ParsleyField(this.$element, parentParsleyInstance || this).init(),
            new ParsleyAbstract(),
            new ParsleyMultiple(),
            window.ParsleyExtend
          ).init(multiple);
          break;
        default:
          throw new Error(type + 'is not a supported Parsley type');
      }

      if ('undefined' !== typeof multiple)
        ParsleyUtils.setAttr(this.$element, this.options.namespace, 'multiple', multiple);

      if ('undefined' !== typeof doNotStore) {
        this.$element.data('ParsleyFieldMultiple', parsleyInstance);

        return parsleyInstance;
      }

      // Store instance if `ParsleyForm`, `ParsleyField` or `ParsleyFieldMultiple`
      if (new RegExp('ParsleyF', 'i').test(parsleyInstance.__class__)) {
        // Store for later access the freshly binded instance in DOM element itself using jQuery `data()`
        this.$element.data('Parsley', parsleyInstance);
        this.__proxy__ = parsleyInstance.__class__;

        // Tell the world we got a new ParsleyForm or ParsleyField instance!
        $.emit('parsley:' + ('parsleyForm' === type ? 'form' : 'field') + ':init', parsleyInstance);
      }

      return parsleyInstance;
    }
  };

  // ### jQuery API
  // `$('.elem').parsley(options)` or `$('.elem').psly(options)`
  $.fn.parsley = $.fn.psly = function (options) {
    if (this.length > 1) {
      var instances = [];

      this.each(function () {
        instances.push($(this).parsley(options));
      });

      return instances;
    }

    // Return undefined if applied to non existing DOM element
    if (!$(this).length) {
      if (window.console && window.console.warn)
        window.console.warn('You must bind Parsley on an existing element.');

      return;
    }

    return new Parsley(this, options);
  };

  // ### ParsleyUI
  // UI is a class apart that only listen to some events and them modify DOM accordingly
  // Could be overriden by defining a `window.ParsleyConfig.ParsleyUI` appropriate class (with `listen()` method basically)
  window.ParsleyUI = 'function' === typeof ParsleyUtils.get(window, 'ParsleyConfig.ParsleyUI') ?
    new window.ParsleyConfig.ParsleyUI().listen() : new ParsleyUI().listen();

  // ### ParsleyField and ParsleyForm extension
  // Ensure that defined if not already the case
  if ('undefined' === typeof window.ParsleyExtend)
    window.ParsleyExtend = {};

  // ### ParsleyConfig
  // Ensure that defined if not already the case
  if ('undefined' === typeof window.ParsleyConfig)
    window.ParsleyConfig = {};

  // ### Globals
  window.Parsley = window.psly = Parsley;
  window.ParsleyUtils = ParsleyUtils;
  window.ParsleyValidator = new ParsleyValidator(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);

  // ### PARSLEY auto-binding
  // Prevent it by setting `ParsleyConfig.autoBind` to `false`
  if (false !== ParsleyUtils.get(window, 'ParsleyConfig.autoBind'))
    $(document).ready(function () {
      // Works only on `data-parsley-validate`.
      if ($('[data-parsley-validate]').length)
        $('[data-parsley-validate]').parsley();
    });

  return Parsley;
});


text:
class Type {
    void main(MainClass.Companion.T t) {
    }
}


text:
package net.tascalate.async.examples.generator;

import static net.tascalate.async.CallContext.async;
import static net.tascalate.async.CallContext.await;
import static net.tascalate.async.CallContext.yield;

import java.util.concurrent.CompletionException;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import net.tascalate.async.AsyncGenerator;
import net.tascalate.async.YieldReply;
import net.tascalate.async.async;
import net.tascalate.concurrent.CompletableTask;
import net.tascalate.concurrent.Promise;

public class ExceptionsTest {
    final private static ExecutorService executor = Executors.newFixedThreadPool(4);

    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();
        try {
            System.out.println( consumer().get() );
        } finally {
            executor.shutdownNow();
        }
        double finish = System.currentTimeMillis();
        System.out.println((finish - start) / 1000 + " seconds");
    }

    @async static Promise<String> consumer() {
        try (AsyncGenerator<Object> g = producer()) {
            CompletionStage<Object> f = null;
            while (null != (f = g.next())) {
                System.out.println("Consumed future: " + f);
                try {
                    System.out.println("RESULT: " + await(f));
                } catch (IllegalArgumentException ex) {
                    System.out.println("Consumed exception (await): " + ex);
                }
                System.out.println(f);
            }
        } catch (IllegalArgumentException ex) {
            System.out.println("Consumed exception (next): " + ex);
        }

        return async("Done");
    }

    @async static AsyncGenerator<Object> producer() {
        for (int i = 0; i < 10; i++) {
            if (i % 2 == 0) {
                YieldReply<String> reply = yield(waitString("VALUE " + i, 100));
                System.out.println("REPLY AFTER NORMAL: " + reply);
            } else {
                try {
                    YieldReply<String> reply = yield(waitError(100));
                    System.out.println("REPLY AFTER ERROR: " + reply);
                } catch (IllegalArgumentException ex) {
                    System.out.println("EXCEPTION ON iter#" + i + ": " + ex);
                    //throw ex;
                }
            }
        }
        return yield();
    }

    static CompletionStage<String> waitString(final String value, final long delay) {
        final CompletionStage<String> promise = CompletableTask.supplyAsync(() -> {
            try {
                Thread.sleep(delay);
            } catch (final InterruptedException ex) {
                Thread.currentThread().interrupt();
                throw new CompletionException(ex);
            }
            return value;
        }, executor);
        return promise;
    }

    static CompletionStage<String> waitError(final long delay) {
        final CompletionStage<String> promise = CompletableTask.supplyAsync(() -> {
            try {
                Thread.sleep(delay);
            } catch (final InterruptedException ex) {
                Thread.currentThread().interrupt();
                throw new CompletionException(ex);
            }
            throw new IllegalArgumentException("Just for fun!");
        }, executor);
        return promise;
    }
}


text:
import {
  InspectionIdentifiableInferedType,
  InspectionFunction,
  InspectionType,
} from '../inspection';

export function getPrettyIdentifier(inferredType: InspectionIdentifiableInferedType): string {
  const { type, identifier } = inferredType;

  switch (type) {
    case InspectionType.FUNCTION:
      return getPrettyFuncIdentifier(identifier, (inferredType as InspectionFunction).hasParams);
    case InspectionType.ELEMENT:
      return getPrettyElementIdentifier(identifier);
    default:
      return identifier;
  }
}

export function getPrettyFuncIdentifier(identifier: string, hasArguments: boolean): string {
  return hasArguments ? `${identifier}( ... )` : `${identifier}()`;
}

export function getPrettyElementIdentifier(identifier: string) {
  return `<${identifier} />`;
}


text:
import { TestHelper } from './TestHelper';
import { Utils } from '../utils/Utils';

/**
 * Unit tests for react-a11y-required rule.
 */
describe('reactA11yRequiredRule', (): void => {
    const ruleName: string = 'react-a11y-required';
    const FAILURE_STRING: string = 'Required input elements must have an aria-required set to true';

    describe('should pass', (): void => {
        it('when there is no required input element', (): void => {
            const script: string = `
                import React = require('react');
                const a = <input type='text' />;
                const b = <input type='text' />;
                const c = <input type='image' />;
                const d = <input type='password' />;
                const e = <input type='checkbox' />;
            `;

            TestHelper.assertNoViolation(ruleName, script);
        });

        it('when there is a required input element with aria-required set to true', (): void => {
            const script: string = `
                import React = require('react');
                const a = <input type='text' required aria-required='true' />;
                const b = <input type='text' required aria-required={ 'true' } />;
                const c = <input type='image' aria-required='true' required />;
                const d = <input type='text' aria-required={true} required />;
                const e = <input type='checkbox' required aria-required='true' />;
            `;

            TestHelper.assertNoViolation(ruleName, script);
        });
    });

    describe('should fail', (): void => {
        it('when there is a required element without aria-required', (): void => {
            const script: string = `
                import React = require('react');
                const a = <input type='text' required />;
                const b = <input required type='text' />;
                const c = <input type='image' required />;
                const d = <input type='password' required />;
                const e = <input required type='checkbox' />;
            `;

            TestHelper.assertViolations(ruleName, script, [
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 3 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 4 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 5 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 6 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 7 },
                    failure: FAILURE_STRING
                }
            ]);
        });

        it('when there is a required element with an invalid value for aria-required', (): void => {
            const script: string = `
                import React = require('react');
                const a = <input type='text' required aria-required='' />;
                const b = <input type='text' required aria-required={ undefined } />;
                const c = <input type='image' aria-required={ '' } required />;
                const d = <input type='password' aria-required={ null } required />;
                const e = <input type='checkbox' required aria-required />;
                const f = <input type='checkbox' required aria-required='carrots' />;
                const g = <input type='checkbox' required aria-required={'pineapples'} />;
            `;

            TestHelper.assertViolations(ruleName, script, [
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 3 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 4 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 5 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 6 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 7 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 8 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 9 },
                    failure: FAILURE_STRING
                }
            ]);
        });

        it('when there is a required element with aria-required set to false', (): void => {
            const script: string = `
                import React = require('react');
                const a = <input type='text' required aria-required='false' />;
                const b = <input type='text' required aria-required={ 'false' } />;
                const c = <input type='image' aria-required='false' required />;
                const d = <input type='password' aria-required={false} required />;
                const e = <input type='checkbox' required aria-required='false' />;
            `;

            TestHelper.assertViolations(ruleName, script, [
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 3 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 4 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 5 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 6 },
                    failure: FAILURE_STRING
                },
                {
                    name: Utils.absolutePath('file.tsx'),
                    ruleName: ruleName,
                    startPosition: { character: 27, line: 7 },
                    failure: FAILURE_STRING
                }
            ]);
        });
    });
});


text:
describe("EnvironmentVariable Model", () => {

  const s = require('string-plus');

  const EnvironmentVariables = require("models/pipeline_configs/environment_variables");

  let variables, plainVariable, secureVariable;
  beforeEach(() => {
    variables = new EnvironmentVariables();

    plainVariable = variables.createVariable({
      name:   "WORKING_DIR",
      value:  "/var/foo",
      secure: false
    });

    secureVariable = variables.createVariable({
      name:           "HTTP_PASSWORD",
      secure:         true,
      encryptedValue: "c!ph3rt3xt"
    });
  });

  it("should initialize variable model with name", () => {
    expect(plainVariable.name()).toBe("WORKING_DIR");
  });

  it("should initialize variable model with value", () => {
    expect(plainVariable.value()).toBe('/var/foo');
  });

  it("should initialize variable model with secure flag", () => {
    expect(plainVariable.isSecureValue()).toBe(false);
  });

  it("should initialize variable model with encryptedValue", () => {
    expect(secureVariable.value()).toBe('c!ph3rt3xt');
  });

  describe("validations", () => {
    it("should add error when name is blank but value is not", () => {
      plainVariable.name("");
      plainVariable.value('foo');
      const errors = plainVariable.validate();
      expect(errors.errors('name')).toEqual(['Name must be present']);
    });

    it("should NOT add error when both name and value are blank", () => {
      plainVariable.name("");
      plainVariable.value("");

      const errors = plainVariable.validate();
      expect(errors._isEmpty()).toBe(true);
    });

    it("should not allow variables with duplicate names", () => {
      let errorsOnOriginal = plainVariable.validate();
      expect(errorsOnOriginal._isEmpty()).toBe(true);

      const duplicateVariable = variables.createVariable({
        name: "WORKING_DIR"
      });

      errorsOnOriginal = plainVariable.validate();
      expect(errorsOnOriginal.errors('name')).toEqual(['Name is a duplicate']);

      const errorsOnDuplicate = duplicateVariable.validate();
      expect(errorsOnDuplicate.errors('name')).toEqual(['Name is a duplicate']);
    });
  });

  describe("Deserialization from JSON", () => {
    beforeEach(() => {
      plainVariable  = EnvironmentVariables.Variable.fromJSON(samplePlainVariableJSON());
      secureVariable = EnvironmentVariables.Variable.fromJSON(sampleSecureVariableJSON());
    });

    it("should initialize plain variable from json", () => {
      expect(plainVariable.name()).toBe("WORKING_DIR");
      expect(plainVariable.value()).toBe('/var/foo');
      expect(plainVariable.isSecureValue()).toBe(false);
    });

    it("should initialize secure variable from json", () => {
      expect(secureVariable.name()).toBe("HTTP_PASSWORD");
      expect(secureVariable.isSecureValue()).toBe(true);
      expect(secureVariable.value()).toBe('c!ph3rt3xt');
    });

    it("should serialize plain variables to json", () => {
      expect(JSON.parse(JSON.stringify(plainVariable, s.snakeCaser))).toEqual(samplePlainVariableJSON());
    });

    it("should serialize encrypted variables to json", () => {
      expect(JSON.parse(JSON.stringify(secureVariable, s.snakeCaser))).toEqual(sampleSecureVariableJSON());
    });

    function samplePlainVariableJSON() {
      return {
        name:   "WORKING_DIR",
        value:  "/var/foo",
        secure: false
      };
    }

    function sampleSecureVariableJSON() {
      return {
        name:            "HTTP_PASSWORD",
        encrypted_value: "c!ph3rt3xt", // eslint-disable-line camelcase
        secure:          true
      };
    }
  });
});


text:
테스트 실행
nodemon index.js
open link http://localhost:3000/atommerce/ at browser


text:
{% load videostore_extras %}

{% if ratings.count %}
	{% include 'intro/snippets/star_rating.html' with number=ratings.avg big=1 %}
{% endif %}