text:
var _ = require('../util')
var isObject = _.isObject
var isPlainObject = _.isPlainObject
var textParser = require('../parsers/text')
var expParser = require('../parsers/expression')
var templateParser = require('../parsers/template')
var compiler = require('../compiler')
var uid = 0

// async component resolution states
var UNRESOLVED = 0
var PENDING = 1
var RESOLVED = 2
var ABORTED = 3

module.exports = {

  /**
   * Setup.
   */

  bind: function () {
    // uid as a cache identifier
    this.id = '__v_repeat_' + (++uid)
    // setup anchor nodes
    this.start = _.createAnchor('v-repeat-start')
    this.end = _.createAnchor('v-repeat-end')
    _.replace(this.el, this.end)
    _.before(this.start, this.end)
    // check if this is a block repeat
    this.template = _.isTemplate(this.el)
      ? templateParser.parse(this.el, true)
      : this.el
    // check other directives that need to be handled
    // at v-repeat level
    this.checkIf()
    this.checkRef()
    this.checkComponent()
    // check for trackby param
    this.idKey =
      this._checkParam('track-by') ||
      this._checkParam('trackby') // 0.11.0 compat
    // check for transition stagger
    var stagger = +this._checkParam('stagger')
    this.enterStagger = +this._checkParam('enter-stagger') || stagger
    this.leaveStagger = +this._checkParam('leave-stagger') || stagger
    this.cache = Object.create(null)
  },

  /**
   * Warn against v-if usage.
   */

  checkIf: function () {
    if (_.attr(this.el, 'if') !== null) {
      _.warn(
        'Don\'t use v-if with v-repeat. ' +
        'Use v-show or the "filterBy" filter instead.'
      )
    }
  },

  /**
   * Check if v-ref/ v-el is also present.
   */

  checkRef: function () {
    var refID = _.attr(this.el, 'ref')
    this.refID = refID
      ? this.vm.$interpolate(refID)
      : null
    var elId = _.attr(this.el, 'el')
    this.elId = elId
      ? this.vm.$interpolate(elId)
      : null
  },

  /**
   * Check the component constructor to use for repeated
   * instances. If static we resolve it now, otherwise it
   * needs to be resolved at build time with actual data.
   */

  checkComponent: function () {
    this.componentState = UNRESOLVED
    var options = this.vm.$options
    var id = _.checkComponent(this.el, options)
    if (!id) {
      // default constructor
      this.Ctor = _.Vue
      // inline repeats should inherit
      this.inherit = true
      // important: transclude with no options, just
      // to ensure block start and block end
      this.template = compiler.transclude(this.template)
      var copy = _.extend({}, options)
      copy._asComponent = false
      this._linkFn = compiler.compile(this.template, copy)
    } else {
      this.Ctor = null
      this.asComponent = true
      // check inline-template
      if (this._checkParam('inline-template') !== null) {
        // extract inline template as a DocumentFragment
        this.inlineTemplate = _.extractContent(this.el, true)
      }
      var tokens = textParser.parse(id)
      if (tokens) {
        // dynamic component to be resolved later
        var ctorExp = textParser.tokensToExp(tokens)
        this.ctorGetter = expParser.parse(ctorExp).get
      } else {
        // static
        this.componentId = id
        this.pendingData = null
      }
    }
  },

  resolveComponent: function () {
    this.componentState = PENDING
    this.vm._resolveComponent(this.componentId, _.bind(function (Ctor) {
      if (this.componentState === ABORTED) {
        return
      }
      this.Ctor = Ctor
      this.componentState = RESOLVED
      this.realUpdate(this.pendingData)
      this.pendingData = null
    }, this))
  },

    /**
   * Resolve a dynamic component to use for an instance.
   * The tricky part here is that there could be dynamic
   * components depending on instance data.
   *
   * @param {Object} data
   * @param {Object} meta
   * @return {Function}
   */

  resolveDynamicComponent: function (data, meta) {
    // create a temporary context object and copy data
    // and meta properties onto it.
    // use _.define to avoid accidentally overwriting scope
    // properties.
    var context = Object.create(this.vm)
    var key
    for (key in data) {
      _.define(context, key, data[key])
    }
    for (key in meta) {
      _.define(context, key, meta[key])
    }
    var id = this.ctorGetter.call(context, context)
    var Ctor = _.resolveAsset(this.vm.$options, 'components', id)
    _.assertAsset(Ctor, 'component', id)
    if (!Ctor.options) {
      _.warn(
        'Async resolution is not supported for v-repeat ' +
        '+ dynamic component. (component: ' + id + ')'
      )
      return _.Vue
    }
    return Ctor
  },

  /**
   * Update.
   * This is called whenever the Array mutates. If we have
   * a component, we might need to wait for it to resolve
   * asynchronously.
   *
   * @param {Array|Number|String} data
   */

  update: function (data) {
    if (this.componentId) {
      var state = this.componentState
      if (state === UNRESOLVED) {
        this.pendingData = data
        // once resolved, it will call realUpdate
        this.resolveComponent()
      } else if (state === PENDING) {
        this.pendingData = data
      } else if (state === RESOLVED) {
        this.realUpdate(data)
      }
    } else {
      this.realUpdate(data)
    }
  },

  /**
   * The real update that actually modifies the DOM.
   *
   * @param {Array|Number|String} data
   */

  realUpdate: function (data) {
    this.vms = this.diff(data, this.vms)
    // update v-ref
    if (this.refID) {
      this.vm.$[this.refID] = this.converted
        ? toRefObject(this.vms)
        : this.vms
    }
    if (this.elId) {
      this.vm.$$[this.elId] = this.vms.map(function (vm) {
        return vm.$el
      })
    }
  },

  /**
   * Diff, based on new data and old data, determine the
   * minimum amount of DOM manipulations needed to make the
   * DOM reflect the new data Array.
   *
   * The algorithm diffs the new data Array by storing a
   * hidden reference to an owner vm instance on previously
   * seen data. This allows us to achieve O(n) which is
   * better than a levenshtein distance based algorithm,
   * which is O(m * n).
   *
   * @param {Array} data
   * @param {Array} oldVms
   * @return {Array}
   */

  diff: function (data, oldVms) {
    var idKey = this.idKey
    var converted = this.converted
    var start = this.start
    var end = this.end
    var inDoc = _.inDoc(start)
    var alias = this.arg
    var init = !oldVms
    var vms = new Array(data.length)
    var obj, raw, vm, i, l, primitive
    // First pass, go through the new Array and fill up
    // the new vms array. If a piece of data has a cached
    // instance for it, we reuse it. Otherwise build a new
    // instance.
    for (i = 0, l = data.length; i < l; i++) {
      obj = data[i]
      raw = converted ? obj.$value : obj
      primitive = !isObject(raw)
      vm = !init && this.getVm(raw, i, converted ? obj.$key : null)
      if (vm) { // reusable instance
        vm._reused = true
        vm.$index = i // update $index
        // update data for track-by or object repeat,
        // since in these two cases the data is replaced
        // rather than mutated.
        if (idKey || converted || primitive) {
          if (alias) {
            vm[alias] = raw
          } else if (_.isPlainObject(raw)) {
            vm.$data = raw
          } else {
            vm.$value = raw
          }
        }
      } else { // new instance
        vm = this.build(obj, i, true)
        vm._reused = false
      }
      vms[i] = vm
      // insert if this is first run
      if (init) {
        vm.$before(end)
      }
    }
    // if this is the first run, we're done.
    if (init) {
      return vms
    }
    // Second pass, go through the old vm instances and
    // destroy those who are not reused (and remove them
    // from cache)
    var removalIndex = 0
    var totalRemoved = oldVms.length - vms.length
    for (i = 0, l = oldVms.length; i < l; i++) {
      vm = oldVms[i]
      if (!vm._reused) {
        this.uncacheVm(vm)
        vm.$destroy(false, true) // defer cleanup until removal
        this.remove(vm, removalIndex++, totalRemoved, inDoc)
      }
    }
    // final pass, move/insert new instances into the
    // right place.
    var targetPrev, prevEl, currentPrev
    var insertionIndex = 0
    for (i = 0, l = vms.length; i < l; i++) {
      vm = vms[i]
      // this is the vm that we should be after
      targetPrev = vms[i - 1]
      prevEl = targetPrev
        ? targetPrev._staggerCb
          ? targetPrev._staggerAnchor
          : targetPrev._blockEnd || targetPrev.$el
        : start
      if (vm._reused && !vm._staggerCb) {
        currentPrev = findPrevVm(vm, start, this.id)
        if (currentPrev !== targetPrev) {
          this.move(vm, prevEl)
        }
      } else {
        // new instance, or still in stagger.
        // insert with updated stagger index.
        this.insert(vm, insertionIndex++, prevEl, inDoc)
      }
      vm._reused = false
    }
    return vms
  },

  /**
   * Build a new instance and cache it.
   *
   * @param {Object} data
   * @param {Number} index
   * @param {Boolean} needCache
   */

  build: function (data, index, needCache) {
    var meta = { $index: index }
    if (this.converted) {
      meta.$key = data.$key
    }
    var raw = this.converted ? data.$value : data
    var alias = this.arg
    if (alias) {
      data = {}
      data[alias] = raw
    } else if (!isPlainObject(raw)) {
      // non-object values
      data = {}
      meta.$value = raw
    } else {
      // default
      data = raw
    }
    // resolve constructor
    var Ctor = this.Ctor || this.resolveDynamicComponent(data, meta)
    var vm = this.vm.$addChild({
      el: templateParser.clone(this.template),
      data: data,
      inherit: this.inherit,
      template: this.inlineTemplate,
      // repeater meta, e.g. $index, $key
      _meta: meta,
      // mark this as an inline-repeat instance
      _repeat: this.inherit,
      // is this a component?
      _asComponent: this.asComponent,
      // linker cachable if no inline-template
      _linkerCachable: !this.inlineTemplate,
      // transclusion host
      _host: this._host,
      // pre-compiled linker for simple repeats
      _linkFn: this._linkFn,
      // identifier, shows that this vm belongs to this collection
      _repeatId: this.id
    }, Ctor)
    // cache instance
    if (needCache) {
      this.cacheVm(raw, vm, index, this.converted ? meta.$key : null)
    }
    // sync back changes for two-way bindings of primitive values
    var type = typeof raw
    var dir = this
    if (
      this.rawType === 'object' &&
      (type === 'string' || type === 'number')
    ) {
      vm.$watch(alias || '$value', function (val) {
        if (dir.filters) {
          _.warn(
            'You seem to be mutating the $value reference of ' +
            'a v-repeat instance (likely through v-model) ' +
            'and filtering the v-repeat at the same time. ' +
            'This will not work properly with an Array of ' +
            'primitive values. Please use an Array of ' +
            'Objects instead.'
          )
        }
        dir._withLock(function () {
          if (dir.converted) {
            dir.rawValue[vm.$key] = val
          } else {
            dir.rawValue.$set(vm.$index, val)
          }
        })
      })
    }
    return vm
  },

  /**
   * Unbind, teardown everything
   */

  unbind: function () {
    this.componentState = ABORTED
    if (this.refID) {
      this.vm.$[this.refID] = null
    }
    if (this.vms) {
      var i = this.vms.length
      var vm
      while (i--) {
        vm = this.vms[i]
        this.uncacheVm(vm)
        vm.$destroy()
      }
    }
  },

  /**
   * Cache a vm instance based on its data.
   *
   * If the data is an object, we save the vm's reference on
   * the data object as a hidden property. Otherwise we
   * cache them in an object and for each primitive value
   * there is an array in case there are duplicates.
   *
   * @param {Object} data
   * @param {Vue} vm
   * @param {Number} index
   * @param {String} [key]
   */

  cacheVm: function (data, vm, index, key) {
    var idKey = this.idKey
    var cache = this.cache
    var primitive = !isObject(data)
    var id
    if (key || idKey || primitive) {
      id = idKey
        ? idKey === '$index'
          ? index
          : data[idKey]
        : (key || index)
      if (!cache[id]) {
        cache[id] = vm
      } else if (!primitive && idKey !== '$index') {
        _.warn('Duplicate track-by key in v-repeat: ' + id)
      }
    } else {
      id = this.id
      if (data.hasOwnProperty(id)) {
        if (data[id] === null) {
          data[id] = vm
        } else {
          _.warn(
            'Duplicate objects are not supported in v-repeat ' +
            'when using components or transitions.'
          )
        }
      } else {
        _.define(data, id, vm)
      }
    }
    vm._raw = data
  },

  /**
   * Try to get a cached instance from a piece of data.
   *
   * @param {Object} data
   * @param {Number} index
   * @param {String} [key]
   * @return {Vue|undefined}
   */

  getVm: function (data, index, key) {
    var idKey = this.idKey
    var primitive = !isObject(data)
    if (key || idKey || primitive) {
      var id = idKey
        ? idKey === '$index'
          ? index
          : data[idKey]
        : (key || index)
      return this.cache[id]
    } else {
      return data[this.id]
    }
  },

  /**
   * Delete a cached vm instance.
   *
   * @param {Vue} vm
   */

  uncacheVm: function (vm) {
    var data = vm._raw
    var idKey = this.idKey
    var index = vm.$index
    var key = vm.$key
    var primitive = !isObject(data)
    if (idKey || key || primitive) {
      var id = idKey
        ? idKey === '$index'
          ? index
          : data[idKey]
        : (key || index)
      this.cache[id] = null
    } else {
      data[this.id] = null
      vm._raw = null
    }
  },

  /**
   * Pre-process the value before piping it through the
   * filters, and convert non-Array objects to arrays.
   *
   * This function will be bound to this directive instance
   * and passed into the watcher.
   *
   * @param {*} value
   * @return {Array}
   * @private
   */

  _preProcess: function (value) {
    // regardless of type, store the un-filtered raw value.
    this.rawValue = value
    var type = this.rawType = typeof value
    if (!isPlainObject(value)) {
      this.converted = false
      if (type === 'number') {
        value = range(value)
      } else if (type === 'string') {
        value = _.toArray(value)
      }
      return value || []
    } else {
      // convert plain object to array.
      var keys = Object.keys(value)
      var i = keys.length
      var res = new Array(i)
      var key
      while (i--) {
        key = keys[i]
        res[i] = {
          $key: key,
          $value: value[key]
        }
      }
      this.converted = true
      return res
    }
  },

  /**
   * Insert an instance.
   *
   * @param {Vue} vm
   * @param {Number} index
   * @param {Node} prevEl
   * @param {Boolean} inDoc
   */

  insert: function (vm, index, prevEl, inDoc) {
    if (vm._staggerCb) {
      vm._staggerCb.cancel()
      vm._staggerCb = null
    }
    var staggerAmount = this.getStagger(vm, index, null, 'enter')
    if (inDoc && staggerAmount) {
      // create an anchor and insert it synchronously,
      // so that we can resolve the correct order without
      // worrying about some elements not inserted yet
      var anchor = vm._staggerAnchor
      if (!anchor) {
        anchor = vm._staggerAnchor = _.createAnchor('stagger-anchor')
        anchor.__vue__ = vm
      }
      _.after(anchor, prevEl)
      var op = vm._staggerCb = _.cancellable(function () {
        vm._staggerCb = null
        vm.$before(anchor)
        _.remove(anchor)
      })
      setTimeout(op, staggerAmount)
    } else {
      vm.$after(prevEl)
    }
  },

  /**
   * Move an already inserted instance.
   *
   * @param {Vue} vm
   * @param {Node} prevEl
   */

  move: function (vm, prevEl) {
    vm.$after(prevEl, null, false)
  },

  /**
   * Remove an instance.
   *
   * @param {Vue} vm
   * @param {Number} index
   * @param {Boolean} inDoc
   */

  remove: function (vm, index, total, inDoc) {
    if (vm._staggerCb) {
      vm._staggerCb.cancel()
      vm._staggerCb = null
      // it's not possible for the same vm to be removed
      // twice, so if we have a pending stagger callback,
      // it means this vm is queued for enter but removed
      // before its transition started. Since it is already
      // destroyed, we can just leave it in detached state.
      return
    }
    var staggerAmount = this.getStagger(vm, index, total, 'leave')
    if (inDoc && staggerAmount) {
      var op = vm._staggerCb = _.cancellable(function () {
        vm._staggerCb = null
        remove()
      })
      setTimeout(op, staggerAmount)
    } else {
      remove()
    }
    function remove () {
      vm.$remove(function () {
        vm._cleanup()
      })
    }
  },

  /**
   * Get the stagger amount for an insertion/removal.
   *
   * @param {Vue} vm
   * @param {Number} index
   * @param {String} type
   * @param {Number} total
   */

  getStagger: function (vm, index, total, type) {
    type = type + 'Stagger'
    var transition = vm.$el.__v_trans
    var hooks = transition && transition.hooks
    var hook = hooks && (hooks[type] || hooks.stagger)
    return hook
      ? hook.call(vm, index, total)
      : index * this[type]
  }

}

/**
 * Helper to find the previous element that is an instance
 * root node. This is necessary because a destroyed vm's
 * element could still be lingering in the DOM before its
 * leaving transition finishes, but its __vue__ reference
 * should have been removed so we can skip them.
 *
 * If this is a block repeat, we want to make sure we only
 * return vm that is bound to this v-repeat. (see #929)
 *
 * @param {Vue} vm
 * @param {Comment|Text} anchor
 * @return {Vue}
 */

function findPrevVm (vm, anchor, id) {
  var el = vm.$el.previousSibling
  while (
    (!el.__vue__ || el.__vue__.$options._repeatId !== id) &&
    el !== anchor
  ) {
    el = el.previousSibling
  }
  return el.__vue__
}

/**
 * Create a range array from given number.
 *
 * @param {Number} n
 * @return {Array}
 */

function range (n) {
  var i = -1
  var ret = new Array(n)
  while (++i < n) {
    ret[i] = i
  }
  return ret
}

/**
 * Convert a vms array to an object ref for v-ref on an
 * Object value.
 *
 * @param {Array} vms
 * @return {Object}
 */

function toRefObject (vms) {
  var ref = {}
  for (var i = 0, l = vms.length; i < l; i++) {
    ref[vms[i].$key] = vms[i]
  }
  return ref
}


text:
package us.fok.lenzenslijper.selectors;

public class EventParticipationSelector extends PaginatedSelector{
}

redpajama_set_name: RedPajamaGithub


text:
@interface OrganizerDataTests : SenTestCase {
@private

}

@end


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="10.1">
	<Story Self="u232d" AppliedTOCStyle="n" TrackChanges="false" StoryTitle="$ID/" AppliedNamedGrid="n">
		<StoryPreference OpticalMarginAlignment="false" OpticalMarginSize="12" FrameType="TextFrameType" StoryOrientation="Horizontal" StoryDirection="LeftToRightDirection" />
		<InCopyExportOption IncludeGraphicProxies="true" IncludeAllResources="false" />
		<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/NormalParagraphStyle" Justification="CenterJustified">
			<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]" FillColor="Color/C=62 M=38 Y=29 K=69">
				<Content><?ACE 18?></Content>
			</CharacterStyleRange>
		</ParagraphStyleRange>
	</Story>
</idPkg:Story>


text:
package org.onosproject.athena.trigger;

import org.onosproject.core.ApplicationId;

import java.util.HashMap;

/**
 * Created by seunghyeon on 11/9/15.
 */
public class TriggerOnlineEventTable {
    private ApplicationId applicationId;
    private HashMap<String, Long> requestFeatures = new HashMap<>();

    public TriggerOnlineEventTable(ApplicationId applicationId,
                                   HashMap<String, Long> requestFeatures) {
        this.applicationId = applicationId;
        this.requestFeatures = requestFeatures;
    }

    public ApplicationId getApplicationId() {
        return applicationId;
    }

    public HashMap<String, Long> getRequestFeatures() {
        return requestFeatures;
    }
}


text:
package com.thinkgem.jeesite.modules.weixin.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thinkgem.jeesite.common.mapper.JsonMapper;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 模板消息Entity
 * @author mawj
 * @version 2016-11-11
 */
public class WeixinTemplate extends DataEntity<WeixinTemplate> {

	private static final long serialVersionUID = 1L;
	private String name;		// 模板名称
	private String openid;		// 用户
	private String templateId;		// 模板ID
	private String status;		// 状态
	private String msg;		// 消息内容
	private String url;		// 跳转链接
	private Date successDate;		// 送达时间

	//发货通知模板字段
	private String title;//标题
	private String deliverName;//快递公司
	private String orderName;//快递单号
	private String productName;//商品名称
	private String productCount;//商品数量
	private String remark;//备注
	@JsonIgnore
	private String jsonData;

	public WeixinTemplate() {
		super();
	}

	public WeixinTemplate(String id){
		super(id);
	}

	@Length(min=0, max=45, message="模板名称长度必须介于 0 和 45 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Length(min=0, max=45, message="用户长度必须介于 0 和 45 之间")
	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	@Length(min=0, max=45, message="模板ID长度必须介于 0 和 45 之间")
	public String getTemplateId() {
		return templateId;
	}

	public void setTemplateId(String templateId) {
		this.templateId = templateId;
	}

	@Length(min=0, max=1, message="状态长度必须介于 0 和 1 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Length(min=0, max=255, message="消息内容长度必须介于 0 和 255 之间")
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getSuccessDate() {
		return successDate;
	}

	public void setSuccessDate(Date successDate) {
		this.successDate = successDate;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public String getDeliverName() {
		return deliverName;
	}

	public void setDeliverName(String deliverName) {
		this.deliverName = deliverName;
	}

	public String getOrderName() {
		return orderName;
	}

	public void setOrderName(String orderName) {
		this.orderName = orderName;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getProductCount() {
		return productCount;
	}

	public void setProductCount(String productCount) {
		this.productCount = productCount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getJsonData() {
		return JsonMapper.toJsonString(this);
	}

	public void setJsonData(String jsonData) {
		this.jsonData = jsonData;
	}
}


text:
<?php

namespace Andskur\Laracrypto\Ethereum;

use GuzzleHttp\Client;

/**
 * Class EthereumContainer.
 */
class EthereumContainer
{
    /**
     * @var int
     */
    private $port;
    /**
     * @var string
     */
    private $uri;

    /**
     * Construct Ethereum RPC access from config file.
     */
    public function __construct()
    {
        $this->port = '8545';
        $this->uri = 'http://localhost:8545';
    }

    /**
     * Retrieve the JSON response from the RPC client.
     *
     * @param string $method
     * @param array  $params
     *
     * @return mixed
     */
    private function getJson($method, $params)
    {
        $client = new Client([
            'base_uri' => $this->uri,
        ]);

        $data = $client->post(
            '',
            [
                'jsonrpc' => 2.0,
                'method'  => $method,
                'params'  => $params,
            ]
        );

        return \GuzzleHttp\json_decode(
            $data->getBody()
                 ->getContents()
        );
    }

    /**
     * List of all wallet addresses.
     *
     * @return mixed
     */
    public function addresses()
    {
        $results = $this->getJson(
            'eth_accounts',
            null
        );

        return $results->result;
    }

    /**
     * Check a single address' balance.
     *
     * @param string $address
     * @param string $tag
     *
     * @return mixed
     */
    public function addressBalance($address, $tag = 'latest')
    {
        $results = $this->getJson(
            'eth_getBalance',
            [
                $address,
                $tag,
            ]
        );

        return $results->result;
    }

    /**
     * Generate a new address.
     *
     * @param string $passphrase
     *
     * @return mixed
     */
    public function newAddress($passphrase)
    {
        $results = $this->getJson(
            'personal_newAccount',
            [
                $passphrase,
            ]
        );

        return $results->result;
    }

    /**
     * Lock address.
     *
     * @param string $address
     *
     * @return mixed
     */
    public function lockAddress($address)
    {
        $results = $this->getJson(
            'personal_lockAccount',
            [
                $address,
            ]
        );

        return $results->result;
    }

    /**
     * Unlock address.
     *
     * @param string $address
     * @param string $passphrase
     * @param int    $duration
     *
     * @return mixed
     */
    public function unlockAddress($address, $passphrase, $duration = 300)
    {
        $results = $this->getJson(
            'personal_unlockAccount',
            [
                $address,
                $passphrase,
                $duration,
            ]
        );

        return $results->result;
    }

    /**
     * Send payment.
     *
     * @param string      $to_address
     * @param string|null $value
     * @param string      $from_address
     * @param string|null $gas
     * @param string|null $gasPrice
     * @param string|null $data
     *
     * @return mixed
     */
    public function send(
        $to_address,
        $value,
        $from_address,
        $gas = null,
        $gasPrice = null,
        $data = null
    ) {
        $transactionData = [
            'to'       => $to_address,
            'value'    => $value,
            'from'     => $from_address,
            'gas'      => $gas,
            'gasPrice' => $gasPrice,
            'data'     => $data,
        ];

        $results = $this->getJson(
            'eth_sendTransaction',
            [
                $transactionData,
            ]
        );

        return $results->result;
    }
}


text:
INSERT INTO Logs(LogDate, LogText) VALUES ('1990-01-01', 'Sample log ');
--Insert records in the format Date | SampleLog1, Date | SampleLog2...
DECLARE @Counter int = 0
WHILE (SELECT COUNT(*) FROM Logs) < 11000000
BEGIN
INSERT INTO Logs(LogDate, LogText)
SELECT DATEADD(MONTH, @Counter + 3, LogDate), LogText + CONVERT(nvarchar, @Counter) FROM Logs
SET @Counter = @Counter + 1
END
--Empty the SQL Server cache
CHECKPOINT; DBCC DROPCLEANBUFFERS;
--Test search by date before adding index
SELECT LogText FROM Logs WHERE LogDate
BETWEEN CONVERT(datetime, '1990-01-01') AND CONVERT(datetime, '1995-01-01');


text:
package com.amazonaws.services.apigateway.model.transform;

import java.util.Map;
import java.util.Map.Entry;
import java.math.*;
import java.nio.ByteBuffer;

import com.amazonaws.services.apigateway.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * Model JSON Unmarshaller
 */
public class ModelJsonUnmarshaller implements
        Unmarshaller<Model, JsonUnmarshallerContext> {

    public Model unmarshall(JsonUnmarshallerContext context) throws Exception {
        Model model = new Model();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL)
            return null;

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("id", targetDepth)) {
                    context.nextToken();
                    model.setId(context.getUnmarshaller(String.class)
                            .unmarshall(context));
                }
                if (context.testExpression("name", targetDepth)) {
                    context.nextToken();
                    model.setName(context.getUnmarshaller(String.class)
                            .unmarshall(context));
                }
                if (context.testExpression("description", targetDepth)) {
                    context.nextToken();
                    model.setDescription(context.getUnmarshaller(String.class)
                            .unmarshall(context));
                }
                if (context.testExpression("schema", targetDepth)) {
                    context.nextToken();
                    model.setSchema(context.getUnmarshaller(String.class)
                            .unmarshall(context));
                }
                if (context.testExpression("contentType", targetDepth)) {
                    context.nextToken();
                    model.setContentType(context.getUnmarshaller(String.class)
                            .unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null
                        || context.getLastParsedParentElement().equals(
                                currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return model;
    }

    private static ModelJsonUnmarshaller instance;

    public static ModelJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new ModelJsonUnmarshaller();
        return instance;
    }
}


text:
#ifndef vnsw_agent_interface_os_params_h
#define vnsw_agent_interface_os_params_h

#include <string>
#include <boost/optional.hpp>
#include <boost/uuid/uuid.hpp>
#include <net/mac_address.h>

struct InterfaceOsParams {
    // Used on Windows as operating system identifier's type
    typedef boost::uuids::uuid IfGuid;

    InterfaceOsParams() {}
    InterfaceOsParams(const std::string &name, size_t os_index, bool state) :
        name_(name), os_index_(os_index), os_oper_state_(state) {}

    std::string name_;
    MacAddress mac_;
    size_t os_index_;
    bool os_oper_state_;
    boost::optional<IfGuid> os_guid_;
};

#endif // vnsw_agent_interface_os_params_h


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
	JBoss, Home of Professional Open Source Copyright 2010, Red Hat
	Middleware LLC, and others contributors as indicated by the @authors
	tag. All rights reserved. See the copyright.txt in the distribution
	for a full listing of individual contributors. This copyrighted
	material is made available to anyone wishing to use, modify, copy, or
	redistribute it subject to the terms and conditions of the GNU Lesser
	General Public License, v. 2.1. This program is distributed in the
	hope that it will be useful, but WITHOUT A WARRANTY; without even the
	implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
	PURPOSE. See the GNU Lesser General Public License for more details.
	You should have received a copy of the GNU Lesser General Public
	License, v.2.1 along with this distribution; if not, write to the Free
	Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
	02110-1301, USA.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <parent>
    <groupId>org.jboss.narayana.rts</groupId>
    <artifactId>restat</artifactId>
    <version>5.5.1.Final-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>restat-util</artifactId>
  <packaging>jar</packaging>
  <name>Narayana: restat util</name>
  <description>Utility methods to make it easy to conform to the RESTAT specification</description>

  <repositories>
    <!-- Jersey -->
    <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Repository for Maven</name>
      <url>http://download.java.net/maven/2/</url>
      <layout>default</layout>
    </repository>
    <!-- end Jersey -->
  </repositories>
  <dependencies>
    <dependency>
      <groupId>org.jboss.narayana.arjunacore</groupId>
      <artifactId>arjunacore</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${version.log4j}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>com.sun.jmx</groupId>
          <artifactId>jmxri</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.jdmk</groupId>
          <artifactId>jmxtools</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.jms</groupId>
          <artifactId>jms</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.mail</groupId>
          <artifactId>mail</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${version.junit}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
      <version>${version.javax.ws.rs-api}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <version>${version.org.jboss.resteasy}</version>
      <scope>provided</scope>
      <!-- filter out unwanted jars -->
      <exclusions>
        <exclusion>
          <groupId>commons-httpclient</groupId>
          <artifactId>commons-httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <version>${version.org.jboss.logging.jboss-logging}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <inherited>false</inherited>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>create_sources_jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <phase>prepare-package</phase>
          </execution>
        </executions>
        <configuration>
          <forceCreation>true</forceCreation>
          <includePom>true</includePom>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
      <profile>
          <id>release</id>
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-install-plugin</artifactId>
                      <executions>
                          <execution>
                              <id>default-install</id>
                              <phase>install</phase>
                          </execution>
                      </executions>
                      <inherited>false</inherited>
                  </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>create_javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>prepare-package</phase>
              </execution>
            </executions>
            <configuration>
              <detectOfflineLinks>false</detectOfflineLinks>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
namespace FBi
{

/// HTTP server class
class LIBHTTPSERVER_DECL HttpServer : public IServer, private boost::noncopyable
{
typedef boost::shared_ptr<boost::thread> ThreadPtr;
typedef boost::shared_ptr<HttpConnection> NetworkConnectionPtr;

/// Struct to store the information of thread and connection.
struct ThreadConnection
{
	ThreadPtr thread;
	NetworkConnectionPtr connection;
};

typedef std::map< boost::thread::id, ThreadConnection > ThreadIdMap;
typedef std::map< boost::thread::id, ThreadConnection >::iterator ThreadIdMapIter;

public:
	HttpServer(const boost::shared_ptr<IHttpRequestDispatcher>&, const std::string&, int, const SSLContextInfo&, int = 511);
	~HttpServer();

	void StartServer();
	void StopServer();
	void RegisterMeetMaxConnectionCallback(const MeetMaxConnectionNumCallback& callback);

protected:
	HttpConnection* create_connection();

private:
	void set_ssl_context_info(const SSLContextInfo&, boost::asio::ssl::context&);
	void handle_accept(const boost::system::error_code&);
	void thread_exit_callback_func();
	std::string get_ssl_private_key_password() const;

private:
	/// The HTTP request dispatcher.
	boost::shared_ptr<IHttpRequestDispatcher> http_request_dispatcher_;

	/// The acceptor of ASIO.
	boost::asio::ip::tcp::acceptor acceptor_;

	/// Accept callback function.
	AcceptorCallback accept_callback_;

	/// The maximum connection number.
	int max_connection_num_;

	/// Network connection.
	NetworkConnectionPtr new_connection_;

	/// Thread id, thread and connection  map.
	ThreadIdMap thread_id_map_;

	/// Protect the thread_id_map_ and new_connection_ etc. and also for wait condition.
	boost::mutex mutex_;

	/// Flag to indicate the server is started or not.
	bool is_started_;

	/// Password of private key file for SSL connection.
	std::string ssl_private_key_password_;

	/// The endpoint that server binds.
	boost::asio::ip::tcp::endpoint current_endpoint_;

	/// The flag to indicate the server is handling the "Start Server" now.
	bool is_processing_start_server_;

	/// The counter for the number of connection.
	unsigned int connection_counter_;

	/// The callback function for the max number of connection is met.
	MeetMaxConnectionNumCallback meet_max_connection_callback_;

	///custom memory allocator
	sb_allocator allocator_;
};

} // namespace FBi

#endif


text:
package org.hisp.dhis.dataelement.hibernate;

import java.util.List;

import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.common.DataDimensionType;
import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.dataelement.CategoryStore;
import org.hisp.dhis.dataelement.DataElementCategory;

/**
 * @author Lars Helge Overland
 */
public class HibernateCategoryStore
    extends HibernateIdentifiableObjectStore<DataElementCategory>
    implements CategoryStore
{
    @Override
    @SuppressWarnings("unchecked")
    public List<DataElementCategory> getCategoriesByDimensionType( DataDimensionType dataDimensionType )
    {
        return getSharingCriteria( Restrictions.eq( "dataDimensionType", dataDimensionType ) ).list();
    }

    @Override
    @SuppressWarnings("unchecked")
    public List<DataElementCategory> getCategories( DataDimensionType dataDimensionType, boolean dataDimension )
    {
        return getSharingCriteria(
            Restrictions.eq( "dataDimensionType", dataDimensionType ),
            Restrictions.eq( "dataDimension", dataDimension ) ).list();
    }

    @Override
    @SuppressWarnings("unchecked")
    public List<DataElementCategory> getCategoriesNoAcl( DataDimensionType dataDimensionType, boolean dataDimension )
    {
        return getCriteria(
            Restrictions.eq( "dataDimensionType", dataDimensionType ),
            Restrictions.eq( "dataDimension", dataDimension ) ).list();
    }
}


text:
#region Usings

using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Collections.Generic;
using System.Net.NetworkInformation;
using System.Threading.Tasks;
using System.Diagnostics;

using org.GraphDefined.Vanaheimr.Illias;

#endregion

namespace org.GraphDefined.Vanaheimr.Hermod.DNS
{

    /// <summary>
    /// A DNS client.
    /// </summary>
    public class DNSClient
    {

        #region Data

        private readonly Dictionary<UInt16, ConstructorInfo>  _RRLookup;
        private readonly DNSCache                             dnsCache;

        #endregion

        #region Properties

        /// <summary>
        /// The DNS servers used by this DNS client.
        /// </summary>
        public IEnumerable<IPSocket>  DNSServers          { get; }

        /// <summary>
        /// The DNS query timeout.
        /// </summary>
        public TimeSpan               QueryTimeout        { get; set; }

        /// <summary>
        /// Whether DNS recursion is desired.
        /// </summary>
        public Boolean                RecursionDesired    { get; set; }

        #endregion

        #region Constructor(s)

        #region DNSClient(DNSServer)

        /// <summary>
        /// Create a new DNS resolver client.
        /// </summary>
        /// <param name="DNSServer">The DNS server to query.</param>
        public DNSClient(IIPAddress DNSServer)

            : this(new IPSocket[] { new IPSocket(DNSServer, IPPort.DNS) })

        { }

        #endregion

        #region DNSClient(DNSServer, Port)

        /// <summary>
        /// Create a new DNS resolver client.
        /// </summary>
        /// <param name="DNSServer">The DNS server to query.</param>
        /// <param name="Port">The IP port of the DNS server to query.</param>
        public DNSClient(IIPAddress DNSServer, IPPort Port)

            : this(new IPSocket[] { new IPSocket(DNSServer, Port) })

        { }

        #endregion

        #region DNSClient(DNSServers)

        /// <summary>
        /// Create a new DNS resolver client.
        /// </summary>
        /// <param name="DNSServers">A list of DNS servers to query.</param>
        public DNSClient(IEnumerable<IIPAddress> DNSServers)

            : this(DNSServers.Select(IPAddress => new IPSocket(IPAddress, IPPort.DNS)))

        { }

        #endregion

        #region DNSClient(DNSServers, Port)

        /// <summary>
        /// Create a new DNS resolver client.
        /// </summary>
        /// <param name="DNSServers">A list of DNS servers to query.</param></param>
        /// <param name="Port">The common IP port of the DNS servers to query.</param>
        public DNSClient(IEnumerable<IIPAddress> DNSServers, IPPort Port)

            : this(DNSServers.Select(IPAddress => new IPSocket(IPAddress, Port)))

        { }

        #endregion

        #region DNSClient(SearchForIPv4DNSServers = true, SearchForIPv6DNSServers = true)

        /// <summary>
        /// Create a new DNS resolver client.
        /// </summary>
        /// <param name="SearchForIPv4DNSServers">If yes, the DNS client will query a list of DNS servers from the IPv4 network configuration.</param>
        /// <param name="SearchForIPv6DNSServers">If yes, the DNS client will query a list of DNS servers from the IPv6 network configuration.</param>
        public DNSClient(Boolean SearchForIPv4DNSServers = true,
                         Boolean SearchForIPv6DNSServers = true)

            : this(new IPSocket[0],
                   SearchForIPv4DNSServers,
                   SearchForIPv6DNSServers)

        { }

        #endregion

        #region DNSClient(ManualDNSServers, SearchForIPv4DNSServers = true, SearchForIPv6DNSServers = true)

        /// <summary>
        /// Create a new DNS resolver client.
        /// </summary>
        /// <param name="ManualDNSServers">A list of manually configured DNS servers to query.</param>
        /// <param name="SearchForIPv4DNSServers">If yes, the DNS client will query a list of DNS servers from the IPv4 network configuration.</param>
        /// <param name="SearchForIPv6DNSServers">If yes, the DNS client will query a list of DNS servers from the IPv6 network configuration.</param>
        public DNSClient(IEnumerable<IPSocket>  ManualDNSServers,
                         Boolean                SearchForIPv4DNSServers = false,
                         Boolean                SearchForIPv6DNSServers = false)

        {

            this.dnsCache         = new DNSCache();
            this.RecursionDesired  = true;
            this.QueryTimeout      = TimeSpan.FromSeconds(23.5);

            var _DNSServers        = new List<IPSocket>(ManualDNSServers);

            #region Search for IPv4/IPv6 DNS Servers...

            if (SearchForIPv4DNSServers)
                _DNSServers.AddRange(NetworkInterface.
                                         GetAllNetworkInterfaces().
                                         Where     (NI        => NI.OperationalStatus == OperationalStatus.Up).
                                         SelectMany(NI        => NI.GetIPProperties().DnsAddresses).
                                         Where     (IPAddress => IPAddress.AddressFamily == AddressFamily.InterNetwork).
                                         Select    (IPAddress => new IPSocket(new IPv4Address(IPAddress), IPPort.DNS)));

            if (SearchForIPv6DNSServers)
                _DNSServers.AddRange(NetworkInterface.
                                         GetAllNetworkInterfaces().
                                         Where     (NI        => NI.OperationalStatus == OperationalStatus.Up).
                                         SelectMany(NI        => NI.GetIPProperties().DnsAddresses).
                                         Where     (IPAddress => IPAddress.AddressFamily == AddressFamily.InterNetworkV6).
                                         Select    (IPAddress => new IPSocket(new IPv6Address(IPAddress), IPPort.DNS)));

            #endregion

            this.DNSServers        = _DNSServers;

            #region Reflect ResourceRecordTypes

            this._RRLookup          = new Dictionary<UInt16, ConstructorInfo>();

            FieldInfo        TypeIdField;
            ConstructorInfo  Constructor;

            foreach (var _ActualType in typeof(ADNSResourceRecord).
                                            Assembly.GetTypes().
                                            Where(type => type.IsClass &&
                                                 !type.IsAbstract &&
                                                  type.IsSubclassOf(typeof(ADNSResourceRecord))))
            {

                TypeIdField = _ActualType.GetField("TypeId");

                if (TypeIdField == null)
                    throw new ArgumentException("Constant field 'TypeId' of type '" + _ActualType.Name + "' was not found!");

                Constructor = _ActualType.GetConstructor(new Type[2] { typeof(String), typeof(Stream) });

                if (Constructor == null)
                    throw new ArgumentException("Constructor<String, Stream> of type '" + _ActualType.Name + "' was not found!");

                _RRLookup.Add((UInt16) TypeIdField.GetValue(_ActualType), Constructor);

            }

            #endregion

        }

        #endregion

        #endregion

        #region (private) ReadResponse(Origin, ExpectedTransactionId, DNSResponseStream)

        private DNSInfo ReadResponse(IPSocket  Origin,
                                     Int32     ExpectedTransactionId,
                                     Stream    DNSResponseStream)
        {

            #region DNS Header

            var requestId       = ((DNSResponseStream.ReadByte() & Byte.MaxValue) << 8) + (DNSResponseStream.ReadByte() & Byte.MaxValue);

            if (ExpectedTransactionId != requestId)
                //throw new Exception("Security Alert: Mallory might send us faked DNS replies! [" + ExpectedTransactionId + " != " + requestId + "]");
                return DNSInfo.Invalid(Origin,
                                       requestId);

            var Byte2           = DNSResponseStream.ReadByte();
            var IS              = (Byte2 & 128) == 128;
            var OpCode          = (Byte2 >> 3 & 15);
            var AA              = (Byte2 & 4) == 4;
            var TC              = (Byte2 & 2) == 2;
            var RD              = (Byte2 & 1) == 1;

            var Byte3           = DNSResponseStream.ReadByte();
            var RA              = (Byte3 & 128) == 128;
            var Z               = (Byte3 & 1);    //reserved, not used
            var ResponseCode    = (DNSResponseCodes) (Byte3 & 15);

            var QuestionCount   = ((DNSResponseStream.ReadByte() & Byte.MaxValue) << 8) | (DNSResponseStream.ReadByte() & Byte.MaxValue);
            var AnswerCount     = ((DNSResponseStream.ReadByte() & Byte.MaxValue) << 8) | (DNSResponseStream.ReadByte() & Byte.MaxValue);
            var AuthorityCount  = ((DNSResponseStream.ReadByte() & Byte.MaxValue) << 8) | (DNSResponseStream.ReadByte() & Byte.MaxValue);
            var AdditionalCount = ((DNSResponseStream.ReadByte() & Byte.MaxValue) << 8) | (DNSResponseStream.ReadByte() & Byte.MaxValue);

            #endregion

            //ToDo: Does this make sense?
            #region Process Questions

            DNSResponseStream.Seek(12, SeekOrigin.Begin);

            for (var i = 0; i < QuestionCount; ++i) {
                var questionName  = DNSTools.ExtractName(DNSResponseStream);
                var typeId        = (UInt16)          ((DNSResponseStream.ReadByte() & Byte.MaxValue) << 8 | DNSResponseStream.ReadByte() & Byte.MaxValue);
                var classId       = (DNSQueryClasses) ((DNSResponseStream.ReadByte() & Byte.MaxValue) << 8 | DNSResponseStream.ReadByte() & Byte.MaxValue);
            }

            #endregion

            var answers            = new List<ADNSResourceRecord>();
            var authorities        = new List<ADNSResourceRecord>();
            var additionalRecords  = new List<ADNSResourceRecord>();

            for (var i = 0; i < AnswerCount; ++i)
                answers.          Add(ReadResourceRecord(DNSResponseStream));

            for (var i = 0; i < AuthorityCount; ++i)
                authorities.      Add(ReadResourceRecord(DNSResponseStream));

            for (var i = 0; i < AdditionalCount; ++i)
                additionalRecords.Add(ReadResourceRecord(DNSResponseStream));

            return new DNSInfo(Origin,
                               requestId,
                               AA,
                               TC,
                               RD,
                               RA,
                               ResponseCode,

                               answers,
                               authorities,
                               additionalRecords,

                               true,
                               false,
                               TimeSpan.Zero);

        }

        #endregion

        #region (private) ReadResourceRecord(DNSStream)

        private ADNSResourceRecord ReadResourceRecord(Stream DNSStream)
        {

            var ResourceName  = DNSTools.ExtractName(DNSStream);
            var TypeId        = (UInt16) ((DNSStream.ReadByte() & Byte.MaxValue) << 8 | DNSStream.ReadByte() & Byte.MaxValue);

            ConstructorInfo Constructor;

            if (_RRLookup.TryGetValue(TypeId, out Constructor))
                return (ADNSResourceRecord) Constructor.Invoke(new Object[2] {
                                                                   ResourceName,
                                                                   DNSStream
                                                               });

            Debug.WriteLine("Unknown DNS resource record '" + TypeId + "' for '" + ResourceName + "' received!");

            return null;

        }

        #endregion

        #region (private) AddToCache(DomainName, DNSInformation)

        /// <summary>
        /// Add a DNS cache entry.
        /// </summary>
        /// <param name="DomainName">The domain name.</param>
        /// <param name="DNSInformation">The DNS information</param>
        private void AddToCache(String    DomainName,
                                DNSInfo   DNSInformation)
        {

            if (DomainName.IsNullOrEmpty() || DNSInformation == null)
                return;

            dnsCache.Add(DomainName,
                          DNSInformation);

        }

        #endregion

        #region AddToCache(DomainName, ARecord)

        /// <summary>
        /// Add a DNS cache entry.
        /// </summary>
        /// <param name="DomainName">The domain name.</param>
        /// <param name="ARecord">A DNS record</param>
        public void AddToCache(String  DomainName,
                               A       ARecord)
        {

            if (DomainName.IsNullOrEmpty() || ARecord == null)
                return;

            dnsCache.Add(DomainName,
                          IPSocket.LocalhostV4(IPPort.DNS),
                          ARecord);

        }

        #endregion

        #region Query(DomainName, params ResourceRecordTypes)

        public Task<DNSInfo> Query(String           DomainName,
                                   params UInt16[]  ResourceRecordTypes)
        {

            #region Initial checks

            if (DomainName.IsNullOrEmpty() || !DNSServers.Any())
                return Task.FromResult(new DNSInfo(Origin:               new IPSocket(IPv4Address.Localhost,
                                                                                IPPort.DNS),
                                                   QueryId:              0,
                                                   IsAuthorativeAnswer:  false,
                                                   IsTruncated:          false,
                                                   RecursionDesired:     true,
                                                   RecursionAvailable:   false,
                                                   ResponseCode:         DNSResponseCodes.NameError,
                                                   Answers:              Array.Empty<ADNSResourceRecord>(),
                                                   Authorities:          Array.Empty<ADNSResourceRecord>(),
                                                   AdditionalRecords:    Array.Empty<ADNSResourceRecord>(),
                                                   IsValid:              true,
                                                   IsTimeout:            false,
                                                   Timeout:              QueryTimeout));

            if (ResourceRecordTypes.Length == 0)
                ResourceRecordTypes = new UInt16[1] { 255 };

            #endregion

            #region Try to get answers from the DNS cache

            var cachedResults = dnsCache.GetDNSInfo(DomainName);

            if (cachedResults is not null)
            {

                var resourceRecords = cachedResults.Answers.
                                          Where  (resourceRecord => ResourceRecordTypes.Contains(resourceRecord.Type)).
                                          ToArray();

                if (resourceRecords.Any())
                    return Task.FromResult(cachedResults);

            }

            #endregion

            var dnsQuery = new DNSQuery(DomainName,
                                        RecursionDesired,
                                        ResourceRecordTypes);

            #region Query all DNS server(s) in parallel...

            var allDNSServerRequests = DNSServers.Select(dnsServer =>

                Task<DNSInfo>.Factory.StartNew(() => {

                    var data = new Byte[512];
                    Int32  length;
                    Socket? socket = null;

                    try
                    {

                        var serverAddress  = System.Net.IPAddress.Parse(dnsServer.IPAddress.ToString());
                        var endPoint       = (EndPoint) new IPEndPoint(serverAddress, dnsServer.Port.ToInt32());
                        socket             = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
                        socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout,    (Int32) QueryTimeout.TotalMilliseconds);
                        socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, (Int32) QueryTimeout.TotalMilliseconds);
                        socket.Connect(endPoint);
                        socket.SendTo(dnsQuery.Serialize(), endPoint);

                        length = socket.ReceiveFrom(data, ref endPoint);

                    }
                    catch (SocketException se)
                    {

                        if (se.SocketErrorCode == SocketError.AddressFamilyNotSupported)
                            return new DNSInfo(Origin:               new IPSocket(dnsServer.IPAddress,
                                                                                dnsServer.Port),
                                               QueryId:              dnsQuery.TransactionId,
                                               IsAuthorativeAnswer:  false,
                                               IsTruncated:          false,
                                               RecursionDesired:     false,
                                               RecursionAvailable:   false,
                                               ResponseCode:         DNSResponseCodes.ServerFailure,
                                               Answers:              Array.Empty<ADNSResourceRecord>(),
                                               Authorities:          Array.Empty<ADNSResourceRecord>(),
                                               AdditionalRecords:    Array.Empty<ADNSResourceRecord>(),
                                               IsValid:              true,
                                               IsTimeout:            false,
                                               Timeout:              QueryTimeout);

                        // A SocketException might be thrown after the timeout was reached!
                        //throw new Exception("DNS server '" + DNSServer + "' did not respond within " + QueryTimeout.TotalSeconds + " seconds!");
                        return DNSInfo.TimedOut(new IPSocket(dnsServer.IPAddress,
                                                             dnsServer.Port),
                                                dnsQuery.TransactionId,
                                                QueryTimeout);

                    }
                    catch (Exception)
                    {
                        // A SocketException might be thrown after the timeout was reached!
                        //throw new Exception("DNS server '" + DNSServer + "' did not respond within " + QueryTimeout.TotalSeconds + " seconds!");
                        return DNSInfo.TimedOut(new IPSocket(dnsServer.IPAddress,
                                                             dnsServer.Port),
                                                dnsQuery.TransactionId,
                                                QueryTimeout);
                    }
                    finally
                    {
                        if (socket is not null)
                            socket.Shutdown(SocketShutdown.Both);
                    }

                    return ReadResponse(dnsServer,
                                        dnsQuery.TransactionId,
                                        new MemoryStream(data));

                },
                TaskCreationOptions.AttachedToParent)

            ).ToList();

            #endregion

            Task<DNSInfo>? firstResponse = null;

            if (allDNSServerRequests.Any())
            {

                do
                {

                    try
                    {

                        // Return first/fastest reply
                        firstResponse = Task.WhenAny(allDNSServerRequests).Result;

                        allDNSServerRequests.Remove(firstResponse);

                        // Cache first useful response...
                        if (firstResponse.Result?.ResponseCode == DNSResponseCodes.NoError)
                        {

                            AddToCache(DomainName,
                                       firstResponse.Result);

                            break;

                        }

                    }
                    catch (Exception)
                    { }

                }
                while (allDNSServerRequests.Count > 0);

            }

            return Task.FromResult(firstResponse?.Result ??
                                       new DNSInfo(Origin:               new IPSocket(IPv4Address.Localhost, IPPort.DNS),
                                                   QueryId:              0,
                                                   IsAuthorativeAnswer:  false,
                                                   IsTruncated:          false,
                                                   RecursionDesired:     true,
                                                   RecursionAvailable:   false,
                                                   ResponseCode:         DNSResponseCodes.NameError,
                                                   Answers:              Array.Empty<ADNSResourceRecord>(),
                                                   Authorities:          Array.Empty<ADNSResourceRecord>(),
                                                   AdditionalRecords:    Array.Empty<ADNSResourceRecord>(),
                                                   IsValid:              true,
                                                   IsTimeout:            false,
                                                   Timeout:              QueryTimeout));

        }

        #endregion

        #region Query<T>(DomainName)

        public async Task<IEnumerable<T>> Query<T>(String DomainName)
            where T : ADNSResourceRecord
        {

            var typeIdField = typeof(T).GetField("TypeId");

            if (typeIdField is null)
                throw new ArgumentException("Constant field 'TypeId' of type '" + typeof(T).Name + "' was not found!");

            var dnsQuery = await Query(DomainName,
                                       new UInt16[] {
                                           (UInt16) typeIdField.GetValue(typeof(T))
                                       }).ConfigureAwait(false);

            return dnsQuery.Answers.
                       Where(resourceRecord => resourceRecord is T).
                       Cast<T>();

        }

        #endregion

        #region Query<T1, T2>(DomainName, Mapper)

        public async Task<IEnumerable<T2>> Query<T1, T2>(String        DomainName,
                                                         Func<T1, T2>  Mapper)
            where T1 : ADNSResourceRecord

            => (await Query<T1>(DomainName)).Select(v => Mapper(v));

        #endregion

        #region (override) ToString()

        /// <summary>
        /// Return a text representation of this object.
        /// </summary>
        public override String ToString()

            => "Using DNS servers: " +
               DNSServers.SafeSelect(socket => socket.ToString()).AggregateWith(", ");

        #endregion

    }

}


text:
var http = require('http');
var crypto = require('crypto');
var deferred = require('deferred');
var _ = require('underscore');
var HOST = 'localhost';
var PORT = 5984;
var DBNAME = '/msgr';

// Private functions
function doGET(url) {
    var d = deferred();
    var req = http.request(
        { host: HOST, port: PORT, method: 'GET', path: url },
        function(res) {
            var data = '';
            res.on('data', function(chunk) { data += chunk; });
            res.on('end', function() {
                var result = JSON.parse(data);

                if (res.statusCode >= 400) {
                    var error = new Error(result.error);
                    d.reject(error);
                } else {
                    d.resolve(result);
                }
            });
        }
    );
    req.on('error', function(e) {
        d.reject(e);
    });
    req.end();

    return d.promise;
}

function doPUT(url, data) {
    var d = deferred();
    var req = http.request(
        { host: HOST, port: PORT, method: 'PUT', path: url },
        function(res) {
            var data = '';
            res.on('data', function(chunk) { data += chunk; });
            res.on('end', function() {
                var result = JSON.parse(data);

                if (res.statusCode >= 400) {
                    var error = new Error(result.error);
                    d.reject(error);
                } else {
                    d.resolve(result);
                }
            });
        }
    );
    req.on('error', function(e) {
        d.reject(e);
    });
    req.write(JSON.stringify(data));
    req.end();

    return d.promise;
}

function doPOST(url, data) {
    var d = deferred();
    var req = http.request(
        { host: HOST, port: PORT, method: 'POST', path: url, headers:{'Content-Type': 'application/json'} },
        function(res) {
            var data = '';
            res.on('data', function(chunk) { data += chunk; });
            res.on('end', function() {
                var result = JSON.parse(data);

                if (res.statusCode >= 400) {
                    var error = new Error(result.error);
                    d.reject(error);
                } else {
                    d.resolve(result);
                }
            });
        }
    );
    req.on('error', function(e) {
        d.reject(e);
    });
    req.write(JSON.stringify(data));
    req.end();

    return d.promise;
}

function hash(text) {
    return crypto.createHash("sha512").update(text, "utf8").digest("hex");
}

function cleanUser(user) {
    delete user._id;
    delete user._rev;
    delete user.type;
    delete user.password;
    return user;
}

function cleanFeed(feed) {
    delete feed._id;
    delete feed._rev;
    delete feed.type;
    return feed;
}

function cleanArticle(article) {
    delete article._id;
    delete article._rev;
    delete article.type;
    return article;
}

function cleanReadstate(readstate) {
    delete readstate._id;
    delete readstate._rev;
    delete readstate.type;
    return readstate;
}

// Public API
function signup(user) {
    user.type = 'user';
    user.password = hash(user.password);
    user.subscriptions = [];

    return doPUT(DBNAME + '/' + user.login, user);
}

function signin(user) {
    return doGET(DBNAME + '/' + user.login)
    .then(
        function (u) {
            if (u.password === hash(user.password)) {
                // Get a token from CouchDB
                return doGET('/_uuids').then(
                    function(data) {
                        u.token = data.uuids[0];
                        return cleanUser(u);
                    }
                );
            }
            else {
                throw new Error(('Wrong password'));
            }
        }
    );
}

function getUser(user) {
    return doGET(DBNAME + '/' + user.login)
    .then(
        function (user) {
            return cleanUser(user);
        }
    );
}

function getAllUsers() {
    return doGET(DBNAME + '/_design/users/_view/all')
    .then(function (docs) {
        return _.map(docs.rows, function(row) {
            return cleanUser(row.value);
        });
    });
}

function subscribe(user, feed) {
    return doGET(DBNAME + '/' + user.login)
    .then(function (user) {
        user.subscriptions.push(feed);
        return doPUT(DBNAME + '/' + user.login, user)
        .then(function () {
            return cleanUser(user);
        });
    });
}

function unsubscribe(user, feed) {
    // 1) update the user object
    var updatedUser = doGET(DBNAME + '/' + user.login)
    .then(function (user) {
        user.subscriptions = _.filter(user.subscriptions, function(subscription) {
            return subscription.xmlUrl !== feed.xmlUrl;
        });
        return doPUT(DBNAME + '/' + user.login, user)
        .then(function() {
            return cleanUser(user);
        });
    });
    // 2) Bulk remove the readState objects
    var deleteReadStates = doGET(DBNAME + '/_design/feeds/_view/readState'
                + '?startkey=["' + user.login + '","' + encodeURIComponent(feed.xmlUrl) + '"]'
                + '&endkey=["' + user.login + '","' + encodeURIComponent(feed.xmlUrl) + '"]')
    .then(function (data) {
        var readstates = _.pluck(data.rows, 'value');
        _.map(readstates, function (readstate) {
            readstate._deleted = true;
        });
        return doPOST(DBNAME + '/_bulk_docs', {docs: readstates});
    });

    return deferred(updatedUser, deleteReadStates).then(function (data) {
        return data[0]; // updated user
    })
}

function updateUser(user) {
    return doGET(DBNAME + '/' + user.login)
    .then(function (u) {
        // Restore deleted fields
        user._rev = u._rev;
        user.type = u.type;
        user.password = !user.password ? u.password : hash(user.password);
        return doPUT(DBNAME + '/' + user.login, user)
    })
    .then(function () {
        return cleanUser(user);
    });
}

function addFeed(feed) {
    feed.type = 'feed';
    return doPUT(DBNAME + '/' + encodeURIComponent(feed.xmlUrl), feed)
    .then(function () {
        return cleanFeed(feed);
    });
}

function getFeed(feed) {
    return doGET(DBNAME + '/' + encodeURIComponent(feed.xmlUrl))
    .then(function(feed) {
        return cleanFeed(feed);
    });
}

function getAllFeeds() {
    return doGET(DBNAME + '/_design/feeds/_view/all')
    .then(function (docs) {
        return _.map(docs.rows, function(row) {
            return cleanFeed(row.value);
        });
    });
}

function getUserWithFeedSummary(user) {
    return getUser(user)
    .then(function(u) {
        // Group by user login and feed xmlUrl: group_level=2
        // Only get the data related to a user: startkey=["toto"]&endkey=["toto",{}]
        return doGET(DBNAME + '/_design/feeds/_view/unreadCount'
                    + '?group_level=2'
                    + '&startkey=["' + u.login + '"]'
                    + '&endkey=["' + u.login + '",{}]')
        .then(function (d) {
            _.map(d.rows, function (result) {
                var feed = result.key[1];
                var count = result.value;
                _.findWhere(u.subscriptions, {xmlUrl: feed}).unreadCount = count;
            });
            _.findWhere(u.subscriptions, {unreadCount: undefined}).unreadCount = 0;

            return u;
        });
    })
}

function addArticle(article) {
    article.type = 'article';
    return doPUT(DBNAME + '/' + encodeURIComponent(article.guid), article)
    .then(function(article) {
        return cleanArticle(article);
    });
}

function getArticle(article) {
    return doGET(DBNAME + '/' + encodeURIComponent(article.guid))
    .then(function(article) {
        return cleanArticle(article);
    });
}

function getAllArticlesForFeed(user, feed) {
    return doGET(DBNAME + '/_design/feeds/_view/readState'
                    + '?startkey=["' + user.login + '","' + encodeURIComponent(feed.xmlUrl) + '"]'
                    + '&endkey=["' + user.login + '","' + encodeURIComponent(feed.xmlUrl) + '"]')
    .then(function(data) {
        return _.map(data.rows, function (d) {
            var readstate = d.value;
            readstate.article.read = readstate.read; // inject read boolean into article object
            return readstate.article; // and return to server only the article objects
        });
    });
}

function getSubscribersForFeed(feed) {
    return doGET(DBNAME + '/_design/feeds/_view/subscribersByFeed?key="' + encodeURIComponent(feed.xmlUrl) + '"')
    .then(function (s) {
        return _.map(s.rows, function (row) {
            return cleanUser(row.value); // extract subscribers's id
        });
    })
}

function addReadstate(user, subscription, article, read) {
    return doPUT(
        DBNAME + '/' + user.login + ':' + encodeURIComponent(article.guid),
        {
            type: 'readstate',
            login: user.login,
            feed: subscription.xmlUrl,
            article: { guid: article.guid, pubdate: article.pubdate, title: article.title },
            read: read
        }
    );
}

function updateReadstate(user, article, read) {
    return doGET(DBNAME + '/' + user.login + ':' + encodeURIComponent(article.guid))
    .then(function (readstate) {
        readstate.read = read;
        return doPUT(DBNAME + '/' + user.login + ':' + encodeURIComponent(article.guid), readstate);
    });
}

exports.signup = signup;
exports.signin = signin;
exports.getUser = getUser;
exports.getAllUsers = getAllUsers;
exports.subscribe = subscribe;
exports.unsubscribe = unsubscribe;
exports.updateUser = updateUser;
exports.addFeed = addFeed;
exports.getFeed = getFeed;
exports.getAllFeeds = getAllFeeds;
exports.getUserWithFeedSummary = getUserWithFeedSummary;
exports.addArticle = addArticle;
exports.getArticle = getArticle;
exports.getAllArticlesForFeed = getAllArticlesForFeed;
exports.getSubscribersForFeed = getSubscribersForFeed;
exports.addReadstate = addReadstate;
exports.updateReadstate = updateReadstate;


text:
var __resolver__;

/**
  Stores the provided resolver instance so that tests being ran can resolve
  objects in the same way as a normal application.

  Used by `setupContext` and `setupRenderingContext` as a fallback when `setApplication` was _not_ used.

  @public
  @param {Ember.Resolver} resolver the resolver to be used for testing
*/
export function setResolver(resolver) {
  __resolver__ = resolver;
}

/**
  Retrieve the resolver instance stored by `setResolver`.

  @public
  @returns {Ember.Resolver} the previously stored resolver
*/
export function getResolver() {
  return __resolver__;
}


text:
	<title>Big Narstie's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Big Narstie's panel show appearances

Big Narstie (born 1985-11-17[ref]) has appeared in 3 episodes between 2017-2018.  Big Narstie on Wikipedia.

2017

2018

2018-11-02 / Would I Lie To You?

2018-05-17 / Celebrity Juice

2017-12-26 / The Big Fat Quiz


text:
package br.com.caelum.goodbuy.testes;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;

import br.com.caelum.goodbuy.modelo.Produto;

public class AlteracaoDeProduto {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		AnnotationConfiguration configuration = new AnnotationConfiguration();
		configuration.configure();

		SessionFactory factory = configuration.buildSessionFactory();
		Session session = factory.openSession();

		// carrega o produto do banco de dados
		Produto produto = (Produto) session.get(Produto.class, 1L);

		Transaction tx = session.beginTransaction();
		produto.setPreco(42.50);
		session.update(produto);
		tx.commit();
	}

}


text:
#pragma strict

var lAnim : Texture[];
var rAnim : Texture[];
var still : Texture;

var framesPerSecond = 10;

function Update() {
    var index : int = (Time.time * framesPerSecond) % rAnim.Length;
	if(Input.GetKeyDown(KeyCode.A)) {
		renderer.material.mainTexture = lAnim[index];
	}
	else if(Input.GetKeyDown(KeyCode.D)) {
		renderer.material.mainTexture = rAnim[index];
	}
	else {
		renderer.material.mainTexture = still;
	}
}


text:
package org.sana.android.net.test;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Collection;
import java.util.Collections;
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
import java.net.URI;

import org.sana.R;
import org.sana.android.Constants;
import org.sana.android.content.Uris;
import org.sana.android.net.MDSInterface2;
import org.sana.android.provider.Concepts;
import org.sana.android.provider.EncounterTasks;
import org.sana.android.provider.Procedures;
import org.sana.android.provider.Subjects;
import org.sana.android.provider.Tasks;
import org.sana.api.task.EncounterTask;
import org.sana.api.IModel;
import org.sana.core.Concept;
import org.sana.core.Location;
import org.sana.core.Patient;
import org.sana.core.Procedure;
import org.sana.net.Response;
import org.sana.net.http.handler.ConceptResponseHandler;
import org.sana.net.http.handler.EncounterResponseHandler;
import org.sana.net.http.handler.EncounterTaskResponseHandler;
import org.sana.net.http.handler.LocationResponseHandler;
import org.sana.net.http.handler.PatientResponseHandler;
import org.sana.net.http.handler.ProcedureResponseHandler;

import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.test.AndroidTestCase;
import android.util.Log;

public class MDS2InterfaceTest  extends AndroidTestCase {

	String username = "test_sa";
	String password = "t3st";
	Uri[] uris = new Uri[]{};
	Context mContext;

	String scheme, host, rootPath;
	int port;
	public void setUp(){
		mContext = this.getContext();
		SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
		host = preferences.getString(Constants.PREFERENCE_MDS_URL, host);
		// Realistically should never use http
		boolean useSecure = preferences.getBoolean(
				Constants.PREFERENCE_SECURE_TRANSMISSION, true);
		scheme = (useSecure)? "https": "http";
		host = mContext.getString(R.string.host_mds);
		port = 443;
		rootPath = mContext.getString(R.string.path_root);
	}

        static final SimpleDateFormat sdf = new SimpleDateFormat(IModel.DATE_FORMAT,
            Locale.US);

        public String timeStamp(){
	    Date now = new Date();
	    String nowStr = sdf.format(now);
	    return nowStr;
	}

	public void testLocationGet(){
		Uri target = Uri.parse("content://org.sana/core/location");
		Collection<Location> objs = Collections.emptyList();
		try {
		URI uri = Uris.iriToURI(target , scheme, host, port, rootPath );
		Log.d("MDS2InterfaceTest", "GET: " + uri);
		LocationResponseHandler handler = new LocationResponseHandler();

			Response<Collection<Location>> response = MDSInterface2.apiGet(uri, username,password,handler);
			Log.i("MDS2InterfaceTest", "LOCATIONS " + response);
			objs = response.message;
			for(Location obj:objs){
				Log.i("MDS2InterfaceTest", obj.name );
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		assertTrue(objs.size() > 0);
	}

	public void testEncounterTaskGet(){
		Collection<EncounterTask> objs = Collections.emptyList();
		Uri target = EncounterTasks.CONTENT_URI;
		try {
		URI uri = Uris.iriToURI(target , scheme, host, port, rootPath );
		Log.d("MDS2InterfaceTest", "GET: " + uri);
		EncounterTaskResponseHandler handler = new EncounterTaskResponseHandler();
			Response<Collection<EncounterTask>> response = MDSInterface2.apiGet(uri,username,password,handler);
			Log.i("MDS2InterfaceTest", "TASKS " + response);
			objs = response.message;
			for(EncounterTask task:objs){
				Log.d("MDS2InterfaceTest", "<EncounterTask " + task.status.current +" " + task.assigned_to.getUsername() + " >");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		assertTrue(objs.size() > 0);

	}

	public void testEncounterTaskUpdate(){
		Collection<EncounterTask> objs = Collections.emptyList();
                String uuid = "e56b3f06-329a-4be8-869e-0226c708221e";
                String now = timeStamp();
                Log.d("MDS2InterfaceTest", "now = " + now);
		Uri target = Uris.withAppendedUuid(EncounterTasks.CONTENT_URI, uuid);
		try {
		    URI uri = MDSInterface2.iriToURI(mContext,target);
		    //Uris.iriToURI(target , scheme, host, port, rootPath );
		    Map<String,String> form = new HashMap<String,String>();
                    //form.put("uuid",uuid);
		    form.put("status", "2");
		    form.put(Tasks.Contract.COMPLETED, now);
		    Log.d("MDS2InterfaceTest", "PUT: " + uri);
		    EncounterTaskResponseHandler handler = new EncounterTaskResponseHandler();
		    Response<Collection<EncounterTask>> response = MDSInterface2.apiPost(uri,username,password,form,handler);
		    Log.i("MDS2InterfaceTest", "TASKS " + response);
		    objs = response.message;
		    for(EncounterTask task:objs){
		        Log.d("MDS2InterfaceTest", task.toString());
		        Log.d("MDS2InterfaceTest", "..completed" + task.completed);
                    }
		} catch (Exception e) {
			e.printStackTrace();
		}
		assertTrue(objs.size() == 1);

	}

	public void testConceptGet(){
		ConceptResponseHandler handler = new ConceptResponseHandler();
		Collection<Concept> objs = Collections.emptyList();
		Uri target = Concepts.CONTENT_URI;
		try {
		URI uri = Uris.iriToURI(target , scheme, host, port, rootPath );
			Response<Collection<Concept>> response = MDSInterface2.apiGet(uri,username,password,handler);
			Log.i("MDS2InterfaceTest", "CONCEPTS" + response);
			objs = response.message;
			for(Concept obj:objs){
				Log.i("MDS2InterfaceTest", "<Concept "+ obj.name+">" );
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		assertTrue(objs.size() > 0);
	}

	public void testPatientGet(){
		Uri target = Subjects.CONTENT_URI;
		Log.d("MDS2InterfaceTest", "GET: " + target);
		PatientResponseHandler handler = new PatientResponseHandler();
		Collection<Patient> objs = Collections.emptyList();
		try {
			URI uri = Uris.iriToURI(target , scheme, host, port, rootPath );
			Response<Collection<Patient>> response = MDSInterface2.apiGet(uri, username,password,handler);
			Log.i("MDS2InterfaceTest", "PATIENTS" + response);
			objs = response.message;
			for(Patient obj:objs){
				Log.i("MDS2InterfaceTest", "<Patient " + obj.system_id +" >");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		assertTrue(objs.size() > 0);
	}

	public void testProcedureGet(){
		Uri target = Procedures.CONTENT_URI;
		Log.d("MDS2InterfaceTest", "GET: " + target);
		ProcedureResponseHandler handler = new ProcedureResponseHandler();
		Response<Collection<Procedure>> response = null;
		Collection<Procedure> objs = Collections.emptyList();
		try {
			URI uri = Uris.iriToURI(target , scheme, host, port, rootPath );
			response = MDSInterface2.apiGet(uri, username,password,handler);
			Log.i("MDS2InterfaceTest", "CONCEPTS" + response);
			objs = response.message;
			for(Procedure obj:objs){
				Log.i("MDS2InterfaceTest", "<Procedure "+obj.title +" >" );
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		assertTrue(objs.size() > 0);
	}
}


text:
package com.vaadin.tests.widgetset.server.csrf.ui;

import com.vaadin.launcher.CustomDeploymentConfiguration;
import com.vaadin.launcher.CustomDeploymentConfiguration.Conf;

/**
 * When the disable-xsrf-protection is true csrfToken is not present anymore
 * with the requests.<br/>
 * This is useful mostly when the client is not Vaadin and so it will not push
 * the parameter anyway. So now the server knows how to deal the issue if the
 * csrfToken is not present.
 *
 * @since
 * @author Vaadin Ltd
 */
@SuppressWarnings("serial")
@CustomDeploymentConfiguration({ @Conf(name = "disable-xsrf-protection", value = "true") })
public class CsrfTokenDisabled extends AbstractCsrfTokenUI {

}


text:
#import <UIKit/UIMotionEffect.h>

@class NSArray;

@interface UIMotionEffectGroup : UIMotionEffect
{
    NSArray *_motionEffects;
}

@property(copy, nonatomic) NSArray *motionEffects; // @synthesize motionEffects=_motionEffects;
- (id)debugDescription;
- (id)description;
- (void)dealloc;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)keyPathsAndRelativeValuesForViewerOffset:(struct UIOffset)arg1;
- (id)_keyPathsAndRelativeValuesForPose:(id)arg1;

@end


text:
// Generated by CoffeeScript 1.7.1
(function() {
  var SectionBlockBinding, componentBlockBinding, registerComponents;

  componentBlockBinding = require("./componentBlockBinding");

  SectionBlockBinding = require("./sectionBlockBinding");

  /*
   */

  registerComponents = function(components, pc) {
    var name, o, register;
    register = function(key, value) {
      return pc.blockBinding(key, componentBlockBinding(value));
    };
    for (name in (o = components.toJSON())) {
      register(name, o[name]);
    }
    return components.on("change", register);
  };

  /*
   */

  module.exports = function(components) {
    return function(pc) {
      registerComponents(components, pc);
      return pc.blockBinding("section", SectionBlockBinding);
    };
  };

}).call(this);


text:
<component name="libraryTable">
  <library name="Maven: com.google.api-client:google-api-client:1.19.0">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/google/api-client/google-api-client/1.19.0/google-api-client-1.19.0.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/google/api-client/google-api-client/1.19.0/google-api-client-1.19.0-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/google/api-client/google-api-client/1.19.0/google-api-client-1.19.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
using Lucene.Net.Analysis.Core;
using Lucene.Net.Analysis.Miscellaneous;
using Lucene.Net.Analysis.Util;
using NUnit.Framework;
using System.IO;

namespace Lucene.Net.Analysis.De
{

    /// <summary>
    /// Simple tests for <seealso cref="GermanMinimalStemFilter"/>
    /// </summary>
    public class TestGermanMinimalStemFilter : BaseTokenStreamTestCase
    {
        private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();

        private class AnalyzerAnonymousInnerClassHelper : Analyzer
        {
            public AnalyzerAnonymousInnerClassHelper()
            {
            }

            protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
            {
                Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
                return new TokenStreamComponents(source, new GermanMinimalStemFilter(source));
            }
        }

        /// <summary>
        /// Test some examples from the paper </summary>
        [Test]
        public virtual void TestExamples()
        {
            CheckOneTerm(analyzer, "sängerinnen", "sangerin");
            CheckOneTerm(analyzer, "frauen", "frau");
            CheckOneTerm(analyzer, "kenntnisse", "kenntnis");
            CheckOneTerm(analyzer, "staates", "staat");
            CheckOneTerm(analyzer, "bilder", "bild");
            CheckOneTerm(analyzer, "boote", "boot");
            CheckOneTerm(analyzer, "götter", "gott");
            CheckOneTerm(analyzer, "äpfel", "apfel");
        }

        [Test]
        public virtual void TestKeyword()
        {
            CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("sängerinnen"), false);
            Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
            CheckOneTerm(a, "sängerinnen", "sängerinnen");
        }

        private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
        {
            private readonly TestGermanMinimalStemFilter outerInstance;

            private CharArraySet exclusionSet;

            public AnalyzerAnonymousInnerClassHelper2(TestGermanMinimalStemFilter outerInstance, CharArraySet exclusionSet)
            {
                this.outerInstance = outerInstance;
                this.exclusionSet = exclusionSet;
            }

            protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
            {
                Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
                TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
                return new TokenStreamComponents(source, new GermanMinimalStemFilter(sink));
            }
        }

        /// <summary>
        /// Test against a vocabulary from the reference impl </summary>
        [Test]
        public virtual void TestVocabulary()
        {
            VocabularyAssert.AssertVocabulary(analyzer, GetDataFile("deminimaltestdata.zip"), "deminimal.txt");
        }

        /// <summary>
        /// blast some random strings through the analyzer </summary>
        [Test]
        public virtual void TestRandomStrings()
        {
            CheckRandomData(Random(), analyzer, 1000 * RANDOM_MULTIPLIER);
        }

        [Test]
        public virtual void TestEmptyTerm()
        {
            Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
            CheckOneTerm(a, "", "");
        }

        private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
        {
            private readonly TestGermanMinimalStemFilter outerInstance;

            public AnalyzerAnonymousInnerClassHelper3(TestGermanMinimalStemFilter outerInstance)
            {
                this.outerInstance = outerInstance;
            }

            protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
            {
                Tokenizer tokenizer = new KeywordTokenizer(reader);
                return new TokenStreamComponents(tokenizer, new GermanMinimalStemFilter(tokenizer));
            }
        }
    }
}