text:
/* Generated SBE (Simple Binary Encoding) message codec */
#ifndef _DARKFEED_SCHEMAS_SBE_EQUITY_QUOTE_H_
#define _DARKFEED_SCHEMAS_SBE_EQUITY_QUOTE_H_

#if defined(SBE_HAVE_CMATH)
/* cmath needed for std::numeric_limits<double>::quiet_NaN() */
#  include <cmath>
#  define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
#  define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
#  include <math.h>
#  define SBE_FLOAT_NAN NAN
#  define SBE_DOUBLE_NAN NAN
#endif

#if __cplusplus >= 201103L
#  include <cstdint>
#  include <string>
#  include <cstring>
#endif

#if __cplusplus >= 201103L
#  define SBE_CONSTEXPR constexpr
#else
#  define SBE_CONSTEXPR
#endif

#include <sbe/sbe.h>

#include "MessageHeader.h"
#include "Bool.h"
#include "MIC.h"
#include "Symbol.h"
#include "MIC.h"
#include "IssueType.h"
#include "HaltStatus.h"
#include "Timestamp.h"
#include "TradeCondition.h"
#include "QuoteCondition.h"
#include "Price.h"
#include "Currency.h"
#include "HaltType.h"
#include "OptionType.h"

using namespace sbe;

namespace darkfeed
{
namespace schemas
{
namespace sbe
{

class Equity_quote {
 private:
    char *m_buffer;
    std::uint64_t m_bufferLength;
    std::uint64_t *m_positionPtr;
    std::uint64_t m_offset;
    std::uint64_t m_position;
    std::uint64_t m_actingBlockLength;
    std::uint64_t m_actingVersion;

    inline void reset(
        char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength,
        const std::uint64_t actingBlockLength, const std::uint64_t actingVersion)
    {
        m_buffer = buffer;
        m_offset = offset;
        m_bufferLength = bufferLength;
        m_actingBlockLength = actingBlockLength;
        m_actingVersion = actingVersion;
        m_positionPtr = &m_position;
        position(offset + m_actingBlockLength);
    }

 public:

    Equity_quote() : m_buffer(nullptr), m_bufferLength(0), m_offset(0)
    {}

    Equity_quote(char *buffer, const std::uint64_t bufferLength)
    {
        reset(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion());
    }

    Equity_quote(char *buffer, const std::uint64_t bufferLength, const std::uint64_t actingBlockLength, const std::uint64_t actingVersion)
    {
        reset(buffer, 0, bufferLength, actingBlockLength, actingVersion);
    }

    static SBE_CONSTEXPR std::uint16_t sbeBlockLength()
    {
        return (std::uint16_t) 57;
    }

    static SBE_CONSTEXPR std::uint16_t sbeTemplateId()
    {
        return (std::uint16_t) 1;
    }

    static SBE_CONSTEXPR std::uint16_t sbeSchemaId()
    {
        return (std::uint16_t) 3116;
    }

    static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion()
    {
        return (std::uint16_t) 0;
    }

    static SBE_CONSTEXPR const char *sbeSemanticType()
    {
        return "";
    }

    std::uint64_t offset() const
    {
        return m_offset;
    }

    Equity_quote &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength)
    {
        reset(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion());
        return *this;
    }

    Equity_quote &wrapForDecode(
        char *buffer, const std::uint64_t offset, const std::uint64_t actingBlockLength,
        const std::uint64_t actingVersion, const std::uint64_t bufferLength)
    {
        reset(buffer, offset, bufferLength, actingBlockLength, actingVersion);
        return *this;
    }

    std::uint64_t position() const
    {
        return m_position;
    }

    void position(const std::uint64_t position)
    {
        if (SBE_BOUNDS_CHECK_EXPECT((position > m_bufferLength), false))
        {
            throw std::runtime_error("buffer too short [E100]");
        }
        m_position = position;
    }

    std::uint64_t encodedLength() const
    {
        return position() - m_offset;
    }

    char *buffer()
    {
        return m_buffer;
    }

    std::uint64_t actingVersion() const
    {
        return m_actingVersion;
    }

    static SBE_CONSTEXPR std::uint16_t symbolId()
    {
        return 1;
    }

    static SBE_CONSTEXPR std::uint64_t symbolSinceVersion()
    {
        return 0;
    }

    bool symbolInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= symbolSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t symbolEncodingOffset()
    {
        return 0;
    }

    static const char *symbolMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

 private:
    Symbol m_symbol;

 public:

    Symbol &symbol()
    {
        m_symbol.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength);
        return m_symbol;
    }

    static SBE_CONSTEXPR std::uint16_t reporting_exgId()
    {
        return 2;
    }

    static SBE_CONSTEXPR std::uint64_t reporting_exgSinceVersion()
    {
        return 0;
    }

    bool reporting_exgInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= reporting_exgSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t reporting_exgEncodingOffset()
    {
        return 11;
    }

    static const char *reporting_exgMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

    MIC::Value reporting_exg() const
    {
        return MIC::get((*((std::uint8_t *) (m_buffer + m_offset + 11))));
    }

    Equity_quote &reporting_exg(const MIC::Value value)
    {
        *((std::uint8_t *) (m_buffer + m_offset + 11)) = (value);
        return *this;
    }
    static SBE_CONSTEXPR std::size_t reporting_exgEncodingLength()
    {
        return 1;
    }

    static SBE_CONSTEXPR std::uint16_t tsId()
    {
        return 3;
    }

    static SBE_CONSTEXPR std::uint64_t tsSinceVersion()
    {
        return 0;
    }

    bool tsInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= tsSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t tsEncodingOffset()
    {
        return 12;
    }

    static const char *tsMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

 private:
    Timestamp m_ts;

 public:

    Timestamp &ts()
    {
        m_ts.wrap(m_buffer, m_offset + 12, m_actingVersion, m_bufferLength);
        return m_ts;
    }

    static SBE_CONSTEXPR std::uint16_t seq_numId()
    {
        return 4;
    }

    static SBE_CONSTEXPR std::uint64_t seq_numSinceVersion()
    {
        return 0;
    }

    bool seq_numInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= seq_numSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t seq_numEncodingOffset()
    {
        return 26;
    }

    static const char *seq_numMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

    static SBE_CONSTEXPR std::uint64_t seq_numNullValue()
    {
        return SBE_NULLVALUE_UINT64;
    }

    static SBE_CONSTEXPR std::uint64_t seq_numMinValue()
    {
        return 0x0L;
    }

    static SBE_CONSTEXPR std::uint64_t seq_numMaxValue()
    {
        return 0xfffffffffffffffeL;
    }

    static SBE_CONSTEXPR std::size_t seq_numEncodingLength()
    {
        return 8;
    }

    std::uint64_t seq_num() const
    {
        return SBE_LITTLE_ENDIAN_ENCODE_64(*((std::uint64_t *) (m_buffer + m_offset + 26)));
    }

    Equity_quote &seq_num(const std::uint64_t value)
    {
        *((std::uint64_t *) (m_buffer + m_offset + 26)) = SBE_LITTLE_ENDIAN_ENCODE_64(value);
        return *this;
    }

    static SBE_CONSTEXPR std::uint16_t bidId()
    {
        return 5;
    }

    static SBE_CONSTEXPR std::uint64_t bidSinceVersion()
    {
        return 0;
    }

    bool bidInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= bidSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t bidEncodingOffset()
    {
        return 34;
    }

    static const char *bidMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

 private:
    Price m_bid;

 public:

    Price &bid()
    {
        m_bid.wrap(m_buffer, m_offset + 34, m_actingVersion, m_bufferLength);
        return m_bid;
    }

    static SBE_CONSTEXPR std::uint16_t askId()
    {
        return 6;
    }

    static SBE_CONSTEXPR std::uint64_t askSinceVersion()
    {
        return 0;
    }

    bool askInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= askSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t askEncodingOffset()
    {
        return 41;
    }

    static const char *askMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

 private:
    Price m_ask;

 public:

    Price &ask()
    {
        m_ask.wrap(m_buffer, m_offset + 41, m_actingVersion, m_bufferLength);
        return m_ask;
    }

    static SBE_CONSTEXPR std::uint16_t bid_sizeId()
    {
        return 7;
    }

    static SBE_CONSTEXPR std::uint64_t bid_sizeSinceVersion()
    {
        return 0;
    }

    bool bid_sizeInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= bid_sizeSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t bid_sizeEncodingOffset()
    {
        return 48;
    }

    static const char *bid_sizeMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

    static SBE_CONSTEXPR std::uint32_t bid_sizeNullValue()
    {
        return SBE_NULLVALUE_UINT32;
    }

    static SBE_CONSTEXPR std::uint32_t bid_sizeMinValue()
    {
        return 0;
    }

    static SBE_CONSTEXPR std::uint32_t bid_sizeMaxValue()
    {
        return 4294967293;
    }

    static SBE_CONSTEXPR std::size_t bid_sizeEncodingLength()
    {
        return 4;
    }

    std::uint32_t bid_size() const
    {
        return SBE_LITTLE_ENDIAN_ENCODE_32(*((std::uint32_t *) (m_buffer + m_offset + 48)));
    }

    Equity_quote &bid_size(const std::uint32_t value)
    {
        *((std::uint32_t *) (m_buffer + m_offset + 48)) = SBE_LITTLE_ENDIAN_ENCODE_32(value);
        return *this;
    }

    static SBE_CONSTEXPR std::uint16_t ask_sizeId()
    {
        return 8;
    }

    static SBE_CONSTEXPR std::uint64_t ask_sizeSinceVersion()
    {
        return 0;
    }

    bool ask_sizeInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= ask_sizeSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t ask_sizeEncodingOffset()
    {
        return 52;
    }

    static const char *ask_sizeMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

    static SBE_CONSTEXPR std::uint32_t ask_sizeNullValue()
    {
        return SBE_NULLVALUE_UINT32;
    }

    static SBE_CONSTEXPR std::uint32_t ask_sizeMinValue()
    {
        return 0;
    }

    static SBE_CONSTEXPR std::uint32_t ask_sizeMaxValue()
    {
        return 4294967293;
    }

    static SBE_CONSTEXPR std::size_t ask_sizeEncodingLength()
    {
        return 4;
    }

    std::uint32_t ask_size() const
    {
        return SBE_LITTLE_ENDIAN_ENCODE_32(*((std::uint32_t *) (m_buffer + m_offset + 52)));
    }

    Equity_quote &ask_size(const std::uint32_t value)
    {
        *((std::uint32_t *) (m_buffer + m_offset + 52)) = SBE_LITTLE_ENDIAN_ENCODE_32(value);
        return *this;
    }

    static SBE_CONSTEXPR std::uint16_t conditionId()
    {
        return 9;
    }

    static SBE_CONSTEXPR std::uint64_t conditionSinceVersion()
    {
        return 0;
    }

    bool conditionInActingVersion()
    {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
        return m_actingVersion >= conditionSinceVersion();
#pragma clang diagnostic pop
    }

    static SBE_CONSTEXPR std::size_t conditionEncodingOffset()
    {
        return 56;
    }

    static const char *conditionMetaAttribute(const MetaAttribute::Attribute metaAttribute)
    {
        switch (metaAttribute)
        {
        case MetaAttribute::EPOCH: return "unix";
        case MetaAttribute::TIME_UNIT: return "nanosecond";
        case MetaAttribute::SEMANTIC_TYPE: return "";
        }

        return "";
    }

    QuoteCondition::Value condition() const
    {
        return QuoteCondition::get((*((std::uint8_t *) (m_buffer + m_offset + 56))));
    }

    Equity_quote &condition(const QuoteCondition::Value value)
    {
        *((std::uint8_t *) (m_buffer + m_offset + 56)) = (value);
        return *this;
    }
    static SBE_CONSTEXPR std::size_t conditionEncodingLength()
    {
        return 1;
    }
};
}
}
}
#endif


text:
<?php

namespace adytyl\nonces-wordpress;

class VerifierTest extends \PHPUnit_Framework_TestCase
{

    static $time = 1394739437;
    static $nonce = 'o6r4837840';

    public static function setUpBeforeClass()
    {
        Config::setLife(10000);
        Config::setSalt('salt');
        Config::setUid(1);
        Config::setSessiontoken('session-1');
    }

    public function setUp()
    {
        time(self::$time);
    }

    public static function tearDownAfterClass()
    {
        Config::setLife(10000);
        Config::setSalt(null);
        Config::setUid(null);
        Config::setSessiontoken(null);
    }

}

redpajama_set_name: RedPajamaGithub


text:
Lokka Hatena Bookmark Button
============================

This is a [Lokka](http://lokka.org) plugin to add ["Hatena Bookmark Button"](http://b.hatena.ne.jp/guide/bbutton) link.

Installation
------------

Run these commands:

    $ cd public/plugin
    $ git clone git://github.com/nkmrshn/lokka-hatena_bookmark_button.git

Usage
-----

You can set options in the admin page [Plugins]->[Hatena Bookmark Button].

The helper method is "hatena_bookmark_button".  Don't forget to modify the theme template. This helper method has two parameters. First is for title and second is URL. If the hatena_bookmark_button method called without URL, current page URL will be used. If you want to specify the URL, call the method with String parameter like:

    <%= hatena_bookmark_button(@entry.title, "http://example.com/foo/bar/") %>


text:
indicator = {

    shortcode: 'D5',
    shortcodeSlug: 'd5',
    name: 'Erhöhung der sozialen und ökologischen Branchenstandards',
    points: 30,
    soleProprietorship: true,
    goals: {},
    impulsQuestions: {},
    table: {
        subindicators: [
            {
                title: 'Kooperation mit MitwerberInnen und Partnern der Wertschöpfungs-kette',
                relevance: 'high',
                position: '1',
                soleProprietorship: true,
                developmentTracks: [
                    {
                        developmentDetails: [
                            {
                                levels: ['beginner'],
                                description: 'Erste Pilotprojekte zur gemeinsamen Entwicklung höherer Standards mit Marktpartnern (z.B.: F&E-Kooperation)

Keine wesentlichen Konflikte mit Zivilgesellschaft bezügl. der Standards

Aktive Kommunikation höherer Standards nach Außen (z.B.: Webseite)'
                            },
                            {
                                levels: ['advanced'],
                                description: 'Regelmäßige, etablierte Mechanismen zur gemeinsamen Entwicklung höherer Standards

Höhere Standards wesentlicher Bestandteil der Kommunikationspolitik des Unternehmens'
                            },
                            {
                                levels: ['experienced'],
                                description: 'Selbstverpflichtung auf Branchenebene'
                            },
                            {
                                levels: ['model'],
                                description: 'Sicherstellung und Überprüfbarkeit der höheren Standards  (z.B.: externe Audits und unabhängige Kontrollen; Kooperation mit NGOs)'
                            }
                        ]
                    }
                ]
            },
            {
                title: 'Aktiver Beitrag zur Erhöhung legislativer Standards',
                relevance: 'middle',
                position: '2',
                soleProprietorship: true,
                developmentTracks: [
                    {
                        developmentDetails: [
                            {
                                levels: ['beginner'],
                                description: 'Transparente Offenlegung der politischen Aktivitäten

Kein Widerstand gegen höhere soziale und ökologische legislative Standards'
                            },
                            {
                                levels: ['advanced'],
                                description: 'Brancheninternes Engagement für höhere legislative Standards

(z.B.: in Kooperation mit Branchenvertretung)'
                            },
                            {
                                levels: ['experienced'],
                                description: 'Über die Branche hinausgehendes Engagement für höhere legislative Standards (z.B.: Kooperation mit NGOs)'
                            },
                            {
                                levels: ['model'],
                                description: 'Transparente, wesentliche Berührungsgruppen inkludierender Lobbying-Prozess (z.B.: Ausformulierte Gesetzesinitiativen)'
                            }
                        ]
                    }
                ]
            },
            {
                title: 'Reichweite, inhaltliche Breite und Tiefe',
                relevance: 'high',
                position: '3',
                soleProprietorship: true,
                developmentTracks: [
                    {
                        developmentDetails: [
                            {
                                levels: ['beginner'],
                                description: 'Ein sozialer oder ökologischer Randaspekt betroffen'
                            },
                            {
                                levels: ['advanced'],
                                description: 'Ein wesentlicher sozialer oder ökologischer Aspekt betroffen

Tatsächliche Umsetzung höherer Standards betrifft > 25% des Umsatzes'
                            },
                            {
                                levels: ['experienced'],
                                description: 'Mehrere, wesentliche  soziale oder ökologische Aspekte betroffen

Tatsächliche Umsetzung höherer Standards > 50%'
                            },
                            {
                                levels: ['model'],
                                description: 'Alle wesentlichen sozialökologischen Aspekte

Erhöhung der Branchenstandards ist inhärenter Bestandteil der Unternehmenspositionierung (> 90%)'
                            }
                        ]
                    }
                ]
            }
        ]
    },
    details: {},
    definition: {},
    bestPractices: {},
    implementationHelp: {},
    moreinfo: {},
    footnotes: {}
};


text:
#include "FsmlElem.h"
#include "FsmlScript.h"

const char* const FsmlElemTemplate::s_symbol = "template";

void FsmlElemTemplate::setParent( FsmlElem* parent )
{
   m_parent = parent;
}

FsmlElem* FsmlElemTemplate::clone( ) const
{
   FsmlElemTemplate* e = new FsmlElemTemplate( );

   e->m_parent = m_parent;
   e->m_script = m_script;
   e->m_attrs  = m_attrs;

   ElemVector::const_iterator i = m_children.begin( );

   for (; i != m_children.end( ); ++i)
      e->m_children.push_back( (*i)->clone( ) );

   return e;
}

void FsmlElemTemplate::setAttr( const FsmlAttr& attr )
{
   /* Necessary for external creation. */
   m_attrs.setAttr( attr );
}

/* Necessary for external creation. */
bool FsmlElemTemplate::addChild(FsmlElem* child, FsmlElem* before /* = 0  */ )
{
   switch (child->getType( ))
   {
   default:
      return false;
   case FSMLELEM_BUTTON:
   case FSMLELEM_FRAME:
   case FSMLELEM_IMAGE:
   case FSMLELEM_TEMPLATE:  // Would it really hurt?
      break;
   }

   /* Ignore the before parameter. */
   m_children.push_back( child );
   return true;
}

bool FsmlElemTemplate::construct( const string& id )
{
   if (!(m_attrs.getAttrSz( "id", "" ) == id))
      return false;

   /* I'm up to bat. */
   if (m_parent)
   {
      ElemVector::const_iterator i = m_children.begin( );
      FsmlElemPtr cloned;  // To avoid memory leaks if the parent ignores it.
      for (; i != m_children.end( ); ++i)
      {
         cloned = (*i)->clone( );
         if (m_parent->addChild( cloned, this ))
         {
            if (m_script) m_script->pushConstructedElem( cloned );
         }
      }

      return true;
   }

   return false;
}

void FsmlElemTemplate::onSelectScript( FsmlScript* script )
{
   m_script = script;

   ElemVector::iterator i = m_children.begin( );
   for (; i != m_children.end( ); ++i)
      (*i)->onSelectScript( script );
}


text:
namespace ngraph
{
    namespace runtime
    {
        namespace cpu
        {
            void register_builders();
            void register_builders_add_cpp();
            void register_builders_allreduce_cpp();
            void register_builders_argmax_cpp();
            void register_builders_argmin_cpp();
            void register_builders_avg_pool_cpp();
            void register_builders_batch_norm_cpp();
            void register_builders_bounded_relu_cpp();
            void register_builders_broadcast_cpp();
            void register_builders_broadcast_distributed_cpp();
            void register_builders_concat_cpp();
            void register_builders_convert_cpp();
            void register_builders_convert_layout_cpp();
            void register_builders_convolution_cpp();
            void register_builders_cumsum_cpp();
            void register_builders_dot_cpp();
            void register_builders_dropout_cpp();
            void register_builders_embedding_lookup_cpp();
            void register_builders_erf_cpp();
            void register_builders_gather_cpp();
            void register_builders_gather_nd_cpp();
            void register_builders_gelu_cpp();
            void register_builders_leaky_relu_cpp();
            void register_builders_lrn_cpp();
            void register_builders_lstm_cpp();
            void register_builders_matmul_bias_cpp();
            void register_builders_max_cpp();
            void register_builders_max_pool_cpp();
            void register_builders_min_cpp();
            void register_builders_one_hot_cpp();
            void register_builders_pad_cpp();
            void register_builders_product_cpp();
            void register_builders_quantization_cpp();
            void register_builders_quantized_conv_cpp();
            void register_builders_quantized_dot_cpp();
            void register_builders_quantized_matmul_cpp();
            void register_builders_random_uniform_cpp();
            void register_builders_reduce_function_cpp();
            void register_builders_relu_cpp();
            void register_builders_replace_slice_cpp();
            void register_builders_reshape_cpp();
            void register_builders_reverse_cpp();
            void register_builders_reverse_sequence_cpp();
            void register_builders_rnn_cpp();
            void register_builders_scatter_add_cpp();
            void register_builders_scatter_nd_add_cpp();
            void register_builders_select_cpp();
            void register_builders_state_cpp();
            void register_builders_sigmoid_cpp();
            void register_builders_slice_cpp();
            void register_builders_softmax_cpp();
            void register_builders_sum_cpp();
            void register_builders_tile_cpp();
            void register_builders_topk_cpp();
            void register_builders_update_slice_cpp();
            void register_cpu_builders();
        }
    }
}


text:
/*

	Requires redis
	https://github.com/mranney/node_redis

	Either one will do:
		npm install redis
		npm install hiredis redis (C)

*/

var utils = require('../lib/utils').init(),
    redis = require("redis");

var RedisBackend = function (config, events, logger){
	var self = this;
	self.config = config;
	self.logger = logger;
	self.keyPrefix = config.config.prefix || "message";

	var host = config.config.host || "127.0.0.1";
	var port = config.config.port || 6379;
	var options = config.config.options || {};

	var client = redis.createClient(port, host, options);
	client.on("error", function (err) {
        logger.error("Redis Error ", err);
   });

	self.client = client;

	events.on('data', function(topic, data){
		self.save(topic, data);
	});

	logger.info("Redis backend created %j", config);
};

RedisBackend.prototype.save = function(topic, data) {
	if (!topic || !data) return;
	var self = this;
	var cleanTopic = utils.replaceAll("/", "-", topic);
	var key = self.keyPrefix + ":" + cleanTopic + ":" + (new Date).getTime();
	self.logger.debug("[%s] %s > %s", self.config.index, cleanTopic, data);
	self.client.set(key, data.toString(), redis.print);
};

exports.init = function(config, events, logger) {
  var backendInstance = new RedisBackend(config, events, logger);
  return true;
};


text:
You were logged in successfully.

Dashboard

Dashboard

Welcome to the Scaffle dashboard.


text:
import quoted.*

object Macros {
  inline def theTestBlock : Unit = ${ theTestBlockImpl }

  trait RefineMe {
    type T
    def foo : T
  }

  class TestAnnotation extends scala.annotation.Annotation

  def theTestBlockImpl(using qctx : Quotes) : Expr[Unit] = {
    import quotes.reflect.*

    val x1T = ConstantType(IntConstant(1))
    val x2T = OrType(ConstantType(IntConstant(1)), ConstantType(IntConstant(2)))
    val x3T = AndType(ConstantType(IntConstant(3)), TypeRepr.of[Any])
    val x4T =
      TypeLambda(
        List("A","B"),
        _ => List(TypeBounds(TypeRepr.of[Nothing], TypeRepr.of[Any]), TypeBounds(TypeRepr.of[Nothing], TypeRepr.of[Any])),
        (tl : TypeLambda) => tl.param(1))
    val x5T =
      Refinement(
        TypeRepr.of[RefineMe],
        "T",
        TypeBounds(TypeRepr.of[Int], TypeRepr.of[Int]))
    val x6T = TypeRepr.of[List].appliedTo(List(TypeRepr.of[Int]))
    val x7T = AnnotatedType(ConstantType(IntConstant(7)), '{ new TestAnnotation }.asTerm)
    val x8T =
      MatchType(
        TypeRepr.of[Int],
        TypeRepr.of[List[8]],
        List(
          TypeLambda(
            List("t"),
            _ => List(TypeBounds(TypeRepr.of[Nothing], TypeRepr.of[Any])),
            tl => MatchCase(TypeRepr.of[List].appliedTo(tl.param(0)), tl.param(0))),
          MatchCase(TypeRepr.of[Int], TypeRepr.of[Int])
        )
      )

    assert(x1T =:= TypeRepr.of[1])
    assert(x2T =:= TypeRepr.of(using Type.of[1|2]))
    assert(x3T =:= TypeRepr.of[3&Any])
    assert(x4T =:= TypeRepr.of[[A,B] =>> B])
    assert(x5T =:= TypeRepr.of[RefineMe { type T = Int }])
    assert(x6T =:= TypeRepr.of[List[Int]])
    assert(x7T =:= TypeRepr.of[7 @TestAnnotation])
    assert(x8T =:= TypeRepr.of[List[8] match {
      case List[t] => t
      case Int => Int
    }])

    '{
      println("Ok")
    }
  }
}


text:
package android.test.suitebuilder;

@com.francetelecom.rd.stubs.annotation.ClassDone(0)
public class TestGrouping
{
  // Fields

  public static final java.util.Comparator<java.lang.Class<? extends junit.framework.TestCase>> SORT_BY_SIMPLE_NAME = null;

  public static final java.util.Comparator<java.lang.Class<? extends junit.framework.TestCase>> SORT_BY_FULLY_QUALIFIED_NAME = null;

  protected java.lang.String firstIncludedPackage;

  // Constructors

  public TestGrouping(java.util.Comparator<java.lang.Class<? extends junit.framework.TestCase>> arg1){
  }
  // Methods

  public boolean equals(java.lang.Object arg1){
    return false;
  }
  public int hashCode(){
    return 0;
  }
  public void setClassLoader(java.lang.ClassLoader arg1){
  }
  public java.util.List<TestMethod> getTests(){
    return (java.util.List) null;
  }
  public TestGrouping addPackagesRecursive(java.lang.String [] arg1){
    return (TestGrouping) null;
  }
  public TestGrouping removePackagesRecursive(java.lang.String [] arg1){
    return (TestGrouping) null;
  }
  protected java.util.List<java.lang.reflect.Method> getTestMethods(java.lang.Class<? extends junit.framework.TestCase> arg1){
    return (java.util.List) null;
  }
  public java.lang.String getFirstIncludedPackage(){
    return (java.lang.String) null;
  }
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('news', '0002_events'),
    ]

    operations = [
        migrations.AddField(
            model_name='events',
            name='publish_date',
            field=models.DateTimeField(default='2017-08-10 00:04', verbose_name='publish date'),
            preserve_default=False,
        ),
    ]


text:
<?php
	include_once "includes/settings.php";
	include_once "includes/session.php";
	if(isset($_SESSION['username'])) {
		header("Location: http://" . $setting['domain']);
		exit;
	}
?>

	<link rel="icon" type="image/png" href="images/favicon.png"/>
	<title>3_126 :: register</title>
	<link rel='stylesheet' type='text/css' href='/booru/css/reset.css'/>
	<link rel='stylesheet' type='text/css' href='/booru/css/main.css'/>
	<meta charset="UTF-8">

		<?php include "includes/sections/header.php"; ?>
		<?php include "includes/sections/status_messages.php"; ?>

Search tags

					<form action="index.php">
						<input type="text" name="search">
					</form>

					<?php include "includes/sections/tags_trending.php"; ?>

				<?php include "includes/sections/status_messages.php"; ?>

					<form action="includes/register.php" method="post">

Username

<input type="text" name="username" style="width: 256px;" placeholder="Username" required>

Password

<input type="password" name="password" style="width: 256px;" placeholder="Password" required>

Re-type Password

<input type="password" name="verify" style="width: 256px;" placeholder="Password" required>

What is (3 x 4)2?

<input type="text" name="bot_check" style="width: 256px;" placeholder="3 digit number here" required>

						<input type="submit" value="Register" class="button"/>
					</form>

<?php

?>


text:
<?php

namespace umi\authentication\provider;

use umi\http\Request;

/**
 * Провайдер HTTP авторизации.
 */
class HttpProvider implements IAuthProvider
{
    /**
     * @var Request $request HTTP запрос
     */
    protected $request = null;

    /**
     * Конструктор.
     * @param Request $request HTTP запрос
     */
    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    /**
     * {@inheritdoc}
     */
    public function getCredentials()
    {
        $username = $this->request->getUser();
        $password = $this->request->getPassword();

        if ($username && $password) {
            return [$username, $password];
        } else {
            return false;
        }
    }
}


text:
using System.Collections.Generic;
using Snowflake.Scraper;
using Snowflake.Service;

namespace Snowflake.Events.CoreEvents.GameEvent
{
    public class GameResultsScrapedEventArgs : SnowflakeEventArgs
    {
        public IScraper GameScraper { get; private set; }
        public string GameFileName { get; private set;}
        public IList<IGameScrapeResult> ScrapedResults { get; private set; }
        public GameResultsScrapedEventArgs(ICoreService eventCoreInstance, string gameFileName, IList<IGameScrapeResult> scrapedResults, IScraper scraper) : base(eventCoreInstance)
        {
            this.GameFileName = gameFileName;
            this.ScrapedResults = scrapedResults;
            this.GameScraper = scraper;
        }

    }
}


text:
SELECT
  AccountingDocuments.Client_MANDT,
  AccountingDocuments.ExchangeRateType_KURST,
  AccountingDocuments.CompanyCode_BUKRS,
  CompaniesMD.CompanyText_BUTXT,
  AccountingDocuments.CustomerNumber_KUNNR,
  AccountingDocuments.FiscalYear_GJAHR,
  CustomersMD.NAME1_NAME1,
  CompaniesMD.Country_LAND1 AS Company_Country,
  CompaniesMD.CityName_ORT01 AS Company_City,
  CustomersMD.CountryKey_LAND1,
  CustomersMD.City_ORT01,
  AccountingDocuments.AccountingDocumentNumber_BELNR,
  AccountingDocuments.NumberOfLineItemWithinAccountingDocument_BUZEI,
  AccountingDocuments.CurrencyKey_WAERS,
  AccountingDocuments.LocalCurrency_HWAER,
  CompaniesMD.FiscalyearVariant_PERIV,
  IF(`{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Period_ecc`(AccountingDocuments.Client_MANDT,
      CompaniesMD.FiscalyearVariant_PERIV,
      AccountingDocuments.PostingDateInTheDocument_BUDAT) = 'CASE1',
    `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Case1`(AccountingDocuments.Client_MANDT,
      CompaniesMD.FiscalyearVariant_PERIV,
      AccountingDocuments.PostingDateInTheDocument_BUDAT),
    IF(`{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Period_ecc`(AccountingDocuments.Client_MANDT,
        CompaniesMD.FiscalyearVariant_PERIV,
        AccountingDocuments.PostingDateInTheDocument_BUDAT) = 'CASE2',
      `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Case2_ecc`(AccountingDocuments.Client_MANDT,
        CompaniesMD.FiscalyearVariant_PERIV,
        AccountingDocuments.PostingDateInTheDocument_BUDAT),
      IF(`{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Period_ecc`(AccountingDocuments.Client_MANDT,
          CompaniesMD.FiscalyearVariant_PERIV,
          AccountingDocuments.PostingDateInTheDocument_BUDAT) = 'CASE3',
        `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Case3_ecc`(AccountingDocuments.Client_MANDT,
          CompaniesMD.FiscalyearVariant_PERIV,
          AccountingDocuments.PostingDateInTheDocument_BUDAT),
        'DATA ISSUE'))) AS Period,
  IF(`{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Period_ecc`(AccountingDocuments.Client_MANDT,
      CompaniesMD.FiscalyearVariant_PERIV,
      CURRENT_DATE()) = 'CASE1',
    `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Case1`(AccountingDocuments.Client_MANDT,
      CompaniesMD.FiscalyearVariant_PERIV,
      CURRENT_DATE()),
    IF(`{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Period_ecc`(AccountingDocuments.Client_MANDT,
        CompaniesMD.FiscalyearVariant_PERIV,
        CURRENT_DATE()) = 'CASE2',
      `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Case2_ecc`(AccountingDocuments.Client_MANDT,
        CompaniesMD.FiscalyearVariant_PERIV,
        CURRENT_DATE()),
      IF(`{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Period_ecc`(AccountingDocuments.Client_MANDT,
          CompaniesMD.FiscalyearVariant_PERIV,
          CURRENT_DATE()) = 'CASE3',
        `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.Fiscal_Case3_ecc`(AccountingDocuments.Client_MANDT,
          CompaniesMD.FiscalyearVariant_PERIV,
          CURRENT_DATE()),
        'DATA ISSUE'))) AS Current_Period,
  AccountingDocuments.AccountType_KOART,
  AccountingDocuments.PostingDateInTheDocument_BUDAT,
  AccountingDocuments.DocumentDateInDocument_BLDAT,
  AccountingDocuments.InvoiceToWhichTheTransactionBelongs_REBZG,
  AccountingDocuments.BillingDocument_VBELN,
  AccountingDocuments.WrittenOffAmount_DMBTR,
  AccountingDocuments.BadDebt_DMBTR,
  AccountingDocuments.netDueDateCalc AS NetDueDate,
  AccountingDocuments.sk2dtCalc AS CashDiscountDate1,
  AccountingDocuments.sk1dtCalc AS CashDiscountDate2,
  AccountingDocuments.OpenAndNotDue,
  AccountingDocuments.ClearedAfterDueDate,
  AccountingDocuments.ClearedOnOrBeforeDueDate,
  AccountingDocuments.OpenAndOverDue,
  AccountingDocuments.DoubtfulReceivables,
  AccountingDocuments.DaysInArrear,
  AccountingDocuments.AccountsReceivable,
  AccountingDocuments.Sales
FROM
  `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.AccountingDocuments` AS AccountingDocuments
LEFT JOIN
  `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CustomersMD` AS CustomersMD
  ON
    AccountingDocuments.Client_MANDT = CustomersMD.Client_MANDT
    AND AccountingDocuments.CustomerNumber_KUNNR = CustomersMD.CustomerNumber_KUNNR
LEFT JOIN
  `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.CompaniesMD` AS CompaniesMD
  ON
    AccountingDocuments.Client_MANDT = CompaniesMD.Client_MANDT
    AND AccountingDocuments.CompanyCode_BUKRS = CompaniesMD.CompanyCode_BUKRS
WHERE AccountingDocuments.AccountType_KOART = "D"


text:
using System.ComponentModel.DataAnnotations;

namespace BDSA2017.Lecture05.Models
{
    public class CharacterCreateUpdateDTO
    {
        public int Id { get; set; }

        public int? ActorId { get; set; }

        [Required]
        [StringLength(50)]
        public string Name { get; set; }

        [Required]
        [StringLength(50)]
        public string Species { get; set; }

        [StringLength(50)]
        public string Planet { get; set; }
    }
}


text:
"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.styles = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var React = _interopRequireWildcard(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _clsx = _interopRequireDefault(require("clsx"));

var _utils = require("@material-ui/utils");

var _useControlled3 = _interopRequireDefault(require("../utils/useControlled"));

var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));

var _withStyles = _interopRequireDefault(require("../styles/withStyles"));

var _IconButton = _interopRequireDefault(require("../IconButton"));

var styles = {
  root: {
    padding: 9
  },
  checked: {},
  disabled: {},
  input: {
    cursor: 'inherit',
    position: 'absolute',
    opacity: 0,
    width: '100%',
    height: '100%',
    top: 0,
    left: 0,
    margin: 0,
    padding: 0,
    zIndex: 1
  }
};
/**
 * @ignore - internal component.
 */

exports.styles = styles;
var SwitchBase = React.forwardRef(function SwitchBase(props, ref) {
  var autoFocus = props.autoFocus,
      checkedProp = props.checked,
      checkedIcon = props.checkedIcon,
      classes = props.classes,
      className = props.className,
      defaultChecked = props.defaultChecked,
      disabledProp = props.disabled,
      icon = props.icon,
      id = props.id,
      inputProps = props.inputProps,
      inputRef = props.inputRef,
      name = props.name,
      onBlur = props.onBlur,
      onChange = props.onChange,
      onFocus = props.onFocus,
      readOnly = props.readOnly,
      required = props.required,
      tabIndex = props.tabIndex,
      type = props.type,
      value = props.value,
      other = (0, _objectWithoutProperties2.default)(props, ["autoFocus", "checked", "checkedIcon", "classes", "className", "defaultChecked", "disabled", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"]);

  var _useControlled = (0, _useControlled3.default)({
    controlled: checkedProp,
    default: Boolean(defaultChecked),
    name: 'SwitchBase',
    state: 'checked'
  }),
      _useControlled2 = (0, _slicedToArray2.default)(_useControlled, 2),
      checked = _useControlled2[0],
      setCheckedState = _useControlled2[1];

  var muiFormControl = (0, _useFormControl.default)();

  var handleFocus = function handleFocus(event) {
    if (onFocus) {
      onFocus(event);
    }

    if (muiFormControl && muiFormControl.onFocus) {
      muiFormControl.onFocus(event);
    }
  };

  var handleBlur = function handleBlur(event) {
    if (onBlur) {
      onBlur(event);
    }

    if (muiFormControl && muiFormControl.onBlur) {
      muiFormControl.onBlur(event);
    }
  };

  var handleInputChange = function handleInputChange(event) {
    var newChecked = event.target.checked;
    setCheckedState(newChecked);

    if (onChange) {
      // TODO v5: remove the second argument.
      onChange(event, newChecked);
    }
  };

  var disabled = disabledProp;

  if (muiFormControl) {
    if (typeof disabled === 'undefined') {
      disabled = muiFormControl.disabled;
    }
  }

  var hasLabelFor = type === 'checkbox' || type === 'radio';
  return /*#__PURE__*/React.createElement(_IconButton.default, (0, _extends2.default)({
    component: "span",
    className: (0, _clsx.default)(classes.root, className, checked && classes.checked, disabled && classes.disabled),
    disabled: disabled,
    tabIndex: null,
    role: undefined,
    onFocus: handleFocus,
    onBlur: handleBlur,
    ref: ref
  }, other), /*#__PURE__*/React.createElement("input", (0, _extends2.default)({
    autoFocus: autoFocus,
    checked: checkedProp,
    defaultChecked: defaultChecked,
    className: classes.input,
    disabled: disabled,
    id: hasLabelFor && id,
    name: name,
    onChange: handleInputChange,
    readOnly: readOnly,
    ref: inputRef,
    required: required,
    tabIndex: tabIndex,
    type: type,
    value: value
  }, inputProps)), checked ? checkedIcon : icon);
}); // NB: If changed, please update Checkbox, Switch and Radio
// so that the API documentation is updated.

process.env.NODE_ENV !== "production" ? SwitchBase.propTypes = {
  /**
   * If `true`, the `input` element will be focused during the first mount.
   */
  autoFocus: _propTypes.default.bool,

  /**
   * If `true`, the component is checked.
   */
  checked: _propTypes.default.bool,

  /**
   * The icon to display when the component is checked.
   */
  checkedIcon: _propTypes.default.node.isRequired,

  /**
   * Override or extend the styles applied to the component.
   * See [CSS API](#css) below for more details.
   */
  classes: _propTypes.default.object.isRequired,

  /**
   * @ignore
   */
  className: _propTypes.default.string,

  /**
   * @ignore
   */
  defaultChecked: _propTypes.default.bool,

  /**
   * If `true`, the switch will be disabled.
   */
  disabled: _propTypes.default.bool,

  /**
   * The icon to display when the component is unchecked.
   */
  icon: _propTypes.default.node.isRequired,

  /**
   * The id of the `input` element.
   */
  id: _propTypes.default.string,

  /**
   * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
   */
  inputProps: _propTypes.default.object,

  /**
   * Pass a ref to the `input` element.
   */
  inputRef: _utils.refType,

  /*
   * @ignore
   */
  name: _propTypes.default.string,

  /**
   * @ignore
   */
  onBlur: _propTypes.default.func,

  /**
   * Callback fired when the state is changed.
   *
   * @param {object} event The event source of the callback.
   * You can pull out the new checked state by accessing `event.target.checked` (boolean).
   */
  onChange: _propTypes.default.func,

  /**
   * @ignore
   */
  onFocus: _propTypes.default.func,

  /**
   * It prevents the user from changing the value of the field
   * (not from interacting with the field).
   */
  readOnly: _propTypes.default.bool,

  /**
   * If `true`, the `input` element will be required.
   */
  required: _propTypes.default.bool,

  /**
   * @ignore
   */
  tabIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),

  /**
   * The input component prop `type`.
   */
  type: _propTypes.default.string.isRequired,

  /**
   * The value of the component.
   */
  value: _propTypes.default.any
} : void 0;

var _default = (0, _withStyles.default)(styles, {
  name: 'PrivateSwitchBase'
})(SwitchBase);

exports.default = _default;


text:
$.fn.modalize = function() {
  var source = $('<div>').html(this.html()),
      form = source.find('form'),
      modalTemp = $('<div>'),
      modalHeader = $('<div>').addClass('modal-header').appendTo(modalTemp),
      modalBody = $('<div>').addClass('modal-body').appendTo(modalTemp),
      modalFooter = $('<div>').addClass('modal-footer').appendTo(modalTemp);

  source.find('form > *').unwrap();
  source.find('h2:first').appendTo(modalHeader);
  source.find('.actions:first').appendTo(modalFooter);
  modalBody.append(source.html());

  if(form.length) {
    return form.html(modalTemp.html());
  } else {
    return modalTemp.html();
  }
}


text:
require File.expand_path('../../../../spec_helper', __FILE__)
require 'net/ftp'

describe "Net::FTP#closed?" do
  before :each do
    @socket = mock("Socket")

    @ftp = Net::FTP.new
    @ftp.instance_variable_set(:@sock, @socket)
  end

  it "returns true when the socket is closed" do
    @socket.should_receive(:closed?).and_return(true)
    @ftp.closed?.should be_true
  end

  it "returns true when the socket is nil" do
    @ftp.instance_variable_set(:@sock, nil)
    @ftp.closed?.should be_true
  end
end


text:
namespace isl {

inline isl_union_pw_qpolynomial_fold *UnionPwQpolynomialFold::GetCopy() const {
  return isl_union_pw_qpolynomial_fold_copy((isl_union_pw_qpolynomial_fold *)This);
}
inline UnionPwQpolynomialFold &UnionPwQpolynomialFold::operator=(const UnionPwQpolynomialFold &Other) {
  isl_union_pw_qpolynomial_fold *New = Other.GetCopy();
  ctx = Other.Context();
  isl_union_pw_qpolynomial_fold_free((isl_union_pw_qpolynomial_fold *)This);
  This = New;
  return *this;
}
inline UnionPwQpolynomialFold UnionPwQpolynomialFold::fromPwQpolynomialFold(const PwQpolynomialFold &pwf) {
  const Ctx &_ctx = pwf.Context();
  _ctx.lock();
  isl_union_pw_qpolynomial_fold *That = isl_union_pw_qpolynomial_fold_from_pw_qpolynomial_fold((pwf).GetCopy());

  _ctx.unlock();
  if (_ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_from_pw_qpolynomial_fold returned a NULL pointer.");
  }

  return UnionPwQpolynomialFold(_ctx, That);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::zero(const Space &dim, Fold type) {
  const Ctx &_ctx = dim.Context();
  _ctx.lock();
  isl_union_pw_qpolynomial_fold *That = isl_union_pw_qpolynomial_fold_zero((dim).GetCopy(), (enum isl_fold)type);

  _ctx.unlock();
  if (_ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_zero returned a NULL pointer.");
  }

  return UnionPwQpolynomialFold(_ctx, That);
}
inline UnionPwQpolynomialFold::~UnionPwQpolynomialFold() {
  isl_union_pw_qpolynomial_fold_free((isl_union_pw_qpolynomial_fold *)This);
  This = nullptr;
}
/// rief Release ownership of the wrapped object.
///
/// You are on your own now buddy.
/// The wrapper cannot be used anymore after calling Give()
///
///@return the wrapped isl object.
inline isl_union_pw_qpolynomial_fold *UnionPwQpolynomialFold::Give() {
  isl_union_pw_qpolynomial_fold *res = (isl_union_pw_qpolynomial_fold *)This;
  This = nullptr;
  return res;
}
/// \brief Unwrap the stored isl object.
/// \returns A the wrapped isl object.
inline isl_union_pw_qpolynomial_fold *UnionPwQpolynomialFold::Get() const {  return (isl_union_pw_qpolynomial_fold *)This;
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::addUnionPwQpolynomial(const UnionPwQpolynomial &upwqp) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_add_union_pw_qpolynomial((*this).GetCopy(), (upwqp).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_add_union_pw_qpolynomial returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::alignParams(const Space &model) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_align_params((*this).GetCopy(), (model).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_align_params returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::coalesce() const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_coalesce((*this).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_coalesce returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline UnionSet UnionPwQpolynomialFold::domain() const {
  ctx.lock();
  isl_union_set * res =  isl_union_pw_qpolynomial_fold_domain((*this).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_domain returned a NULL pointer.");
  }
  return UnionSet(ctx, res);
}

inline Val UnionPwQpolynomialFold::eval(const Point &pnt) const {
  ctx.lock();
  isl_val * res =  isl_union_pw_qpolynomial_fold_eval((*this).GetCopy(), (pnt).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_eval returned a NULL pointer.");
  }
  return Val(ctx, res);
}

inline PwQpolynomialFold UnionPwQpolynomialFold::extractPwQpolynomialFold(const Space &dim) const {
  ctx.lock();
  isl_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_extract_pw_qpolynomial_fold((*this).Get(), (dim).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_extract_pw_qpolynomial_fold returned a NULL pointer.");
  }
  return PwQpolynomialFold(ctx, res);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::fold(const UnionPwQpolynomialFold &upwf2) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_fold((*this).GetCopy(), (upwf2).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_fold returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::foldPwQpolynomialFold(const PwQpolynomialFold &pwqp) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold((*this).GetCopy(), (pwqp).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline Stat UnionPwQpolynomialFold::foreachPwQpolynomialFold(const std::function<isl_stat(isl_pw_qpolynomial_fold *, void *)> && fn, void * user) const {
  ctx.lock();
  isl_stat res =  isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold((*this).Get(), get_fn_ptr<22>(fn), user);
  ctx.unlock();
  return (Stat)res;
}

inline Space UnionPwQpolynomialFold::getSpace() const {
  ctx.lock();
  isl_space * res =  isl_union_pw_qpolynomial_fold_get_space((*this).Get());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_get_space returned a NULL pointer.");
  }
  return Space(ctx, res);
}

inline Fold UnionPwQpolynomialFold::getType() const {
  ctx.lock();
  enum isl_fold res =  isl_union_pw_qpolynomial_fold_get_type((*this).Get());
  ctx.unlock();
  return (Fold)res;
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::gist(const UnionSet &context) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_gist((*this).GetCopy(), (context).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_gist returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::gistParams(const Set &context) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_gist_params((*this).GetCopy(), (context).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_gist_params returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::intersectDomain(const UnionSet &uset) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_intersect_domain((*this).GetCopy(), (uset).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_intersect_domain returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::intersectParams(const Set &set) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_intersect_params((*this).GetCopy(), (set).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_intersect_params returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

inline Bool UnionPwQpolynomialFold::plainIsEqual(const UnionPwQpolynomialFold &upwf2) const {
  ctx.lock();
  isl_bool res =  isl_union_pw_qpolynomial_fold_plain_is_equal((*this).Get(), (upwf2).Get());
  ctx.unlock();
  return (Bool)res;
}

inline UnionPwQpolynomialFold UnionPwQpolynomialFold::scaleVal(const Val &v) const {
  ctx.lock();
  isl_union_pw_qpolynomial_fold * res =  isl_union_pw_qpolynomial_fold_scale_val((*this).GetCopy(), (v).GetCopy());
  ctx.unlock();
  if (ctx.hasError()) {
    handleError("isl_union_pw_qpolynomial_fold_scale_val returned a NULL pointer.");
  }
  return UnionPwQpolynomialFold(ctx, res);
}

} // namespace isl
#endif //ISL_CXX_UnionPwQpolynomialFold_IMPL_H


text:
@interface HostViewController () <ViewPagerDataSource, ViewPagerDelegate>

@end

@implementation HostViewController

- (void)viewDidLoad {

    self.dataSource = self;
    self.delegate = self;

    self.title = @"View Pager";

    // Keeps tab bar below navigation bar on iOS 7.0+
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }

    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - ViewPagerDataSource
- (NSUInteger)numberOfTabsForViewPager:(ViewPagerController *)viewPager {
    return 10;
}
- (UIView *)viewPager:(ViewPagerController *)viewPager viewForTabAtIndex:(NSUInteger)index {

    UILabel *label = [UILabel new];
    label.backgroundColor = [UIColor clearColor];
    label.font = [UIFont systemFontOfSize:13.0];
    label.text = [NSString stringWithFormat:@"Content View #%i", index];
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor blackColor];
    [label sizeToFit];

    return label;
}

- (UIViewController *)viewPager:(ViewPagerController *)viewPager contentViewControllerForTabAtIndex:(NSUInteger)index {

    ContentViewController *cvc = [self.storyboard instantiateViewControllerWithIdentifier:@"contentViewController"];

    cvc.labelString = [NSString stringWithFormat:@"Content View #%i", index];

    return cvc;
}

#pragma mark - ViewPagerDelegate
- (CGFloat)viewPager:(ViewPagerController *)viewPager valueForOption:(ViewPagerOption)option withDefault:(CGFloat)value {

    switch (option) {
        case ViewPagerOptionStartFromSecondTab:
            return 1.0;
            break;
        case ViewPagerOptionCenterCurrentTab:
            return 0.0;
            break;
        case ViewPagerOptionTabLocation:
            return 1.0;
            break;
        default:
            break;
    }

    return value;
}
- (UIColor *)viewPager:(ViewPagerController *)viewPager colorForComponent:(ViewPagerComponent)component withDefault:(UIColor *)color {

    switch (component) {
        case ViewPagerIndicator:
            return [[UIColor redColor] colorWithAlphaComponent:0.64];
            break;
        default:
            break;
    }

    return color;
}

@end


text:
__version__ = '0.2.0'

__author__ = 'Matt Menzenski'
__author_email__ = 'matt.menzenski@gmail.com'
__maintainer__ = __author__
__maintainer_email__ = __author_email__
__url__ = 'https://github.com/menzenski/trunc'
__license__ = 'MIT'
__description__ = 'A Tool for the Russian National Corpus'


text:
@interface FNNewsReplyItem : NSObject

// 昵称
@property (nonatomic, strong) NSString *n;
// 评论时间
@property (nonatomic, strong) NSString *t;
// 评论内容
@property (nonatomic, strong) NSString *b;
// 头像
@property (nonatomic, strong) NSString *timg;
// 点赞
@property (nonatomic, strong) NSString *v;
// 来源
@property (nonatomic, strong) NSString *f;

@end


text:
Contributions
=============

Attributions to whom deserves:

caioariede_ (Caio Ariede):
  * Improvements and Orkut support

krvss_ (Stas Kravets):
  * Initial setup.py configuration
  * LiveJournal support
  * Mail.ru, Odnoklassniki support
  * Yandex OpenID support
  * VKontakte OpenAPI support

jezdez_ (Jannis Leidel):
  * Improvements and documentation update

alfredo_ (Alfredo Ramirez)
  * Facebook and Doc improvements

mattucf_ (Matt Brown)
  * Twitter and OAuth improvements

Quard_ (Vadym Zakovinko)
  * LinkedIn support

micrypt_ (Seyi Ogunyemi)
  * python-oauth2_ migration

djm_ (Darian Moody)
  * Improvements

bernardokyotoku_ (Bernardo Kyotoku)
  * Improvements

maraujop_ (Miguel Araujo)
  * Improvements

bedspax_
  * Foursquare support

revolunet_ (Julien Bouquillon)
  * GitHub support

danielgtaylor_ (Daniel G. Taylor)
  * Dropbox support
  * Flickr support
  * Provider name context processor

r4vi_ (Ravi Kotecha)
  * Instagram support

andrusha_ (Andrew Korzhuev)
  * MSN Live Connect support
  * Yahoo OAuth 1.0 support

niQo_ (Nicolas Quiénot)
  * Skyrock.com support

hassek_ (Tomas Henriquez)
  * Evernote support

fmoga_ (Florian Moga)
  * Mixcloud support

estebistec_ (Steven Cummings)
  * Overrideable models feature

hepochen_
  * Weibo support

.. _caioariede: https://github.com/caioariede
.. _krvss: https://github.com/krvss
.. _jezdez: https://github.com/jezdez
.. _alfredo: https://github.com/alfredo
.. _mattucf: https://github.com/mattucf
.. _Quard: https://github.com/Quard
.. _micrypt: https://github.com/micrypt
.. _djm: https://github.com/djm
.. _bernardokyotoku: https://github.com/bernardokyotoku
.. _andrusha: https://github.com/andrusha
.. _maraujop: https://github.com/maraujop
.. _bedspax: https://github.com/bedspax
.. _python-oauth2: https://github.com/simplegeo/python-oauth2
.. _niQo: https://github.com/niQo
.. _hassek: https://github.com/hassek
.. _fmoga: https://github.com/fmoga
.. _revolunet: https://github.com/revolunet
.. _r4vi: https://github.com/r4vi
.. _danielgtaylor: https://github.com/danielgtaylor
.. _estebistec: https://github.com/estebistec
.. _hepochen: https://github.com/hepochen


text:
import queues from './queues';
import tags from './tags';
import dapps from './dapps';

export default function () {
  queues();
  tags();
  dapps();
}


text:
package com.tesshu.subsonic.client.fx.command.logic;

import com.tesshu.subsonic.client.fx.command.param.VoidParam;
import com.tesshu.subsonic.client.fx.view.main.MainContainer;

import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Scope("prototype")
@Component
@Lazy
public final class ReductionLogicImpl extends AbstractLogic<VoidParam> implements ShrinkLogic {

  @Override
  public void invoke(MainContainer mainContainer) {
    mainContainer.shrinkProperty().set(!mainContainer.shrinkProperty().get());
  }

}


text:
package java.io;

/**
 * FileDescriptor is the lowest level representation of a File, Device, or
 * Socket. You can create any of the IO classes which take a FileDescriptor as
 * an argument by querying an open Socket or File for the FileDescriptor.
 *

 * The FileDescriptor class also contains static fields representing Standard
 * Input, Output and Error. You can use these directly if desired but it is
 * recommended you go through System.in, System.out, and System.err streams
 * respectively.
 *

 * Applications should not create new FileDescriptors.
 *
 * @see FileInputStream#getFD()
 * @see FileOutputStream#getFD()
 * @see RandomAccessFile#getFD()
 */
public final class FileDescriptor {

    /** FileDescriptor representing Standard In */
    public static final FileDescriptor in = new FileDescriptor();

    /** FileDescriptor representing Standard Out */
    public static final FileDescriptor out = new FileDescriptor();

    /** FileDescriptor representing Standard Error */
    public static final FileDescriptor err = new FileDescriptor();

    /**
     * Represents a link to any underlying OS resources for this FileDescriptor.
     * A value of -1 indicates that this FileDescriptor is invalid.
     */
    long descriptor = -1;

    boolean readOnly = false;

    private static native void oneTimeInitialization();

    static {
        in.descriptor = 0;
        out.descriptor = 1;
        err.descriptor = 2;

        oneTimeInitialization();
    }

    /**
     * Constructs a new FileDescriptor containing an invalid handle. This
     * constructor does nothing interesting. Provided for signature
     * compatibility.
     */
    public FileDescriptor() {
        super();
    }

    /**
     * Ensures that data which is buffered within the underlying implementation
     * is written out to the appropriate device before returning.
     *
     * @throws SyncFailedException
     *             when the operation fails
     */
    public void sync() throws SyncFailedException {
        // if the descriptor is a read-only one, do nothing
        if (!readOnly) {
            syncImpl();
        }
    }

    private native void syncImpl() throws SyncFailedException;

    /**
     * Answers a boolean indicating whether or not this FileDescriptor is valid.
     *
     * @return true if this FileDescriptor is valid,
     *         false otherwise
     */
    public native boolean valid();
}


text:
#include "testing/testing.hpp"

#include "routing/cross_routing_context.hpp"
#include "routing/osrm2feature_map.hpp"
#include "routing/routing_mapping.hpp"

#include "platform/local_country_file.hpp"
#include "platform/local_country_file_utils.hpp"
#include "platform/platform.hpp"

#include "geometry/point2d.hpp"

#include "base/buffer_vector.hpp"
#include "base/logging.hpp"

#include "std/limits.hpp"

using namespace routing;

namespace
{
UNIT_TEST(CheckCrossSections)
{
  static double constexpr kPointEquality = 0.01;
  vector<platform::LocalCountryFile> localFiles;
  platform::FindAllLocalMapsAndCleanup(numeric_limits<int64_t>::max() /* latestVersion */,
                                       localFiles);

  size_t ingoingErrors = 0;
  size_t outgoingErrors = 0;
  size_t noRouting = 0;
  for (auto & file : localFiles)
  {
    LOG(LINFO, ("Checking cross table for country:", file.GetCountryName()));
    CrossRoutingContextReader crossReader;

    file.SyncWithDisk();
    if (file.GetFiles() != MapOptions::MapWithCarRouting)
    {
      noRouting++;
      LOG(LINFO, ("Warning! Routing file not found for:", file.GetCountryName()));
      continue;
    }
    FilesMappingContainer container(file.GetPath(MapOptions::CarRouting));
    if (!container.IsExist(ROUTING_CROSS_CONTEXT_TAG))
    {
      noRouting++;
      LOG(LINFO, ("Warning! Mwm file has not cross mwm section:", file.GetCountryName()));
      continue;
    }
    crossReader.Load(container.GetReader(ROUTING_CROSS_CONTEXT_TAG));

    bool error = false;
    crossReader.ForEachIngoingNode([&error](IngoingCrossNode const & node)
                                   {
                                     if (node.m_point.EqualDxDy(ms::LatLon::Zero(), kPointEquality))
                                       error = true;
                                   });
    if (error)
      ingoingErrors++;

    error = false;
    crossReader.ForEachOutgoingNode([&error](OutgoingCrossNode const & node)
                                    {
                                      if (node.m_point.EqualDxDy(ms::LatLon::Zero(), kPointEquality))
                                        error = true;
                                    });
    if (error)
      outgoingErrors++;
  }
  TEST_EQUAL(ingoingErrors, 0, ("Some countries have zero point incomes."));
  TEST_EQUAL(outgoingErrors, 0, ("Some countries have zero point exits."));
  LOG(LINFO, ("Found", localFiles.size(), "countries.",
              noRouting, "countries are without routing file."));
}

UNIT_TEST(CheckOsrmToFeatureMapping)
{
  vector<platform::LocalCountryFile> localFiles;
  platform::FindAllLocalMapsAndCleanup(numeric_limits<int64_t>::max() /* latestVersion */,
                                       localFiles);

  size_t errors = 0;
  size_t checked = 0;
  for (auto & file : localFiles)
  {
    LOG(LINFO, ("Checking nodes for country:", file.GetCountryName()));

    file.SyncWithDisk();
    if (file.GetFiles() != MapOptions::MapWithCarRouting)
    {
      LOG(LINFO, ("Warning! Routing file not found for:", file.GetCountryName()));
      continue;
    }

    FilesMappingContainer container(file.GetPath(MapOptions::CarRouting));
    if (!container.IsExist(ROUTING_FTSEG_FILE_TAG))
    {
      LOG(LINFO, ("Warning! Mwm file has not routing ftseg section:", file.GetCountryName()));
      continue;
    }
    ++checked;

    routing::TDataFacade dataFacade;
    dataFacade.Load(container);

    OsrmFtSegMapping segMapping;
    segMapping.Load(container, file);
    segMapping.Map(container);

    for (size_t i = 0; i < dataFacade.GetNumberOfNodes(); ++i)
    {
      buffer_vector<OsrmMappingTypes::FtSeg, 8> buffer;
      segMapping.ForEachFtSeg(i, MakeBackInsertFunctor(buffer));
      if (buffer.empty())
      {
        LOG(LINFO, ("Error found in ", file.GetCountryName()));
        errors++;
        break;
      }
    }
  }
  LOG(LINFO, ("Found", localFiles.size(), "countries. In", checked, "maps with routing have", errors, "with errors."));
  TEST_EQUAL(errors, 0, ("Some countries have osrm and features mismatch."));
}
}  // namespace


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="horizontal"
    android:gravity="center_vertical"
    android:background="@color/order_item_background" >

    <ImageView
        android:id="@+id/image"
        android:layout_width="60dp"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:maxHeight="60dp"
        android:maxWidth="60dp"
        android:paddingLeft="10dp"
        android:paddingTop="2dp"
        android:paddingBottom="2dp"
        android:contentDescription="@string/product_image" />

    <TextView
        android:id="@+id/product_name"
        android:layout_width="240dp"
        android:layout_height="wrap_content"
        android:paddingLeft="10dp"
        android:textSize="16sp" />

    <EditText
        android:id="@+id/stock"
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textSize="16sp"
        android:imeOptions="actionGo"
        android:inputType="number" />

    <Button
        android:id="@+id/btn_update_stock"
        android:layout_width="80dp"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="@string/update"
        android:textSize="14sp" />

</LinearLayout>


text:
package org.apache.drill.exec.server.options;

import org.apache.drill.common.exceptions.ExpressionParsingException;

/**
 * Validates the values provided to Drill options.
 */
public abstract class OptionValidator {
  // Stored here as well as in the option static class to allow insertion of option optionName into
  // the error messages produced by the validator
  private final String optionName;

  public OptionValidator(String optionName) {
    this.optionName = optionName;
  }

  /**
   * Gets the name of the option for this validator.
   *
   * @return the option name
   */
  public String getOptionName() {
    return optionName;
  }

  /**
   * This function returns true if and only if this validator is meant for a short-lived option.
   *
   * NOTE: By default, options are not short-lived. So, if a derived class is meant for a short-lived option,
   * that class must do two things:
   * (1) override this method to return true, and
   * (2) return the number of queries for which the option is valid through {@link #getTtl}.
   * E.g. {@link org.apache.drill.exec.testing.ExecutionControls.ControlsOptionValidator}
   *
   * @return if this validator is for a short-lived option
   */
  public boolean isShortLived() {
    return false;
  }

  /**
   * If an option is short-lived, this method returns the number of queries for which the option is valid.
   * Please read the note at {@link #isShortLived}
   *
   * @return number of queries for which the option should be valid
   */
  public int getTtl() {
    if (!isShortLived()) {
      throw new UnsupportedOperationException("This option is not short-lived.");
    }
    return 0;
  }

  /**
   * Gets the default option value for this validator.
   *
   * @return default option value
   */
  public abstract OptionValue getDefault();

  /**
   * Validates the option value.
   *
   * @param value the value to validate
   * @throws ExpressionParsingException message to describe error with value
   */
  public abstract void validate(OptionValue value);
}


text:
using System;
using System.Linq.Expressions;
using FclEx.Testers;
using Xunit;

namespace FclEx.Helpers
{
    public class ErasureTypeTests
    {
        [Fact]
        public void ErasureType_Int_Test()
        {
            var obj = new Person() { Age = 10 };
            Expression<Func<Person, int>> exp = m => m.Age;
            var unTypedExp = ExpressionHelper.ErasureType(exp);
            var actual = unTypedExp.Compile()(obj);
            Assert.IsType<int>(actual);
            Assert.Equal(obj.Age, actual);
        }

        [Fact]
        public void ErasureType_String_Test()
        {
            var obj = new Person() { Name = nameof(ErasureType_String_Test) };
            Expression<Func<Person, string>> exp = m => m.Name;
            var unTypedExp = ExpressionHelper.ErasureType(exp);
            var actual = unTypedExp.Compile()(obj);
            Assert.IsType<string>(actual);
            Assert.Equal(obj.Name, (string)actual);
        }

        [Fact]
        public void ErasureType_Object_Test()
        {
            var o = new object();
            var obj = new Person() { Obj = o };
            Expression<Func<Person, object>> exp = m => m.Obj;
            var unTypedExp = ExpressionHelper.ErasureType(exp);
            var actual = unTypedExp.Compile()(obj);
            Assert.IsType<object>(actual);
            Assert.Equal(o, actual);
            Assert.Same(o, actual);
        }

        [Fact]
        public void ErasureType_Object_Int_Test()
        {
            object o = 10;
            var obj = new Person() { Obj = o };
            Expression<Func<Person, object>> exp = m => m.Obj;
            var unTypedExp = ExpressionHelper.ErasureType(exp);
            var actual = unTypedExp.Compile()(obj);
            Assert.IsType<int>(actual);
            Assert.Equal((int)o, (int)actual);
        }
    }
}


text:
namespace display {
class Display;

// Observers for display configuration changes.
// TODO(oshima): consolidate |WorkAreaWatcherObserver| and
// |DisplaySettingsProvier|. crbug.com/122863.
class DISPLAY_EXPORT DisplayObserver {
 public:
  enum DisplayMetric {
    DISPLAY_METRIC_NONE = 0,
    DISPLAY_METRIC_BOUNDS = 1 << 0,
    DISPLAY_METRIC_WORK_AREA = 1 << 1,
    DISPLAY_METRIC_DEVICE_SCALE_FACTOR = 1 << 2,
    DISPLAY_METRIC_ROTATION = 1 << 3,
    DISPLAY_METRIC_PRIMARY = 1 << 4,
  };

  // Called when |new_display| has been added.
  virtual void OnDisplayAdded(const Display& new_display) = 0;

  // Called when |old_display| has been removed.
  virtual void OnDisplayRemoved(const Display& old_display) = 0;

  // Called when a |display| has one or more metrics changed. |changed_metrics|
  // will contain the information about the change, see |DisplayMetric|.
  virtual void OnDisplayMetricsChanged(const Display& display,
                                       uint32_t changed_metrics) = 0;

 protected:
  virtual ~DisplayObserver();
};

}  // namespace display

#endif  // UI_DISPLAY_DISPLAY_OBSERVER_H_


text:
import test from 'tape'
import BaseShape from '../lib/baseShape.js'
import { ShapeEventEmitter } from '..'
import { Rectangle } from '..'

let noop = function() {}

global.HTMLCanvasElement = function HTMLCanvasElement() {}
global.window = {}
global.window.document = {}
global.window.document.addEventListener = noop

test('BaseShape#clear', t => {
  t.plan(2)
  let mockCtx = { save: noop
                , beginPath: noop
                , fill: noop
                , restore: noop
                }
    , bs = new BaseShape()

  bs.path = function() {
    t.pass('path function was called')
  }

  bs.clear(mockCtx)

  t.equals(mockCtx.globalCompositeOperation, 'destination-out')
})

test('BaseShape#clip', t => {
  t.plan(1)
  let mockCtx = { save: noop
                , beginPath: noop
                , clip: noop
                }
    , bs = new BaseShape()
  bs.path = () => {
    t.pass('path function was called')
  }

  bs.clip(mockCtx)
})

test('BaseShape#fill', t => {
  t.plan(1)
  let mockCtx = { beginPath: noop
                , fill: noop
                }
    , bs = new BaseShape()

  bs.path = () => t.pass('path function was called')

  bs.fill(mockCtx)
})

test('BaseShape#stroke', t => {
  t.plan(1)
  let mockCtx = { beginPath: noop
                , stroke: noop
                }
    , bs = new BaseShape()

  bs.path = () => t.pass('path function was called')

  bs.stroke(mockCtx)
})

test('BaseShape#createShapeEventEmitter', t => {
  t.plan(2)
  let canvas = new HTMLCanvasElement()
    , rect = new Rectangle([10, 10], 50, 50)

  t.equals(rect.createShapeEventEmitter(canvas)._cee, new ShapeEventEmitter(rect, canvas)._cee)
  t.equals(new ShapeEventEmitter(rect, canvas)._cee, new ShapeEventEmitter(rect, canvas)._cee)

})


text:
package com.cloud.api.command.user.volume;

import com.cloud.acl.SecurityChecker.AccessType;
import com.cloud.api.ACL;
import com.cloud.api.APICommand;
import com.cloud.api.APICommandGroup;
import com.cloud.api.ApiCommandJobType;
import com.cloud.api.ApiConstants;
import com.cloud.api.ApiErrorCode;
import com.cloud.api.BaseAsyncCmd;
import com.cloud.api.Parameter;
import com.cloud.api.ResponseObject.ResponseView;
import com.cloud.api.ServerApiException;
import com.cloud.api.response.DiskOfferingResponse;
import com.cloud.api.response.VolumeResponse;
import com.cloud.context.CallContext;
import com.cloud.event.EventTypes;
import com.cloud.legacymodel.exceptions.InvalidParameterValueException;
import com.cloud.legacymodel.exceptions.PermissionDeniedException;
import com.cloud.legacymodel.exceptions.ResourceAllocationException;
import com.cloud.legacymodel.storage.Volume;
import com.cloud.legacymodel.user.Account;
import com.cloud.projects.Project;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@APICommand(name = "resizeVolume", group = APICommandGroup.VolumeService, description = "Resizes a volume", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType
        = {Volume.class},
        requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class ResizeVolumeCmd extends BaseAsyncCmd {
    public static final Logger s_logger = LoggerFactory.getLogger(ResizeVolumeCmd.class.getName());

    private static final String s_name = "resizevolumeresponse";

    /////////////////////////////////////////////////////
    //////////////// API parameters /////////////////////
    /////////////////////////////////////////////////////

    @ACL(accessType = AccessType.OperateEntry)
    @Parameter(name = ApiConstants.ID, entityType = VolumeResponse.class, required = true, type = CommandType.UUID, description = "the ID of the disk volume")
    private Long id;

    @Parameter(name = ApiConstants.MIN_IOPS, type = CommandType.LONG, required = false, description = "New minimum number of IOPS")
    private Long minIops;

    @Parameter(name = ApiConstants.MAX_IOPS, type = CommandType.LONG, required = false, description = "New maximum number of IOPS")
    private Long maxIops;

    @Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, required = false, description = "New volume size in GB")
    private Long size;

    @Parameter(name = ApiConstants.SHRINK_OK, type = CommandType.BOOLEAN, required = false, description = "Verify OK to Shrink")
    private boolean shrinkOk;

    @Parameter(name = ApiConstants.DISK_OFFERING_ID,
            entityType = DiskOfferingResponse.class,
            type = CommandType.UUID,
            required = false,
            description = "new disk offering id")
    private Long newDiskOfferingId;

    /////////////////////////////////////////////////////
    /////////////////// Accessors ///////////////////////
    /////////////////////////////////////////////////////

    public static String getResultObjectName() {
        return "volume";
    }

    public Long getId() {
        return getEntityId();
    }

    //TODO use the method getId() instead of this one.
    public Long getEntityId() {
        return id;
    }

    public Long getMinIops() {
        return minIops;
    }

    public Long getMaxIops() {
        return maxIops;
    }

    public boolean getShrinkOk() {
        return shrinkOk;
    }

    public Long getNewDiskOfferingId() {
        return newDiskOfferingId;
    }

    /////////////////////////////////////////////////////
    /////////////// API Implementation///////////////////
    /////////////////////////////////////////////////////

    @Override
    public String getEventType() {
        return EventTypes.EVENT_VOLUME_RESIZE;
    }

    @Override
    public String getEventDescription() {
        return "Volume Id: " + getEntityId() + " to size " + getSize() + "G";
    }

    public Long getSize() {
        return size;
    }

    @Override
    public ApiCommandJobType getInstanceType() {
        return ApiCommandJobType.Volume;
    }

    @Override
    public void execute() throws ResourceAllocationException {
        Volume volume = null;
        try {
            CallContext.current().setEventDetails("Volume Id: " + getEntityId() + " to size " + getSize() + "G");
            volume = _volumeService.resizeVolume(this);
        } catch (final InvalidParameterValueException ex) {
            s_logger.info(ex.getMessage());
            throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, ex.getMessage());
        }

        if (volume != null) {
            final VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, volume);
            //FIXME - have to be moved to ApiResponseHelper
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to resize volume");
        }
    }

    @Override
    public String getCommandName() {
        return s_name;
    }

    @Override
    public long getEntityOwnerId() {

        final Volume volume = _entityMgr.findById(Volume.class, getEntityId());
        if (volume == null) {
            throw new InvalidParameterValueException("Unable to find volume by id=" + id);
        }

        final Account account = _accountService.getAccount(volume.getAccountId());
        //Can resize volumes for enabled projects/accounts only
        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
            final Project project = _projectService.findByProjectAccountId(volume.getAccountId());
            if (project.getState() != Project.State.Active) {
                throw new PermissionDeniedException("Can't add resources to  project id=" + project.getId() + " in state=" + project.getState() +
                        " as it's no longer active");
            }
        } else if (account.getState() == Account.State.disabled) {
            throw new PermissionDeniedException("The owner of volume " + id + "  is disabled: " + account);
        }

        return volume.getAccountId();
    }
}


text:
#include "memory_tracker.h"
#include "mmap_trie_node.h"
#include "sync_stream.h"

#include "jml/arch/backtrace.h"
#include "jml/utils/abort.h"

#include <mutex>
#include <sstream>

using namespace Datacratic;
using namespace MMap;
using namespace ML;
using namespace std;

MemoryTracker::MemoryTracker(bool backtrace) :
    backtrace(backtrace)
{}

void MemoryTracker::trackAlloc(uint64_t offset, TriePtr node) {
    string bt = getBacktrace();

    {
        lock_guard<mutex> guard(blocksLock);

        Block& entry = blocks[offset];

        if (entry.allocCounter != entry.deallocCounter) {
            entry.dump();
            do_abort();
            throw ML::Exception(
                    "Attempting to double allocate a block: %lld", offset);
        }

        if (entry.readCounter != 0) {
            entry.dump();
            do_abort();
            throw ML::Exception(
                    "Attempting to alloc a block in use: %lld", offset);
        }

        entry.allocCounter++;
        entry.offset = offset;
        entry.node = node;
        entry.lastBacktrace = bt;
    }
}

void MemoryTracker::trackAlloc(uint64_t offset) {
    string bt = getBacktrace();

    lock_guard<mutex> guard(blocksLock);

    Block& entry = blocks[offset];

    if (entry.allocCounter != entry.deallocCounter) {
        entry.dump();
        do_abort();
        throw ML::Exception(
                "Attempting to double allocate a block: %lld", offset);
    }

    if (entry.readCounter != 0) {
        entry.dump();
        do_abort();
        throw ML::Exception(
                "Attempting to alloc a block in use: %lld", offset);
    }

    entry.allocCounter++;
    entry.offset = offset;
    entry.node = TriePtr();
    entry.lastBacktrace = bt;

}

void MemoryTracker::trackDealloc(uint64_t offset) {
    string bt = getBacktrace();

    lock_guard<mutex> guard(blocksLock);

    Block& entry = blocks[offset];
    entry.deallocCounter++;

    if (entry.deallocCounter > entry.allocCounter) {
        entry.dump();
        do_abort();
        throw ML::Exception(
                "Attempting to double free a block: %lld", offset);
    }

    if (entry.readCounter != 0) {
        entry.dump();
        do_abort();
        throw ML::Exception(
                "Attempting to dealloc a block in use: %lld", offset);
    }

    entry.lastBacktrace = bt;
}

string MemoryTracker::getBacktrace() const {
    if (!backtrace)
        return "";

    stringstream ss;
    ::backtrace(ss, 4);
    return ss.str();
}

MemoryTracker::Block MemoryTracker::getBlock(uint64_t offset) const {
    Block block;
    {
        lock_guard<mutex> guard(blocksLock);

        auto it = blocks.find(offset);
        if (it == blocks.cend()) {
            do_abort();
            throw ML::Exception("Accessing uninitialized block: %lld", offset);
        }
        block = it->second;
    }
    return block;
}

void MemoryTracker::checkRead(uint64_t offset, TriePtr node) const {
    Block block = getBlock(offset);

    if (block.allocCounter == block.deallocCounter) {
        block.dump();
        do_abort();
        throw ML::Exception("Reading deallocated block: %lld", offset);
    }

    if (block.node.type != node.type) {
        block.dump();
        stringstream ss;
        ss << "{expected=" << block.node
            << ", actual=" << node
            << "}";
        do_abort();
        throw ML::Exception(
                "Wrong node type: %lld, %s", offset, ss.str().c_str());
    }
}

void MemoryTracker::checkRead(uint64_t offset) const {
    Block block = getBlock(offset);

    if (block.allocCounter == block.deallocCounter) {
        block.dump();
        do_abort();
        throw ML::Exception("Reading deallocated block: %lld", offset);
    }
}

void MemoryTracker::startRead(uint64_t offset) {
    lock_guard<mutex> guard(blocksLock);

    Block& entry = blocks[offset];

    if (entry.deallocCounter == entry.allocCounter) {
        entry.dump();
        do_abort();
        throw ML::Exception(
                "Attempting to read a freed block: %lld", offset);
    }

    entry.readCounter++;
}

void MemoryTracker::endRead(uint64_t offset) {
    lock_guard<mutex> guard(blocksLock);

    Block& entry = blocks[offset];

    if (entry.deallocCounter == entry.allocCounter) {
        entry.dump();
        do_abort();
        throw ML::Exception(
                "Attempting to read a freed block: %lld", offset);
    }

    ExcAssertGreater(entry.readCounter, 0);
    entry.readCounter--;
}

void MemoryTracker::Block::dump(ostream& stream) const {
    if (!lastBacktrace.empty())
        stream << "================== MEMORY BLOCK ==================" << endl;
    else stream << "=== BLOCK: ";

    stream << "offset=" << offset
        << ", allocCounter=" << allocCounter << "/" << deallocCounter
        << ", readCounter=" << readCounter
        << ", node={ " << node << " }"
        << endl;

    if (!lastBacktrace.empty())
        stream << lastBacktrace << endl;
}

void MemoryTracker::checkForLeaks(
        function<void(const Block& block)> cb) const
{
    lock_guard<mutex> guard(blocksLock);

    for (auto it = blocks.begin(), end = blocks.end(); it != end; ++it) {
        Block entry = it->second;

        if (entry.allocCounter == entry.deallocCounter)
            continue;

        cb(entry);
    }
}

void MemoryTracker::dumpLeaks(ostream& stream) const {
    uint32_t counter = 0;
    checkForLeaks([&](const Block& block) {
                block.dump(stream);
                counter++;
            });

    if (counter > 0)
        cerr << counter << " Leaks" << endl;
}