text:
namespace media {

class IvfParser;

namespace v4l2_test {

// A Vp9Decoder decodes VP9-encoded IVF streams using v4l2 ioctl calls.
class Vp9Decoder : public VideoDecoder {
 public:
  Vp9Decoder(const Vp9Decoder&) = delete;
  Vp9Decoder& operator=(const Vp9Decoder&) = delete;
  ~Vp9Decoder() override;

  // Creates a Vp9Decoder after verifying that the underlying implementation
  // supports VP9 stateless decoding.
  static std::unique_ptr<Vp9Decoder> Create(
      std::unique_ptr<IvfParser> ivf_parser,
      const media::IvfFileHeader& file_header);

  // Parses next frame from IVF stream and decodes the frame. This method will
  // place the Y, U, and V values into the respective vectors and update the
  // size with the display area size of the decoded frame.
  VideoDecoder::Result DecodeNextFrame(std::vector<char>& y_plane,
                                       std::vector<char>& u_plane,
                                       std::vector<char>& v_plane,
                                       gfx::Size& size,
                                       const int frame_number) override;

 private:
  Vp9Decoder(std::unique_ptr<IvfParser> ivf_parser,
             std::unique_ptr<V4L2IoctlShim> v4l2_ioctl,
             std::unique_ptr<V4L2Queue> OUTPUT_queue,
             std::unique_ptr<V4L2Queue> CAPTURE_queue);

  // Reads next frame from IVF stream and its size into |vp9_frame_header|
  // and |size| respectively.
  Vp9Parser::Result ReadNextFrame(Vp9FrameHeader& vp9_frame_header,
                                  gfx::Size& size);

  // Copies the frame data into the V4L2 buffer of OUTPUT |queue|.
  bool CopyFrameData(const Vp9FrameHeader& frame_hdr,
                     std::unique_ptr<V4L2Queue>& queue);

  // Sets up per frame parameters |v4l2_frame_params| needed for VP9 decoding
  // with VIDIOC_S_EXT_CTRLS ioctl call.
  void SetupFrameParams(
      const Vp9FrameHeader& frame_hdr,
      struct v4l2_ctrl_vp9_frame_decode_params* v4l2_frame_params);

  // Refreshes |ref_frames_| slots with the current |buffer| and returns
  // |reusable_buffer_slots| to indicate which CAPTURE buffers can be reused
  // for VIDIOC_QBUF ioctl call.
  std::set<int> RefreshReferenceSlots(uint8_t refresh_frame_flags,
                                      scoped_refptr<MmapedBuffer> buffer,
                                      uint32_t last_queued_buffer_index);

  // VP9-specific data.
  const std::unique_ptr<Vp9Parser> vp9_parser_;

  // Reference frames currently in use.
  std::array<scoped_refptr<MmapedBuffer>, kVp9NumRefFrames> ref_frames_;
};

}  // namespace v4l2_test
}  // namespace media

#endif  // MEDIA_GPU_V4L2_TEST_VP9_DECODER_H_


text:
.. only:: not (epub or latex or html)

    WARNING: You are looking at unreleased Cilium documentation.
    Please use the official rendered version released here:
    https://docs.cilium.io

###############
Further Reading
###############

.. include:: ../FURTHER_READINGS.rst
      :start-after: further-reading-begin
      :end-before: further-reading-end

redpajama_set_name: RedPajamaGithub


text:
package uk.co.slc.sfd.cp.ft.jsf.dropdown;

import java.io.Serializable;
import java.util.Locale;

public interface LocalizedTextEnum extends Serializable {

	String getLocalizedText();

	String getLocalizedText(Locale loc);

	String getKeyForText();

}


text:
package at.loup.security.entities.repositories;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import at.loup.security.entities.UserEntity;

@Repository
public interface UserEntityRepository extends JpaRepository<UserEntity, Long> {
	UserEntity findByEmail(String email);

	UserEntity findByApiKey(String apiKey);

	UserEntity findByUsername(String username);

	@Query(value = "select user from UserEntity user where user.username like %:usernameOrEmail% or user.email like %:usernameOrEmail% order by id desc", countProjection = "user")
	Page<UserEntity> findByUsernameContainsOrEmailContains(String usernameOrEmail, Pageable pageable);
}


text:
'use strict'

var getGnrBnrAddress = require('./getGnrBnrAddress')
var kommune
var gnr
var bnr
var query

function fixAddressForMeasurement (item, callback) {
  if (!item) {
    return callback(new Error('Missing required input: item object'), null)
  }

  // Sets school address
  if (item.eksternSkoleAdresse !== '') {
    item.schoolAddresseForMeasurement = item.eksternSkoleAdresse
  } else {
    item.schoolAddresseForMeasurement = item.skoleAdresse
  }

  if (item.folkeregistrertAdresseBosted === 'Gateadresse' && item.alternativAdresse === '') {
    item.registeredAddressForMeasurement = item.folkeregistrertAdresseAdresse
    return callback(null, item)
  }

  if (item.folkeregistrertAdresseBosted === 'Gateadresse' && item.alternativAdresse !== '') {
    item.registeredAddressForMeasurement = item.folkeregistrertAdresseAdresse
    if (item.alternativAdresseBosted === 'Gateadresse') {
      item.alternativeAddressForMeasurement = item.alternativAdresseAdresse
      return callback(null, item)
    } else {
      kommune = item.alternativAdresseKommunenr
      gnr = item.alternativAdresseGnr
      bnr = item.alternativAdresseBnr
      query = kommune + '-' + gnr + '/' + bnr
      getGnrBnrAddress(query, function (err, data) {
        if (err) {
          return callback(err, null)
        } else {
          var lat = data.geocoded.lat
          var lng = data.geocoded.lng
          item.alternativeGnrBnrData = data
          item.alternativeAddressForMeasurement = lat + ',' + lng
          return callback(null, item)
        }
      })
    }
  }

  if (item.folkeregistrertAdresseBosted === 'GnrBnr' && item.alternativAdresse === '') {
    kommune = item.folkeregistrertAdresseKommunenr
    gnr = item.folkeregistrertAdresseGnr
    bnr = item.folkeregistrertAdresseBnr
    query = kommune + '-' + gnr + '/' + bnr
    getGnrBnrAddress(query, function (err, data) {
      if (err) {
        return callback(err, null)
      } else {
        var lat = data.geocoded.lat
        var lng = data.geocoded.lng
        item.registeredGnrBnrData = data
        item.registeredAddressForMeasurement = lat + ',' + lng
        return callback(null, item)
      }
    })
  }

  if (item.folkeregistrertAdresseBosted === 'GnrBnr' && item.alternativAdresse !== '') {
    kommune = item.folkeregistrertAdresseKommunenr
    gnr = item.folkeregistrertAdresseGnr
    bnr = item.folkeregistrertAdresseBnr
    query = kommune + '-' + gnr + '/' + bnr
    getGnrBnrAddress(query, function (err, data) {
      if (err) {
        return callback(err, null)
      } else {
        var lat = data.geocoded.lat
        var lng = data.geocoded.lng
        item.registeredGnrBnrData = data
        item.registeredAddressForMeasurement = lat + ',' + lng
        if (item.alternativAdresseBosted === 'Gateadresse') {
          item.alternativeAddressForMeasurement = item.alternativAdresseAdresse
          return callback(null, item)
        } else {
          kommune = item.alternativAdresseKommunenr
          gnr = item.alternativAdresseGnr
          bnr = item.alternativAdresseBnr
          query = kommune + '-' + gnr + '/' + bnr
          getGnrBnrAddress(query, function (err, data) {
            if (err) {
              return callback(err, null)
            } else {
              var lat = data.geocoded.lat
              var lng = data.geocoded.lng
              item.alternativeGnrBnrData = data
              item.alternativeAddressForMeasurement = lat + ',' + lng
              return callback(null, item)
            }
          })
        }
      }
    })
  }
}

module.exports = fixAddressForMeasurement


text:
using System;
using System.ComponentModel;

namespace Azure.ResourceManager.CosmosDB.Models
{
    /// <summary> Indicates the type of index. </summary>
    public readonly partial struct CosmosDBIndexKind : IEquatable<CosmosDBIndexKind>
    {
        private readonly string _value;

        /// <summary> Initializes a new instance of <see cref="CosmosDBIndexKind"/>. </summary>
        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
        public CosmosDBIndexKind(string value)
        {
            _value = value ?? throw new ArgumentNullException(nameof(value));
        }

        private const string HashValue = "Hash";
        private const string RangeValue = "Range";
        private const string SpatialValue = "Spatial";

        /// <summary> Hash. </summary>
        public static CosmosDBIndexKind Hash { get; } = new CosmosDBIndexKind(HashValue);
        /// <summary> Range. </summary>
        public static CosmosDBIndexKind Range { get; } = new CosmosDBIndexKind(RangeValue);
        /// <summary> Spatial. </summary>
        public static CosmosDBIndexKind Spatial { get; } = new CosmosDBIndexKind(SpatialValue);
        /// <summary> Determines if two <see cref="CosmosDBIndexKind"/> values are the same. </summary>
        public static bool operator ==(CosmosDBIndexKind left, CosmosDBIndexKind right) => left.Equals(right);
        /// <summary> Determines if two <see cref="CosmosDBIndexKind"/> values are not the same. </summary>
        public static bool operator !=(CosmosDBIndexKind left, CosmosDBIndexKind right) => !left.Equals(right);
        /// <summary> Converts a string to a <see cref="CosmosDBIndexKind"/>. </summary>
        public static implicit operator CosmosDBIndexKind(string value) => new CosmosDBIndexKind(value);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is CosmosDBIndexKind other && Equals(other);
        /// <inheritdoc />
        public bool Equals(CosmosDBIndexKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
        /// <inheritdoc />
        public override string ToString() => _value;
    }
}


text:
using UnityEngine;
using System.Collections;

public struct DirectionalPath
{
    public Transform start;
    public Transform end;
    public Vector3 shipStart;
    public Vector3 shipEnd;
    public PathScript pathScript;

    public DirectionalPath(PathScript pathScript, Transform start, Transform end,  Vector3 shipStart, Vector3 shipEnd)
    {
        this.start = start;
        this.end = end;
        this.pathScript = pathScript;
        this.shipStart = shipStart;
        this.shipEnd = shipEnd;
    }

    public Vector3 GetDirectionVector()
    {
        return this.end.position - this.start.position;
    }
}
public class PathScript : MonoBehaviour {

    public Transform start;
    public Transform end;
    public float pathChosingThreshold = 10.0f;
    public float paddingStart = 1.0f;
    public float paddingEnd = 1.0f;

    private Vector3 direction;
    private Vector3 shipStartPosition;
    private Vector3 shipEndPosition;

    LineRenderer lineRenderer;

    private GameObject hintInstance;

	void Start () {
        lineRenderer = GetComponent<LineRenderer>();
        if (lineRenderer && start && end)
        {
            lineRenderer.SetPosition(0, start.position);
            lineRenderer.SetPosition(1, end.position);
        }

        hintInstance = PathManagerScript.Instance.pathArrow;

        direction = (end.position - start.position).normalized;
        this.shipStartPosition = start.position + direction * paddingStart;
        this.shipEndPosition = end.position - direction * paddingEnd;
	}

    public DirectionalPath getDirectionalPath(bool isReversed)
    {
        if (isReversed)
        {
            return new DirectionalPath(this, end, start, shipEndPosition, shipStartPosition);
        }
        else
        {
            return new DirectionalPath(this, start, end, shipStartPosition, shipEndPosition);
        }
    }

    public DirectionalPath GetDirectionStartingFrom(Transform start) {
        if (start.position == this.start.position) return getDirectionalPath(false);
        if (start.position == this.end.position) return getDirectionalPath(true);
        if (Vector3.Distance(start.position, this.start.position)<Vector3.Distance(start.position, this.end.position))
        {
            return getDirectionalPath(false);
        } else
        {
            return getDirectionalPath(true);
        }
    }
    public bool IsMouseCloseEnough(Vector3 mousePosition, Transform startPlanet)
    {
        Vector3 startToPos = mousePosition - startPlanet.position;
        Vector3 pathDirection = GetDirectionStartingFrom(startPlanet).GetDirectionVector();
        return Mathf.Abs(Vector3.Angle(startToPos, pathDirection)) < pathChosingThreshold;
    }
    // Display an arrow at the start of the path
    public void DisplayVisualHint(Transform start)
    {
        DirectionalPath path = GetDirectionStartingFrom(start);
        Vector3 direction = path.GetDirectionVector();
        Quaternion rotation= hintInstance.transform.rotation;
        rotation.SetLookRotation(direction);

        hintInstance.transform.rotation = rotation;
        hintInstance.transform.position = path.shipStart;
        hintInstance.SetActive(true);

    }

    public void StopVisualHint()
    {
        hintInstance.SetActive(false);

    }
}


text:
const request = require('request');
const cheerio = require('cheerio');
const chalk = require('chalk');
const urlencode = require('urlencode');

let defaultDaum = "http://dic.daum.net";
let daumDicURL = defaultDaum + "/search.do?q=";
let urban = "http://www.urbandictionary.com/define.php?term=";
let engDic = "&dic=eng&search_first=Y";

exports.Dictionary = function(expression, query) {
  let uri = makeUri(expression);
  let completeURL = urlCheck(uri, query);
  request(completeURL, (err, res, html)=> {
    if (!err && res.statusCode == 200) {
      let $ = cheerio.load(html);
      if (uri === daumDicURL) DaumDic($, query, completeURL);
      if (uri === urban) urbanSearch($, query);
    }
  })
};

function DaumDic($, query, uri) {
  let detailURL = $('.txt_cleansch').attr('href');
  let completeURL = defaultDaum + detailURL;

  request(completeURL, function (err, res, html) {
    if (!err && res.statusCode == 200) {
      let $ = cheerio.load(html);
      let words = $('.inner_top .list_mean .txt_mean');
      let wordtype = [];
      $('.tit_sort').each(function(i) {
        wordtype.push($(this).text());
      });

      console.log(`\n${query} ${wordtype} \n`);
      words.each(function(i) {
        console.log(`${i+1}. ${$(this).text()}`);
      });
    } else {
      console.log("There aren't any definitions for %s", query);
      //chalk.red("There aren't any definitions for"+ query);
  }
});
}

function makeUri(expression) {
  if(expression === '-e' || expression === '-k'){
    return daumDicURL;
  } else {
    return urban;
  }
}

function EngCheck(query){
  if(query.match(/[a-z]/i)) return true;
  else return false;
}

function urlCheck(uri, query){
  let completeURL = uri + query;
  if(!EngCheck(query)){
    completeURL = uri+urlencode(query)+engDic;
  }
  return completeURL;
}

function urbanSearch($, query) {
  let definitions = $('.meaning');
  definitions.each(function(i) {
    if(i<2) {
      let sentence = $(this).text().replace(/\n/g, "");
      console.log(`\n${i+1}. ${sentence}\n`);
    }
  })
};


text:
<?php do_action( 'bp_before_member_friend_requests_content' ); ?>

<?php if ( bp_has_members( 'type=alphabetical&include=' . bp_get_friendship_requests() ) ) : ?>

			<?php bp_members_pagination_count(); ?>

			<?php bp_members_pagination_links(); ?>

		<?php while ( bp_members() ) : bp_the_member(); ?>

			<li id="friendship-<?php bp_friend_friendship_id(); ?>">

					<a href="<?php bp_member_link(); ?>"><?php bp_member_avatar(); ?>

<a href="<?php bp_member_link(); ?>"><?php bp_member_name(); ?>

<?php bp_member_last_active(); ?>

				<?php do_action( 'bp_friend_requests_item' ); ?>

					<a class="button accept" href="<?php bp_friend_accept_request_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?>
					<a class="button reject" href="<?php bp_friend_reject_request_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?>

					<?php do_action( 'bp_friend_requests_item_action' ); ?>

		<?php endwhile; ?>

	<?php do_action( 'bp_friend_requests_content' ); ?>

			<?php bp_members_pagination_count(); ?>

			<?php bp_members_pagination_links(); ?>

<?php else: ?>

<?php _e( 'You have no pending friendship requests.', 'buddypress' ); ?>

<?php endif;?>

<?php do_action( 'bp_after_member_friend_requests_content' ); ?>


text:
#include "CCProfiling.h"

using namespace std;

NS_CC_BEGIN

//#pragma mark - Profiling Categories
/* set to NO the categories that you don't want to profile */
bool kCCProfilerCategorySprite = false;
bool kCCProfilerCategoryBatchSprite = false;
bool kCCProfilerCategoryParticles = false;

static CCProfiler* g_sSharedProfiler = NULL;

CCProfiler* CCProfiler::sharedProfiler(void)
{
    if (! g_sSharedProfiler)
    {
        g_sSharedProfiler = new CCProfiler();
        g_sSharedProfiler->init();
    }

    return g_sSharedProfiler;
}

CCProfilingTimer* CCProfiler::createAndAddTimerWithName(const char* timerName)
{
    CCProfilingTimer *t = new CCProfilingTimer();
    t->initWithName(timerName);
    m_pActiveTimers->setObject(t, timerName);
    t->release();

    return t;
}

void CCProfiler::releaseTimer(const char* timerName)
{
    m_pActiveTimers->removeObjectForKey(timerName);
}

void CCProfiler::releaseAllTimers()
{
    m_pActiveTimers->removeAllObjects();
}

bool CCProfiler::init()
{
    m_pActiveTimers = new CCDictionary();
    return true;
}

CCProfiler::~CCProfiler(void)
{
    CC_SAFE_RELEASE(m_pActiveTimers);
}

void CCProfiler::displayTimers()
{
    CCDictElement* pElement = NULL;
    CCDICT_FOREACH(m_pActiveTimers, pElement)
    {
        CCProfilingTimer* timer = (CCProfilingTimer*)pElement->getObject();
        CCLog("%s", timer->description());
    }
}

// implementation of CCProfilingTimer

bool CCProfilingTimer::initWithName(const char* timerName)
{
    m_NameStr = timerName;
    numberOfCalls = 0;
    m_dAverageTime = 0.0;
    totalTime = 0.0;
    minTime = 10000.0;
    maxTime = 0.0;
    gettimeofday((struct timeval *)&m_sStartTime, NULL);

    return true;
}

CCProfilingTimer::~CCProfilingTimer(void)
{

}

const char* CCProfilingTimer::description()
{
    static char s_szDesciption[256] = {0};
    sprintf(s_szDesciption, "%s: avg time, %fms", m_NameStr.c_str(), m_dAverageTime);
    return s_szDesciption;
}

void CCProfilingTimer::reset()
{
    numberOfCalls = 0;
    m_dAverageTime = 0;
    totalTime = 0;
    minTime = 10000;
    maxTime = 0;
    gettimeofday((struct timeval *)&m_sStartTime, NULL);
}

void CCProfilingBeginTimingBlock(const char *timerName)
{
    CCProfiler* p = CCProfiler::sharedProfiler();
    CCProfilingTimer* timer = (CCProfilingTimer*)p->m_pActiveTimers->objectForKey(timerName);
    if( ! timer )
    {
        timer = p->createAndAddTimerWithName(timerName);
    }

    gettimeofday((struct timeval *)&timer->m_sStartTime, NULL);

    timer->numberOfCalls++;
}

void CCProfilingEndTimingBlock(const char *timerName)
{
    CCProfiler* p = CCProfiler::sharedProfiler();
    CCProfilingTimer* timer = (CCProfilingTimer*)p->m_pActiveTimers->objectForKey(timerName);

    CCAssert(timer, "CCProfilingTimer  not found");

    struct timeval currentTime;
    gettimeofday(&currentTime, NULL);

    double duration = CCTime::timersubCocos2d((struct cc_timeval *)&timer->m_sStartTime, (struct cc_timeval *)&currentTime);

    // milliseconds
    timer->m_dAverageTime = (timer->m_dAverageTime + duration) / 2.0f;
    timer->totalTime += duration;
    timer->maxTime = MAX( timer->maxTime, duration);
    timer->minTime = MIN( timer->minTime, duration);

}

void CCProfilingResetTimingBlock(const char *timerName)
{
    CCProfiler* p = CCProfiler::sharedProfiler();
    CCProfilingTimer *timer = (CCProfilingTimer*)p->m_pActiveTimers->objectForKey(timerName);

    CCAssert(timer, "CCProfilingTimer not found");

    timer->reset();
}

NS_CC_END


text:
chapter: true
date: 2016-12-03T14:37:29+01:00
icon: <b>2. </b>
next: /config/environment-variables/
prev: /details/telemetry/
title: Configuration
weight: 0
---

### Chapter 2

# Configuration

The configuration file is in TOML format.<br>
TOML looks very similar to INI configuration formats, but with slightly more rich data structures and nesting support.


text:
layout: steroids_wrapper
parent_id: tooling
section_id: android
subsection_id: android-crosswalk
---

<section class="docs-section" id="android-crosswalk">
#Android Crosswalk

## Related guides

- [Android feature table][android-feature-table]

The Android runtime includes the ability to use [Crosswalk](https://crosswalk-project.org/) for your app's WebViews, in place of the regular Android WebViews. Crosswalk utilises Chromium, which is an open source web browser project that is used e.g. in Google Chrome – it's significantly more bleeding-edge compared to the default Android web browser. Crosswalk WebViews are supported on Android 4.0 and newer (SDK version 14+).

The choice between Crosswalk and the regular Android WebViews is done when the app binary is built. The default Scanner app from Google Play is built with Crosswalk and we recommend you to use Crosswalk when building your app.

The benefits include much broader support for new HTML5 features, 2-3x better rendering performance compared to regular WebViews, remote debugging and more consistent behaviour (since the WebView engine used doesn't depend on the device's Android version).

When your app binary is using Crosswalk, all WebViews automatically use it, so you don't need to touch your HTML5 code.

## Debugging

See the [Debugging on Android][debugging-guide] guide.

## Crosswalk Gotchas

There are a few drawbacks to using Crosswalk, as listed below.

#### 1. Minimum SDK level
Crosswalk is not available for Android 2.3 or 3.x, so you need to set the **Minimum SDK level** to 14 or higher in the [Android Build Settings][android-build-settings] page.

#### 2. Build Size
Crosswalk adds 22 MB to the APK file size. In comparison, the APK size without Crosswalk is around 1 MB.

#### 3. Viewport must be defined for page not to appear zoomed out
Crosswalk has currently an issue that WebViews will appear zoomed out unless the Viewport size is defined. See [issue](https://github.com/AppGyver/steroids/issues/297) for workaround and possible side-effects.

</section>

[android-build-settings]: /tooling/build-service/build-settings/build-settings-for-android/
[android-feature-table]: /tooling/wrapper/android/android-feature-table
[debugging-guide]: /tooling/cli/debugging/debugging-on-android/


text:
;(function ($) {

    window.StateDebug = {

        'filter' : JSON.parse(window.localStorage.getItem('state-manager-debug/filter')) || {
            'type': [],
            'event': [],
            'plugin': []
        },

        getIndents: function (type) {
            var minLength = 14,
                indents = "";

            while ((type + indents).length < minLength) {
                indents = indents + " ";
            }

            return indents;
        },

        decorate: function (func, type) {
            var me = this;

            if (me.filter.type.length !== 0 && $.inArray(type, me.filter.type) === -1) {
                type = null;
            }

            return function () {
                var indents = me.getIndents(type);

                switch (type) {
                    case 'subscribe':
                    case 'unsubscribe':
                    case 'publish':
                        var eventName = arguments[0];

                        if (me.filter.event.length !== 0 && !me.filter.event.some(function (val) { return eventName.includes(val) })) {
                            break;
                        }

                        me.logEvents(type, eventName, indents, arguments);

                        break;
                    case 'addPlugin':
                    case 'removePlugin':
                    case 'updatePlugin':
                    case 'destroyPlugin':
                        var pluginName = arguments[1];

                        if (me.filter.plugin.length !== 0 && !me.filter.plugin.some(function (val) { return pluginName.includes(val) })) {
                            break;
                        }

                        me.logPlugins(type, pluginName, indents, arguments);

                        break;
                    case 'switchPlugins':
                        me.logBreakpoints(type, indents, arguments);

                        break;
                    case 'initPlugin':
                        func.apply(
                            this,
                            arguments
                        );

                        var pluginInitName = arguments[2];

                        if (me.filter.plugin.length !== 0 && !me.filter.plugin.some(function (val) { return pluginInitName.includes(val) })) {
                            return;
                        }

                        me.logInits(type, pluginInitName, indents, arguments);

                        return;
                }

                return func.apply(
                    this,
                    arguments
                );
            }
        },

        logEvents: function (type, eventName, indents, args) {
            var argsArray = args[1];

            if (type === 'publish' && args) {
                console.debug("(%s)%s %s [arguments: %O]", type, indents, eventName, argsArray);
            }
            else {
                console.debug("(%s)%s %s", type, indents, eventName);
            }
        },

        logPlugins: function (type, pluginName, indents, args) {
            var element = args[0],
                viewports = args[2];

            if (type === 'addPlugin' && viewports) {
                console.debug("(%s)%s %s [element: %o, viewports: %O]", type, indents, pluginName, element, viewports);
            }
            else {
                console.debug("(%s)%s %s [element: %o]", type, indents, pluginName, element);
            }
        },

        logBreakpoints: function (type, indents, args) {
            var previousState = args[0],
                currentState = args[1];

            console.debug("(%s)%s %c[previousState: %s, currentState: %s]", type, indents, 'font-weight:bold', previousState, currentState);
        },

        logInits: function (type, pluginName, indents, args) {
            var element = args[0],
                selector = args[1],
                plugin = element.data('plugin_' + pluginName);

            if (plugin) {
                console.debug("(%s)%s %s [selector: %o, events: %O]", type, indents, pluginName, selector, plugin._events);
            }
            else {
                console.debug("(%s)%s %s [selector: %o]", type, indents, pluginName, selector);
            }
        },

        setFilter: function (key, value) {
            var me = this;

            me.filter[key] = [];

            if ($.isArray(value)) {
                me.filter[key] = value;
            }
            else if (value) {
                me.filter[key].push(value)
            }

            window.localStorage.setItem('state-manager-debug/filter', JSON.stringify(me.filter))
        },

        setFilterType: function (value) {
            var me = this,
                types = [
                    'subscribe',
                    'unsubscribe',
                    'publish',
                    'addPlugin',
                    'removePlugin',
                    'updatePlugin',
                    'destroyPlugin',
                    'switchPlugins',
                    'initPlugin'
                ];

            if (
                (value && !$.isArray(value) && $.inArray(value, types) === -1) ||
                ($.isArray(value) && !value.every(function (val) { return $.inArray(val, types) !== -1; }))
            ) {
                console.error('Allowed types: %s', types.toString());

                return;
            }

            me.setFilter('type', value);
        },

        setFilterEvent: function (value) {
            var me = this;

            me.setFilter('event', value);
        },

        setFilterPlugin: function (value) {
            var me = this;

            me.setFilter('plugin', value);
        }

    };

    $.subscribe = window.StateDebug.decorate($.subscribe, 'subscribe');
    $.unsubscribe = window.StateDebug.decorate($.unsubscribe, 'unsubscribe');
    $.publish = window.StateDebug.decorate($.publish, 'publish');

    window.StateManager.addPlugin = window.StateDebug.decorate(window.StateManager.addPlugin, 'addPlugin');
    window.StateManager.removePlugin = window.StateDebug.decorate(window.StateManager.removePlugin, 'removePlugin');
    window.StateManager.updatePlugin = window.StateDebug.decorate(window.StateManager.updatePlugin, 'updatePlugin');
    window.StateManager.destroyPlugin = window.StateDebug.decorate(window.StateManager.destroyPlugin, 'destroyPlugin');

    window.StateManager._switchPlugins = window.StateDebug.decorate(window.StateManager._switchPlugins, 'switchPlugins');
    window.StateManager._initSinglePlugin = window.StateDebug.decorate(window.StateManager._initSinglePlugin, 'initPlugin');

}(jQuery));


text:
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Welcome to ShanghaiTech</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="utf-8">
    <link rel="stylesheet" type="text/css" href="{% static '/css/bootstrap.min.css' %}">
    <link href="../../../static/css/bootstrap.min.css" rel="stylesheet">
    <script src="{% static 'js/jquery-3.2.1.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
<style>
        .footer{
            height: 70px;
            background-color: rgba(29,3,3,0.99);
            text-align: center;
            color: white;
            font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

        }
            .zoomImage{
            width:100%;
            height:0;
            padding-bottom: 110%;
            overflow:hidden;
            background-position: center center;
            background-repeat: no-repeat;
            -webkit-background-size:cover;
            -moz-background-size:cover;
            background-size:cover;
        }
        {% block style %}

    {% endblock %}
</style>

</head>

{% block script %}
{% endblock %}
<body>

{% block content %}
<div>
    This is the default content if it is not be replaced!
</div>
{% endblock %}

</body>


text:
from __future__ import unicode_literals

import sys

from collections import OrderedDict
from operator import methodcaller

__all__ = ['ConnectionString']
__version__ = '0.5.0'

class ConnectionString(OrderedDict):

    def __init__(self, *args, **kwargs):
        self._formatted_prio_keys = {self._format_key(k) for k in self._non_overridable_keys}
        super(ConnectionString, self).__init__(*args, **kwargs)

    # Keys that won't be overridden if they appear more than once in the connection string to be loaded
    _non_overridable_keys = ['Provider']
    _format_key = staticmethod(methodcaller('title'))

    @classmethod
    def from_string(cls, string):
        """
        Creates a new instance and loads the passed string

        :param unicode string: connection string to be parsed
        :rtype: ConnectionString

        """
        self = cls()
        self._store_items(self._parse_string(string.lstrip()), allow_prio_overriding=False)

        return self

    def _store_items(self, items, allow_prio_overriding=True):
        """
        Stores key-val items

        :param bool allow_prio_overriding: flag to allow overriding of priority keys

        """
        pred = (lambda k: True) if allow_prio_overriding else self._no_prio_conflict

        self.update((k, v) for k, v in items if pred(k))

    def __setitem__(self, key, value, *args, **kwargs):
        super(ConnectionString, self).__setitem__(self._format_key(key), value, *args, **kwargs)

    def _no_prio_conflict(self, key):
        """
        Returns whether the key can be set or not taking into account that priority keys cannot be overridden

        :rtype: bool

        """
        return key not in self._formatted_prio_keys or key not in self

    @classmethod
    def _parse_string(cls, string):
        """
        Parses the string and returns an iterable of tuples (key, value)

        :raises: ValueError

        """
        while string:
            key, string = cls._get_key_from_string(string)
            value, string = cls._get_value_from_string(string)
            yield key, value

    @classmethod
    def _get_key_from_string(cls, string):
        """
        Receives a leftstripped string, identifies the heading key, and returns a tuple (key, rest of the string)

        :param unicode string: substring of connection string
        :returns: rest of string left stripped and without any leading '='
        :rtype: unicode

        """
        start = 0
        while True:
            pos = string.find('=', start)
            if pos == -1:
                raise ValueError('Token delimiter not found: "="')

            if string[pos+1:pos+2] == '=':
                start = pos + 2
                continue

            key, rest = string[:pos], string[pos+1:]
            return cls._decode_key(key), rest.lstrip()

    _quotes = {'"', "'"}

    @classmethod
    def _get_value_from_string(cls, string):
        """
        Receives a left stripped string, identifies the heading value, decodes it,
        and returns a tuple (key, rest of the string)

        :param unicode string: substring of connection string
        :returns: rest of string left stripped and without any leading ';'
        :rtype: unicode
        :raises: ValueError

        """
        # Not starting with quotes
        first = string[0]
        if first not in cls._quotes:
            value, _, string = string.partition(';')
            return value.rstrip(), string

        start = 1
        while True:
            pos = string.find(first, start)
            if pos == -1:
                raise ValueError('Token delimiter not found: "%s"' % first)

            # If it is a double quote, skip and keep searching
            if string[pos] == string[pos+1]:
                start = pos + 2
                continue

            value, rest = string[:pos+1], string[pos+1:]
            return cls._decode_value(value.rstrip()), rest.lstrip(' ;')

    @staticmethod
    def _decode_key(key):
        if not key:
            raise ValueError('Key cannot be empty string')

        return key.strip().replace('==', '=')

    @staticmethod
    def _encode_key(key):
        if not key:
            raise ValueError('Key cannot be empty string')

        return key.strip().replace('=', '==')

    @classmethod
    def _decode_value(cls, val):
        val = val.strip()

        if not val:
            return val

        # If it does not start with quotes, no decoding needed
        start = val[0]
        if start not in cls._quotes:
            return val

        # Remove wrapping quotes, and reduce any double inner quote
        return val[1:-1].replace(start * 2, start)

    @classmethod
    def _encode_value(cls, val):
        if not val:
            return val

        # No special characters that would require quoting
        if not (
            val.startswith(' ')
            or val.endswith(' ')
            or ';' in val
            or val[0] in cls._quotes
        ):
            return val

        # Get what kind of quotes are present in value
        quotes_in_val = cls._quotes.intersection(val)

        if not quotes_in_val:
            return '"%s"' % val

        if len(quotes_in_val) == 1:
            return '{quote}{val}{quote}'.format(val=val, quote=cls._quotes.difference(quotes_in_val).pop())

        # If both types of quotes in string, escape the double quotes by doubling them
        return '"%s"' % val.replace('"', '""')

    def translate(self, trans, strict=True):
        """
        Translates the keys of the store.

        :param dict trans: translation mapping {pre name: post name}
        :param bool strict: When strict, the existing keys in self that
                            are not in `trans` will be removed. If not strict,
                            they will still exist.

        """
        trans = {self._format_key(key): value for key, value in trans.items()}
        pred = trans.__contains__ if strict else lambda x: True

        translated_items = [(trans.get(key, key), value) for key, value in self.items() if pred(key)]

        self.clear()
        self._store_items(translated_items)

    def get_string(self):
        """
        :returns: the composed connection string
        :rtype: unicode

        """
        if not self:
            return ''

        return ';'.join('%s=%s' % (self._encode_key(k), self._encode_value(v))
                        for k, v in self.items()) + ';'

    def __unicode__(self):
        return self.get_string()

    def __str__(self):
        return self.get_string() if sys.version_info > (3, 0) else self.get_string().encode('utf-8')

    def __repr__(self):
        return '<ConnectionString \'%s\'>' % self.get_string()

    __getitem__ = lambda self, key: super(ConnectionString, self).__getitem__(self._format_key(key))
    __delitem__ = lambda self, key: super(ConnectionString, self).__delitem__(self._format_key(key))
    __contains__ = lambda self, key: super(ConnectionString, self).__contains__(self._format_key(key))


text:
import './VAvatar.sass'

// Mixins
import Colorable from '../../mixins/colorable'
import Measurable from '../../mixins/measurable'
import Roundable from '../../mixins/roundable'

// Utilities
import { convertToUnit } from '../../util/helpers'

// Types
import { VNode } from 'vue'
import mixins from '../../util/mixins'

export default mixins(
  Colorable,
  Measurable,
  Roundable,
  /* @vue/component */
).extend({
  name: 'v-avatar',

  props: {
    left: Boolean,
    right: Boolean,
    size: {
      type: [Number, String],
      default: 48,
    },
  },

  computed: {
    classes (): object {
      return {
        'v-avatar--left': this.left,
        'v-avatar--right': this.right,
        ...this.roundedClasses,
      }
    },
    styles (): object {
      return {
        height: convertToUnit(this.size),
        minWidth: convertToUnit(this.size),
        width: convertToUnit(this.size),
        ...this.measurableStyles,
      }
    },
  },

  render (h): VNode {
    const data = {
      staticClass: 'v-avatar',
      class: this.classes,
      style: this.styles,
      on: this.$listeners,
    }

    return h('div', this.setBackgroundColor(this.color, data), this.$slots.default)
  },
})


text:
package com.sohu.cache.constant;

/**
 * Created by yijunzhang on 2018-12-26
 */
public class OperateResult {
    private boolean isSuccess;

    private String message;

    private OperateResult(boolean isSuccess, String message) {
        this.isSuccess = isSuccess;
        this.message = message;
    }

    public static OperateResult success() {
        return new OperateResult(true, "");
    }

    public static OperateResult fail(String message) {
        return new OperateResult(false, message);
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean isSuccess) {
        this.isSuccess = isSuccess;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "OperateResult [isSuccess=" + isSuccess + ", message=" + message + "]";
    }

}


text:
/* global respoke: false, sinon: true, expect: false, assert: false */
describe("respoke.SignalingChannel", function () {
    'use strict';
    var _actualSinon = sinon;
    var expect = chai.expect;
    var client;
    var instanceId;

    beforeEach(function () {
        sinon = sinon.sandbox.create();
        instanceId = respoke.makeGUID();
        client = respoke.createClient({
            instanceId: instanceId
        });
    });

    afterEach(function () {
        sinon.restore();
        sinon = _actualSinon;
    });

    describe('instance structure', function () {
        it('is exposed on the client', function () {
            expect(client.signalingChannel).to.be.an('object');
        });
        it('is a new instance per client', function () {
            client.jingle = 'bells';
            var otherClient = respoke.createClient({ instanceId: respoke.makeGUID() });
            expect(otherClient.signalingChannel.jingle).to.not.exist();
        });
        it('exposes the socket.io listeners', function () {
            var sigchan = client.signalingChannel;
            expect(sigchan.socketOnJoin).to.be.a('function');
            expect(sigchan.socketOnLeave).to.be.a('function');
            expect(sigchan.socketOnPubSub).to.be.a('function');
            expect(sigchan.socketOnMessage).to.be.a('function');
            expect(sigchan.socketOnPresence).to.be.a('function');
        });
        it('exposes the socket.io socket property after connecting', function () {
            expect(client.signalingChannel.socket).to.equal(null);
            client.signalingChannel.authenticate();
            expect(client.signalingChannel.socket).to.exist();
        });
        it('exposes wsCall for testing purposes', function () {
            expect(client.signalingChannel.wsCall).to.be.a('function');
        });
        it('exposes action over web socket methods', function () {
            expect(client.signalingChannel.wsCall).to.be.a('function');
        });
    });

    describe('isConnected()', function () {
        describe('when called via client.isConnected', function () {
            beforeEach(function () {
                sinon.spy(client.signalingChannel, 'isConnected');
            });
            it('uses signalingChannel.isConnected', function () {
                client.isConnected();
                expect(client.signalingChannel.isConnected.callCount).to.equal(1);
            });
        });
        describe('when called directly', function () {
            describe('before the socket is setup', function () {
                it('returns false', function () {
                    expect(client.signalingChannel.isConnected()).to.equal(false);
                });
            });
            describe('when the socket is connected', function () {
                beforeEach(function () {
                    client.signalingChannel.socket = {
                        socket: {
                            connected: true,
                            connecting: false
                        }
                    };
                });
                it('returns true', function () {
                    expect(client.signalingChannel.isConnected()).to.equal(true);
                });
            });
            describe('when the socket is not connected', function () {
                beforeEach(function () {
                    client.signalingChannel.socket = {
                        socket: {
                            connected: false,
                            connecting: true
                        }
                    };
                });
                it('returns false', function () {
                    expect(client.signalingChannel.isConnected()).to.equal(false);
                });
            });
        });
    });

    describe("routeSignal", function () {

        var routeSignal;

        beforeEach(function () {
            routeSignal = client.signalingChannel.routeSignal;
        });

        describe("when passed a signal with no target", function () {

            it("rejects the returned promise", function () {
                return routeSignal({ }).then(function () {
                    assert.fail('should not resolve');
                }, function (err) {
                    expect(err).to.exist();
                });
            });
        });

        describe("when passed a signal with a target of 'directConnection'", function () {

            describe("in all scenarios", function () {

                beforeEach(function () {
                    sinon.stub(client, 'getCall').returns({});
                });

                it("calls client.getCall with the appropriate params", function () {
                    var passedSignal = {
                        sessionId: 'someSessionId',
                        fromEndpoint: 'someEndpointId',
                        target: 'directConnection',
                        conferenceId: 'someConferenceId',
                        fromType: 'someFromType',
                        signalType: 'offer',
                        callerId: { number: '+12566666666' },
                        metadata: { orderNumber: 'lksdjfalskdjf' }
                    };

                    return routeSignal(passedSignal).then(function () {
                        expect(client.getCall.calledOnce).to.equal(true);
                        expect(client.getCall.firstCall.args[0]).to.deep.equal({
                            id: 'someSessionId',
                            endpointId: 'someEndpointId',
                            target: 'directConnection',
                            conferenceId: 'someConferenceId',
                            type: 'someFromType',
                            create: false, // because signal target is 'directConnection'
                            callerId: { number: '+12566666666' },
                            metadata: { orderNumber: 'lksdjfalskdjf' }
                        });
                    });
                });
            });

            describe("when the call associated with the signal is not found", function () {

                describe("in all scenarios", function () {

                    var fakeEndpoint;

                    beforeEach(function () {
                        fakeEndpoint = {
                            directConnection: {
                                call: { id: 'someSessionId', fire: sinon.stub() }
                            }
                        };

                        sinon.stub(client, 'getCall');
                        sinon.stub(client, 'getEndpoint').returns(fakeEndpoint);
                    });

                    it("looks up the endpoint associated with the signal", function () {
                        var passedSignal = {
                            sessionId: 'someSessionId',
                            fromEndpoint: 'someEndpointId',
                            target: 'directConnection',
                            conferenceId: 'someConferenceId',
                            fromType: 'someFromType',
                            signalType: 'offer',
                            callerId: { number: '+12566666666' },
                            metadata: { orderNumber: 'lksdjfalskdjf' }
                        };

                        return routeSignal(passedSignal).then(function () {
                            expect(client.getEndpoint.calledOnce).to.equal(true);
                            expect(client.getEndpoint.firstCall.args[0]).to.deep.equal({
                                id: 'someEndpointId',
                                skipPresence: true
                            });
                        });
                    });
                });

                describe("but the direct connection already exists", function () {

                    var fakeEndpoint;

                    beforeEach(function () {
                        fakeEndpoint = {
                            directConnection: {
                                call: { id: 'someSessionId', fire: sinon.stub() }
                            },
                            startDirectConnection: sinon.stub()
                        };

                        sinon.stub(client, 'getCall');
                        sinon.stub(client, 'getEndpoint').returns(fakeEndpoint);
                    });

                    it("does not call startDirectConnection", function () {
                        var passedSignal = {
                            sessionId: 'someSessionId',
                            fromEndpoint: 'someEndpointId',
                            target: 'directConnection',
                            conferenceId: 'someConferenceId',
                            fromType: 'someFromType',
                            signalType: 'offer',
                            callerId: { number: '+12566666666' },
                            metadata: { orderNumber: 'lksdjfalskdjf' }
                        };

                        return routeSignal(passedSignal).then(function () {
                            expect(fakeEndpoint.startDirectConnection.called).to.equal(false);
                        });
                    });
                });

                describe("and the direct connection does not exist", function () {

                    var fakeEndpoint;

                    beforeEach(function () {
                        fakeEndpoint = {
                            startDirectConnection: sinon.stub().returns({
                                call: { id: 'someSessionId', fire: sinon.stub() }
                            })
                        };

                        sinon.stub(client, 'getCall');
                        sinon.stub(client, 'getEndpoint').returns(fakeEndpoint);
                    });

                    it("calls startDirectConnection with relevant params", function () {
                        var passedSignal = {
                            sessionId: 'someSessionId',
                            fromEndpoint: 'someEndpointId',
                            target: 'directConnection',
                            conferenceId: 'someConferenceId',
                            fromType: 'someFromType',
                            signalType: 'offer',
                            callerId: { number: '+12566666666' },
                            metadata: { orderNumber: 'lksdjfalskdjf' }
                        };

                        return routeSignal(passedSignal).then(function () {
                            expect(fakeEndpoint.startDirectConnection.calledOnce).to.equal(true);
                            expect(fakeEndpoint.startDirectConnection.firstCall.args[0]).to.deep.equal({
                                id: 'someSessionId',
                                create: true,
                                caller: false,
                                metadata: { orderNumber: 'lksdjfalskdjf' }
                            });
                        });
                    });
                });
            });
        });

        describe("when passed a signal with a target that is not 'directConnection'", function () {

            describe("in all scenarios", function () {

                beforeEach(function () {
                    sinon.stub(client, 'getCall').returns({});
                });

                it("calls client.getCall with the appropriate params", function () {
                    var passedSignal = {
                        sessionId: 'someSessionId',
                        fromEndpoint: 'someEndpointId',
                        target: 'web',
                        conferenceId: 'someConferenceId',
                        fromType: 'someFromType',
                        signalType: 'offer',
                        callerId: { number: '+12566666666' },
                        metadata: { orderNumber: 'lksdjfalskdjf' }
                    };

                    return routeSignal(passedSignal).then(function () {
                        expect(client.getCall.calledOnce).to.equal(true);
                        expect(client.getCall.firstCall.args[0]).to.deep.equal({
                            id: 'someSessionId',
                            endpointId: 'someEndpointId',
                            target: 'web',
                            conferenceId: 'someConferenceId',
                            type: 'someFromType',
                            create: true, // because signalType is 'offer'
                            callerId: { number: '+12566666666' },
                            metadata: { orderNumber: 'lksdjfalskdjf' }
                        });
                    });
                });
            });
        });
    });
});


text:
<?php
namespace App\Model\Table;

use App\Model\Entity\Contact;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;

/**
 * Contacts Model
 *
 * @property \Cake\ORM\Association\BelongsTo $Assets
 * @property \Cake\ORM\Association\BelongsTo $Users
 * @property \Cake\ORM\Association\BelongsTo $Countries
 */
class ContactsTable extends Table
{

    /**
     * Initialize method
     *
     * @param array $config The configuration for the Table.
     * @return void
     */
    public function initialize(array $config)
    {
        parent::initialize($config);

        $this->table('contacts');
        $this->displayField('id');
        $this->primaryKey('id');

        $this->addBehavior('Timestamp');

        $this->belongsTo('Users', [
            'foreignKey' => 'user_id',
            'joinType' => 'INNER'
        ]);

        $this->belongsTo('Countries', [
            'foreignKey' => 'country_id'
        ]);
    }

    /**
     * Default validation rules.
     *
     * @param \Cake\Validation\Validator $validator Validator instance.
     * @return \Cake\Validation\Validator
     */
    public function validationDefault(Validator $validator)
    {
        $validator
            ->allowEmpty('id', 'create');

        $validator
            ->requirePresence('first_name', 'create')
            ->notEmpty('first_name');

        $validator
            ->requirePresence('last_name', 'create')
            ->notEmpty('last_name');

        $validator
            ->allowEmpty('phone');

        $validator
            ->allowEmpty('address');

        $validator
            ->allowEmpty('post_code');

        $validator
            ->allowEmpty('city');

        $validator
            ->allowEmpty('gender');

        $validator
            ->allowEmpty('birth_date');

        $validator
            ->add('is_active', 'valid', ['rule' => 'boolean'])
            ->requirePresence('is_active', 'create')
            ->notEmpty('is_active');

        $validator
            ->allowEmpty('deleted');

        $validator
            ->add('latitude', 'valid', ['rule' => 'numeric'])
            ->allowEmpty('latitude');

        $validator
            ->add('longitude', 'valid', ['rule' => 'numeric'])
            ->allowEmpty('longitude');

        $validator
            ->add('email', 'valid', ['rule' => 'email'])
            ->allowEmpty('email');

        return $validator;
    }

    /**
     * Returns a rules checker object that will be used for validating
     * application integrity.
     *
     * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
     * @return \Cake\ORM\RulesChecker
     */
    public function buildRules(RulesChecker $rules)
    {
        $rules->add($rules->isUnique(['email']));
        $rules->add($rules->existsIn(['user_id'], 'Users'));
        $rules->add($rules->existsIn(['country_id'], 'Countries'));
        return $rules;
    }
}


text:
package org.pentaho.di.trans.steps.streamlookup;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.pentaho.di.core.RowMetaAndData;
import org.pentaho.di.core.exception.KettleValueException;
import org.pentaho.di.core.hash.ByteArrayHashIndex;
import org.pentaho.di.core.hash.LongHashIndex;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.trans.step.BaseStepData;
import org.pentaho.di.trans.step.StepDataInterface;
import org.pentaho.di.trans.step.errorhandling.StreamInterface;

/**
 * @author Matt
 * @since 24-jan-2005
 */
public class StreamLookupData extends BaseStepData implements StepDataInterface {
  /** used to store values in used to look up things */
  public Map<RowMetaAndData, Object[]> look;

  public List<KeyValue> list;

  /** nrs of keys-values in row. */
  public int[] keynrs;

  /** The metadata we send out */
  public RowMetaInterface outputRowMeta;

  /** default string converted to values... */
  public Object[] nullIf;

  /** Flag to indicate that we have to read lookup values from the info step */
  public boolean readLookupValues;

  /**
   * Stores the first row of the lookup-values to later determine if the types are the same as the input row lookup
   * values.
   */
  public RowMetaInterface keyTypes;

  public RowMetaInterface keyMeta;

  public RowMetaInterface valueMeta;

  public Comparator<KeyValue> comparator;

  public ByteArrayHashIndex hashIndex;
  public LongHashIndex longIndex;

  public RowMetaInterface lookupMeta;

  public RowMetaInterface infoMeta;

  public int[] lookupColumnIndex;

  public boolean metadataVerifiedIntegerPair;

  /** See if we need to convert the keys to a native data type */
  public boolean[] convertKeysToNative;

  // Did we read rows from the lookup hop.
  public boolean hasLookupRows;

  public StreamInterface infoStream;

  public StreamLookupData() {
    super();
    look = new HashMap<RowMetaAndData, Object[]>();
    hashIndex = null;
    longIndex = new LongHashIndex();
    list = new ArrayList<KeyValue>();
    metadataVerifiedIntegerPair = false;
    hasLookupRows = false;

    comparator = new Comparator<KeyValue>() {
      public int compare( KeyValue k1, KeyValue k2 ) {
        try {
          return keyMeta.compare( k1.getKey(), k2.getKey() );
        } catch ( KettleValueException e ) {
          throw new RuntimeException( "Stream Lookup comparator error", e );
        }
      }
    };
  }

}


text:
/*!
** @file SINK3.c
** @version 01.03
** @brief
**         The HAL BitIO component provides a low level API for unified
**         access to general purpose digital input/output pins across
**         various device designs.
**
**         RTOS drivers using HAL BitIO API are simpler and more
**         portable to various microprocessors.
*/
/*!
**  @addtogroup SINK3_module SINK3 module documentation
**  @{
*/

/* MODULE SINK3. */

/* {Default RTOS Adapter} No RTOS includes */
#include "SINK3.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
  LDD_TUserData *UserDataPtr;          /* Pointer to user data */
} SINK3_TDeviceData;                   /* Device data structure type */

typedef SINK3_TDeviceData *SINK3_TDeviceDataPtr ; /* Pointer to the device data structure. */

/* {Default RTOS Adapter} Static object used for simulation of dynamic driver memory allocation */
static SINK3_TDeviceData DeviceDataPrv__DEFAULT_RTOS_ALLOC;
/*
** ===================================================================
**     Method      :  SINK3_Init (component BitIO_LDD)
*/
/*!
**     @brief
**         Initializes the device. Allocates memory for the device data
**         structure, allocates interrupt vectors and sets interrupt
**         priority, sets pin routing, sets timing, etc. If the "Enable
**         in init. code" is set to "yes" value then the device is also
**         enabled(see the description of the Enable() method). In this
**         case the Enable() method is not necessary and needn't to be
**         generated.
**     @param
**         UserDataPtr     - Pointer to the user or
**                           RTOS specific data. This pointer will be
**                           passed as an event or callback parameter.
**     @return
**                         - Pointer to the dynamically allocated private
**                           structure or NULL if there was an error.
*/
/* ===================================================================*/
LDD_TDeviceData* SINK3_Init(LDD_TUserData *UserDataPtr)
{
  /* Allocate device structure */
  SINK3_TDeviceDataPtr DeviceDataPrv;

  /* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */
  DeviceDataPrv = &DeviceDataPrv__DEFAULT_RTOS_ALLOC;
  DeviceDataPrv->UserDataPtr = UserDataPtr; /* Store the RTOS device structure */
  /* Enable device clock gate */
  /* SIM_SCGC5: PORTB=1 */
  SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK;
  /* Configure pin as output */
  /* GPIOB_PDDR: PDD|=0x00040000 */
  GPIOB_PDDR |= GPIO_PDDR_PDD(0x00040000);
  /* Set initialization value */
  /* GPIOB_PDOR: PDO&=~0x00040000 */
  GPIOB_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x00040000));
  /* Initialization of pin routing */
  /* PORTB_PCR18: ISF=0,MUX=1 */
  PORTB_PCR18 = (uint32_t)((PORTB_PCR18 & (uint32_t)~(uint32_t)(
                 PORT_PCR_ISF_MASK |
                 PORT_PCR_MUX(0x06)
                )) | (uint32_t)(
                 PORT_PCR_MUX(0x01)
                ));
  /* Registration of the device structure */
  PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_SINK3_ID,DeviceDataPrv);
  return ((LDD_TDeviceData *)DeviceDataPrv);
}
/*
** ===================================================================
**     Method      :  SINK3_SetDir (component BitIO_LDD)
*/
/*!
**     @brief
**         Sets a pin direction (available only if the direction =
**         _[input/output]_).
**     @param
**         DeviceDataPtr   - Device data structure
**                           pointer returned by <Init> method.
**     @param
**         Dir             - Direction to set. Possible values:
**                           <false> - Input
**                           <true> - Output
*/
/* ===================================================================*/
void SINK3_SetDir(LDD_TDeviceData *DeviceDataPtr, bool Dir)
{
  (void)DeviceDataPtr;                 /* Parameter is not used, suppress unused argument warning */
  if (Dir) {
    /* Output */
    GPIO_PDD_SetPortOutputDirectionMask(SINK3_MODULE_BASE_ADDRESS, SINK3_PORT_MASK);
  } else {
    /* Input */
    GPIO_PDD_SetPortInputDirectionMask(SINK3_MODULE_BASE_ADDRESS, SINK3_PORT_MASK);
  }
}

/*
** ===================================================================
**     Method      :  SINK3_SetInput (component BitIO_LDD)
*/
/*!
**     @brief
**         Sets a pin direction to input (available only if the
**         direction = _[input/output]_).
**     @param
**         DeviceDataPtr   - Device data structure
**                           pointer returned by <Init> method.
*/
/* ===================================================================*/
void SINK3_SetInput(LDD_TDeviceData *DeviceDataPtr)
{
  (void)DeviceDataPtr;                 /* Parameter is not used, suppress unused argument warning */
  GPIO_PDD_SetPortInputDirectionMask(SINK3_MODULE_BASE_ADDRESS, SINK3_PORT_MASK);
}

/*
** ===================================================================
**     Method      :  SINK3_GetVal (component BitIO_LDD)
*/
/*!
**     @brief
**         Returns the input/output value. If the direction is [input]
**         then the input value of the pin is read and returned. If the
**         direction is [output] then the last written value is read
**         and returned (see <Safe mode> property for limitations).
**         This method cannot be disabled if direction is [input].
**     @param
**         DeviceDataPtr   - Device data structure
**                           pointer returned by <Init> method.
**     @return
**                         - Input or output value. Possible values:
**                           <false> - logical "0" (Low level)
**                           <true> - logical "1" (High level)
*/
/* ===================================================================*/
bool SINK3_GetVal(LDD_TDeviceData *DeviceDataPtr)
{
  uint32_t PortData;                   /* Port data masked according to the bit used */

  (void)DeviceDataPtr;                 /* Parameter is not used, suppress unused argument warning */
  if ((GPIO_PDD_GetPortDirection(SINK3_MODULE_BASE_ADDRESS) & SINK3_PORT_MASK) == 0U) {
    /* Port is configured as input */
    PortData = GPIO_PDD_GetPortDataInput(SINK3_MODULE_BASE_ADDRESS) & SINK3_PORT_MASK;
  } else {
    /* Port is configured as output */
    PortData = GPIO_PDD_GetPortDataOutput(SINK3_MODULE_BASE_ADDRESS) & SINK3_PORT_MASK;
  }
  return (PortData != 0U) ? (bool)TRUE : (bool)FALSE;
}

/*
** ===================================================================
**     Method      :  SINK3_PutVal (component BitIO_LDD)
*/
/*!
**     @brief
**         The specified output value is set. If the direction is
**         input, the component saves the value to a memory or a
**         register and this value will be written to the pin after
**         switching to the output mode (using <tt>SetDir(TRUE)</tt>;
**         see Safe mode
**         property for limitations). If the direction is output,
**         it writes the value to the pin. (Method is available only if
**         the direction = <tt>output</tt> or <tt>
**         input/output</tt>).
**     @param
**         DeviceDataPtr   - Device data structure
**                           pointer returned by <Init> method.
**     @param
**         Val             - Output value. Possible values:
**                           <false> - logical "0" (Low level)
**                           <true> - logical "1" (High level)
*/
/* ===================================================================*/
void SINK3_PutVal(LDD_TDeviceData *DeviceDataPtr, bool Val)
{
  (void)DeviceDataPtr;                 /* Parameter is not used, suppress unused argument warning */
  if (Val) {
    GPIO_PDD_SetPortDataOutputMask(SINK3_MODULE_BASE_ADDRESS, SINK3_PORT_MASK);
  } else { /* !Val */
    GPIO_PDD_ClearPortDataOutputMask(SINK3_MODULE_BASE_ADDRESS, SINK3_PORT_MASK);
  } /* !Val */
}

/*
** ===================================================================
**     Method      :  SINK3_ClrVal (component BitIO_LDD)
*/
/*!
**     @brief
**         Clears (set to zero) the output value. It is equivalent to
**         the [PutVal(FALSE)]. This method is available only if the
**         direction = _[output]_ or _[input/output]_.
**     @param
**         DeviceDataPtr   - Pointer to device data
**                           structure returned by <Init> method.
*/
/* ===================================================================*/
void SINK3_ClrVal(LDD_TDeviceData *DeviceDataPtr)
{
  (void)DeviceDataPtr;                 /* Parameter is not used, suppress unused argument warning */
  GPIO_PDD_ClearPortDataOutputMask(SINK3_MODULE_BASE_ADDRESS, SINK3_PORT_MASK);
}

/*
** ===================================================================
**     Method      :  SINK3_SetVal (component BitIO_LDD)
*/
/*!
**     @brief
**         Sets (to one) the output value. It is equivalent to the
**         [PutVal(TRUE)]. This method is available only if the
**         direction = _[output]_ or _[input/output]_.
**     @param
**         DeviceDataPtr   - Pointer to device data
**                           structure returned by <Init> method.
*/
/* ===================================================================*/
void SINK3_SetVal(LDD_TDeviceData *DeviceDataPtr)
{
  (void)DeviceDataPtr;                 /* Parameter is not used, suppress unused argument warning */
  GPIO_PDD_SetPortDataOutputMask(SINK3_MODULE_BASE_ADDRESS, SINK3_PORT_MASK);
}

/* END SINK3. */

#ifdef __cplusplus
}  /* extern "C" */
#endif

/*!
** @}
*/
/*
** ###################################################################
**
**     This file was created by Processor Expert 10.5 [05.21]
**     for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/


text:
namespace Jog.Models
{
    public enum PostStatus
    {
        Publish,Draft
    }
}


text:
<?php declare(strict_types=1);

namespace WyriHaximus\Travis\Resource;

use ApiClients\Foundation\Hydrator\Annotations\EmptyResource;
use ApiClients\Foundation\Resource\AbstractResource;

/**
 * @EmptyResource("EmptyBroadcast")
 */
abstract class Broadcast extends AbstractResource implements BroadcastInterface
{
    /**
     * @var int
     */
    protected $id;

    /**
     * @var string
     */
    protected $message;

    /**
     * @return int
     */
    public function id() : int
    {
        return $this->id;
    }

    /**
     * @return string
     */
    public function message() : string
    {
        return $this->message;
    }
}


text:
package com.jsonde.util;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;

public class ObjectIdGenerator<T> {

    private AtomicLong sequence = new AtomicLong();
    private Map<ObjectWrapper<T>, Long> objectIds = new HashMap<ObjectWrapper<T>, Long>();

    public synchronized long getId(T object) {

        ObjectWrapper<T> objectWrapper = wrap(object);

        if (!objectIds.containsKey(objectWrapper)) {
            objectIds.put(objectWrapper, sequence.getAndIncrement());
        }

        return objectIds.get(objectWrapper);

    }

    public synchronized long pollId(T object) throws ObjectIsAbsentException {

        ObjectWrapper<T> objectWrapper = wrap(object);

        if (objectIds.containsKey(objectWrapper)) {
            return objectIds.get(objectWrapper);
        } else {
            throw new ObjectIsAbsentException();
        }

    }

    @SuppressWarnings("unchecked")
    private ObjectWrapper<T> wrap(T object) {
        if (object instanceof ObjectWrapper) {
            return (ObjectWrapper<T>) object;
        } else {
            return new ObjectWrapper<T>(object);
        }
    }

    public static <M, N> Pair<M, N> pair(M m, N n) {
        return new Pair<M, N>(m, n);
    }

    public static class Pair<M, N> extends ObjectWrapper<Pair<M, N>> {

        private final M m;
        private final N n;

        private Pair(M m, N n) {
            this.m = m;
            this.n = n;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (m != null ? m != pair.m : pair.m != null) return false;
            if (n != null ? n != pair.n : pair.n != null) return false;

            return true;
        }

        @Override
        public int hashCode() {
            int result = m != null ? System.identityHashCode(m) : 0;
            result = 31 * result + (n != null ? System.identityHashCode(n) : 0);
            return result;
        }

    }

    private static class ObjectWrapper<T> {

        private final T object;

        private ObjectWrapper(T object) {
            this.object = object;
        }

        @SuppressWarnings("unchecked")
        protected ObjectWrapper() {
            object = (T) this;
        }

        @Override
        public int hashCode() {
            return System.identityHashCode(object);
        }

        @Override
        public boolean equals(Object obj) {

            if (null == object) {
                return null == obj;
            } else {
                return object == obj;
            }

        }
    }

}


text:
    Your Settings

        Sign Up

Stay in touch!

        Account

Sign out

        Speed

Set your preferred bike and walk speeds.

 Are you a Stroller (2 mph) or a Speedwalker (4 mph)? Choose below:

        <button class="stroller icon-walk" on-tap="setWalkSpeed" title="Stroller"></button>
        <button class="speedwalker icon-speedwalker" on-tap="setWalkSpeed" title="Speedwalker"></button>

 Are you a Cruiser (6 mph) or a Racer? (10 mph)? Choose below:

        <button class="cruiser icon-cruiserbike" on-tap="setBikeSpeed" title="Cruiser"></button>
        <button class="racer icon-racerbike" on-tap="setBikeSpeed" title="Racer"></button>

        Saved Trips

Review your saved journeys.

No saved journeys!

        Walk Time

Maximum walk time.

      <form>
        <select disabled>
          <option value="5">5 min</option>
          <option value="10">10 min</option>
          <option value="15">15 min</option>
          <option value="20">20 min</option>
          <option value="25">25 min</option>
          <option value="30">30 min</option>
          <option value="35">35 min</option>
          <option value="40">40 min</option>
          <option value="45">45 min</option>
          <option value="50">50 min</option>
          <option value="55">55 min</option>
          <option value="60">60 min</option>
        </select>
      </form>


text:
require 'stringio'
require 'protobuf/decoder'
require 'protobuf/encoder'

module Protobuf
  class Message
    module Serialization

      module ClassMethods
        def decode(bytes)
          new.decode(bytes)
        end

        def decode_from(stream)
          new.decode_from(stream)
        end

        # Create a new object with the given values and return the encoded bytes.
        def encode(fields = {})
          new(fields).encode
        end
      end

      def self.included(other)
        other.extend(ClassMethods)
      end

      ##
      # Instance Methods
      #

      # Decode the given non-stream bytes into this message.
      #
      def decode(bytes)
        decode_from(::StringIO.new(bytes))
      end

      # Decode the given stream into this message.
      #
      def decode_from(stream)
        ::Protobuf::Decoder.decode_each_field(stream) do |tag, bytes|
          set_field_bytes(tag, bytes)
        end

        self
      end

      # Encode this message
      #
      def encode
        stream = ::StringIO.new
        stream.set_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING)
        encode_to(stream)
        stream.string
      end

      # Encode this message to the given stream.
      #
      def encode_to(stream)
        ::Protobuf::Encoder.encode(self, stream)
      end

      ##
      # Instance Aliases
      #
      alias_method :parse_from_string, :decode
      alias_method :deserialize, :decode
      alias_method :parse_from, :decode_from
      alias_method :deserialize_from, :decode_from
      alias_method :to_s, :encode
      alias_method :bytes, :encode
      alias_method :serialize, :encode
      alias_method :serialize_to_string, :encode
      alias_method :serialize_to, :encode_to

      private

      def set_field_bytes(tag, bytes)
        field = self.class.get_field(tag, true)
        field.set(self, bytes) if field
      end

    end
  end
end