text:
package scala.slick.ast

import OptimizerUtil._
import scala.slick.ql.RawNamedColumn
import scala.slick.SLICKException
import scala.slick.util.Logging

/**
 * Rewrite all generators to return exactly the required fields.
 */
object RewriteGenerators extends Logging {

  class SyntheticBindSymbol extends AnonSymbol

  def apply(tree: Node): Node = {
    val t2 = rewriteGenerators(tree)
    // Replace InRef(RawNamedColumn) occurrences left over after rewriting them in all generators.
    // This can happen in queries without projections.
    memoized[Node, Node](r => {
      case InRef(t, r: RawNamedColumn) => FieldRef(t, r.symbol)
      case InRef(t, n) =>
        findPureTarget(n) match {
          case StructNode(IndexedSeq((sym, _))) => FieldRef(t, sym)
          case ProductNode(FieldRef(_, sym)) => FieldRef(t, sym)
        }
      case n => n.nodeMapChildren(r)
    })(t2)
  }

  def findPureTarget(in: Node): Node = in match {
    case f: FilteredQuery => findPureTarget(f.from)
    case Bind(_, _, Pure(n)) => n
    case Bind(_, _, nonPure) => findPureTarget(nonPure)
    case n => n
  }

  def rewriteGenerators(tree: Node): Node = memoized[Node, Node](r => {
    //case fs @ RealFilterChain(filterSyms, Bind(_, _, _)) =>
    //TODO push additional columns needed by the filters into the Bind (without rewriting the existing ones)
    case b @ Bind(gen, from, what) if(!(gen.isInstanceOf[SyntheticBindSymbol])) =>
      rewriteGenerator(b, gen, from).nodeMapChildren(r)
    case j @ FilteredJoin(leftGen, rightGen, left, right, _, _) =>
      rewriteGenerator(rewriteGenerator(j, rightGen, right).nodeMapChildren(r), leftGen, left).nodeMapChildren(r)
    case j @ BaseJoin(leftGen, rightGen, left, right, _) =>
      rewriteGenerator(rewriteGenerator(j, rightGen, right).nodeMapChildren(r), leftGen, left).nodeMapChildren(r)
    case n => n.nodeMapChildren(r)
  })(tree)

  def rewriteGenerator(b: Node, gen: Symbol, from: Node): Node = {
    logger.debug("rewriteGenerator: ",b)
    val rewrite = collectRewriteSymbols(gen, from)
    logger.debug("rewrite: "+rewrite)
    val refsMap = collectReferences(b, rewrite).iterator.map(n => (n, new AnonSymbol)).toMap
    val struct = refsMap.iterator.map{ case (n,s) => (s,n) }.toIndexedSeq

    val (withNewSelect, replacementMap) = {
      val isTableBased = findSelect(from) match {
        case _: TableNode => true
        case Pure(TableRef(_)) => true
        case x =>
          logger.debug("not table-based:", x)
          false
      }
      logger.debug("isTableBased: "+isTableBased+", keys: "+refsMap.keys)
      if(isTableBased && refsMap.keys.forall(_.isInstanceOf[RawNamedColumn])) {
        // only column refs -> rewrite directly
        logger.debug("Rewriting directly as table")
        (b, refsMap.map { case (r: RawNamedColumn, _) => (r: Node, r.symbol) })
      } else {
        logger.debug("struct:", StructNode(struct))
        (b.nodeMapChildren(n => if(n eq from) replaceSelect(from, struct, rewrite, new ReplaceSelectContext(b)) else n), refsMap)
      }
    }
    logger.debug("withNewSelect:", withNewSelect)
    logger.debug("replacementMap: "+replacementMap)
    val rr = replaceReferences(withNewSelect, rewrite, replacementMap, Set.empty)
    logger.debug("rewritten:", rr)
    rr
  }

  def collectRewriteSymbols(s: Symbol, n: Node): Set[Symbol] = n match {
    case FilteredQuery(gen, from) => collectRewriteSymbols(gen, from) + s
    case _ => Set(s)
  }

  def collectReferences(n: Node, syms: Set[Symbol]): Set[Node] = n match {
    case InRef(sym, what) if syms contains sym => Set(what)
    case n => n.nodeChildren.map(ch => collectReferences(ch, syms)).flatten.toSet
  }

  def replaceReferences(n: Node, syms: Set[Symbol], repl: Map[Node, Symbol], parents: Set[Symbol]): Node = n match {
    case ir @ InRef(sym, what) if syms contains sym =>
      //logger.debug("matched InRef("+sym+", "+what+") with matching sym")
      repl.get(what) match {
        case Some(sym2) =>
          if(parents contains sym) {
            //TODO aliasing to another column in the same struct -> we should prevent this earlier
            //logger.debug("NOT replacing with FieldRef("+sym+", "+sym2+") at parents "+parents)
            replaceReferences(what, syms, repl, parents)
          } else {
            //logger.debug("replacing with FieldRef("+sym+", "+sym2+") at parents "+parents)
            FieldRef(sym, sym2)
          }
        case None =>
          replaceReferences(what, syms, repl, parents)
      }
    case d: DefNode =>
      d.nodeMapScopedChildren{ case (symO, ch) => replaceReferences(ch, syms, repl, parents ++ symO.toSet) }
    case n => n.nodeMapChildren(ch => replaceReferences(ch, syms, repl, parents))
  }

  def findSelect(in: Node): Node = in match {
    case f: FilteredQuery => findSelect(f.from)
    case b @ Bind(_, _, Pure(_)) => b.from
    case b @ Bind(_, _, nonPure) => findSelect(nonPure)
    case n => n
  }

  class ReplaceSelectContext(baseNode: Node, val keepExisting: Boolean = false, var indices: Option[Seq[Int]] = None) {
    def forUnion = new ReplaceSelectContext(baseNode, true)

    lazy val filterSyms = {
      logger.debug("computing filter syms for:", baseNode)
      baseNode.collect[Symbol]{ case FilteredQuery(gen, _) => gen }.toSet
    }

    def unwrap(n: Node): Node = n match {
      case InRef(sym1, InRef(sym2, what)) if filterSyms contains sym2 => InRef(sym1, unwrap(what))
      case n => n.nodeMapChildren(unwrap)
    }
  }

  def replaceSelect(in: Node, struct: IndexedSeq[(Symbol, Node)], genChain: Set[Symbol], ctx: ReplaceSelectContext): Node = {
    logger.debug("replaceSelect("+in+", "+struct+", "+genChain+", "+ctx+")")
    in match {
      case f: FilteredQuery => f.nodeMapFrom(n => replaceSelect(n, struct, genChain, ctx))
      case b @ Bind(_, _, p @ Pure(_)) => b.copy(select = replaceSelect(p, struct, genChain, ctx))
      case b @ Bind(gen, _, nonPure) => b.copy(select = replaceSelect(nonPure, struct, genChain, ctx))
      case t: TableNode => //TODO support keepExisting and useIndices
        val gen = new SyntheticBindSymbol
        val rewrapped = StructNode(struct.map { case (s,n) => (s, rewrap(n, genChain.iterator.map(s => (s, gen)).toMap, gen)) })
        logger.debug("actual replacement:", rewrapped)
        Bind(gen, t, Pure(rewrapped))
      case f @ FilteredJoin(leftGen, rightGen, _, _, jt, on) => //TODO support keepExisting and useIndices
        val gen = new SyntheticBindSymbol
        logger.debug("struct:", StructNode(struct))
        val rewrapMap = genChain.iterator.map(s => (s, gen)).toMap + (leftGen -> leftGen) + (rightGen -> rightGen)
        val rewrapped = StructNode(struct.map { case (s,n) => (s, rewrap(n, rewrapMap, gen)) })
        logger.debug("genChain: "+genChain)
        logger.debug("replacement for FilteredJoin:", rewrapped)
        Bind(gen, f, Pure(rewrapped))
      case Pure(what) =>
        if(ctx.keepExisting) {
          val cols = what.flattenProduct
          if(ctx.indices == None) {
            val idxMap = cols.zipWithIndex.map{ case (n, idx) => (ctx.unwrap(n), idx) }.toMap
            logger.debug("idxMap: "+idxMap)
            logger.debug("keeping existing in:", ProductNode(cols.map(ctx.unwrap): _*))
            logger.debug("columns to find:", StructNode(struct.map{ case (s, n) => (s, ctx.unwrap(n)) }))
            val structIdxs = struct.map { case (_, n) => idxMap.get(ctx.unwrap(n)) match {
              case Some(idx) => idx
              case None => throw new SLICKException("Unknown expression "+n+" in UNION result - cannot rewrite")
            }}
            logger.debug("found indexes: "+structIdxs)
            ctx.indices = Some(structIdxs)
          }
          val mappedStruct = struct.zipWithIndex.map { case ((sym, _), idx) => (sym, cols(ctx.indices.get(idx))) }
          //TODO support keepExisting and useIndices
          //sys.error("not implemented")
          Pure(StructNode(mappedStruct))
        } else Pure(StructNode(struct))
      case u @ Union(left, right, _, leftGen, rightGen) =>
        logger.debug("replacing Union of "+leftGen+", "+rightGen)
        logger.debug("genChain: "+genChain)
        val unionCtx = ctx.forUnion
        val lr = replaceSelect(left, struct.map{ case (s,n) => (s, n.unwrap(Set(leftGen))) }, genChain, unionCtx)
        val rr = replaceSelect(right, struct, genChain, unionCtx)
        u.copy(left = lr, right = rr)
    }
  }

  def rewrap(n: Node, wrappers: Map[Symbol, Symbol], newWrapper: Symbol): Node = n match {
    case c @ RawNamedColumn(_) => FieldRef(newWrapper, c.symbol)
    case InRef(sym, what) =>
      if(wrappers.keySet contains sym) rewrap(what, wrappers, wrappers(sym))
      else rewrap(what, wrappers, newWrapper)
    case n => n.nodeMapChildren(ch => rewrap(ch, wrappers, newWrapper))
  }
}


text:
var jade = require('jade'),
    // an ad-hoc minifier created with uglify
    minifier = require('./uglyMinifier').minifier;

module.exports = function (jadeOptions, mangleOptions, squeezeOptions, genOptions) {

    var hexMapMixin = "include hexMapMixin\nmixin hexMap(ranks, files, width, height, defaultImageURL, boardClass)",
        hexMapDivMixin = "include hexMapDivMixin\nmixin hexMapDiv(ranks, files, width, height, defaultImageURL, divClass, boardClass)",
        squareMapMixin = "include squareMapMixin\nmixin squareMap(ranks, files, width, height, defaultImageURL, boardClass)",
        squareMapDivMixin = "include squareMapDivMixin\nmixin squareMapDiv(ranks, files, width, height, defaultImageURL, divClass, boardClass)",
        hexMap,
        hexMapTemplate,
        hexMapDiv,
        hexMapDivTemplate,
        squareMap,
        squareMapTemplate,
        squareMapDiv,
        squareMapDivTemplate;

    function createHexMap() {
        if (hexMap === undefined) {
            hexMap = jade.compile(hexMapMixin, jadeOptions);
        }
        return hexMap;
    }

    function createHexMapTemplate() {
        if (hexMapTemplate === undefined) {
            hexMapTemplate = minifier(createHexMap().toString(), mangleOptions, squeezeOptions, genOptions);
        }
        return hexMapTemplate;
    }

    function createHexMapDiv() {
        if (hexMapDiv === undefined) {
            hexMapDiv = jade.compile(hexMapDivMixin, jadeOptions);
        }
        return hexMapDiv;
    }

    function createHexMapDivTemplate() {
        if (hexMapDivTemplate === undefined) {
            hexMapDivTemplate = minifier(createHexMapDiv().toString(), mangleOptions, squeezeOptions, genOptions);
        }
        return hexMapDivTemplate;
    }

    function createSquareMap() {
        if (squareMap === undefined) {
            squareMap = jade.compile(squareMapMixin, jadeOptions);
        }
        return squareMap;
    }

    function createSquareMapTemplate() {
        if (squareMapTemplate === undefined) {
            squareMapTemplate = minifier(createSquareMap().toString(), mangleOptions, squeezeOptions, genOptions);
        }
        return squareMapTemplate;
    }

    function createSquareMapDiv() {
        if (squareMapDiv === undefined) {
            squareMapDiv = jade.compile(squareMapDivMixin, jadeOptions);
        }
        return squareMapDiv;
    }

    function createSquareMapDivTemplate() {
        if (squareMapDivTemplate === undefined) {
            squareMapDivTemplate = minifier(createSquareMapDiv().toString(), mangleOptions, squeezeOptions, genOptions);
        }
        return squareMapDivTemplate;
    }

    return {
        version: '0.0.1',
        hexMap: createHexMap,
        hexMapTemplate: createHexMapTemplate,
        hexMapDiv: createHexMapDiv,
        hexMapDivTemplate: createHexMapDivTemplate,
        squareMap: createSquareMap,
        squareMapTemplate : createSquareMapTemplate,
        squareMapDiv: createSquareMapDiv,
        squareMapDivTemplate: createSquareMapDivTemplate
    };
};

redpajama_set_name: RedPajamaGithub


text:
'''

    Copyright 2013 Joe Harris

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

'''

'''

    Ban/blacklist an IP. See:

    http://www.cloudflare.com/docs/client-api.html#s4.7

'''

from txcloudflare.request import HttpRequest
from txcloudflare.errors import RequestValidationException

class IpBanRequest(HttpRequest):

    ACTION = 'ban'
    METHOD = 'POST'
    REQUIRED_PARAMS = {
        'key': str,
    }
    OPTIONAL_PARAMS = {}
    PARAM_MAP = {
        'ip': 'key',
    }

    def pre_process(self, params):
        return params

    def post_process(self, data):
        return data.get('result', {})

api_request = IpBanRequest

'''

    EOF

'''


text:
<?php
namespace Prolong\UserBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
 * Class UserRegisterType
 * @package Prolong\UserBundle\Form
 */
class UserRegisterType extends AbstractType
{
    const FORM_NAME = 'userRegister';

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('email', 'email', ['required' => true])
            ->add('password', 'text', ['required' => true]);
    }

    public function getName()
    {
        return self::FORM_NAME;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults([
            'data_class' => 'Prolong\UserBundle\Entity\User',
            'csrf_protection' => false,
            'csrf_field_name' => '_token',
        ]);
    }
}


text:
package eu.prowessproject.jeb.types;

import java.util.HashMap;
import java.util.Map;

import com.ericsson.otp.erlang.OtpErlangAtom;
import com.ericsson.otp.erlang.OtpErlangObject;
import com.ericsson.otp.erlang.OtpErlangTuple;

import eu.prowessproject.jeb.serialisation.ErlSerialisable;
import eu.prowessproject.jeb.serialisation.ErlSerialisationUtils;
import eu.prowessproject.jeb.utils.ReflectionUtils;

/**
 * Represents a serialisable representation of a Java type
 */
public abstract class Type implements ErlSerialisable {

	private static final String TYPE_ATOM = "type";

	public static final Class<?>[] TYPE_CLASSES = { ObjectType.class,
			ByteType.class, CharType.class, DoubleType.class, FloatType.class,
			IntType.class, LongType.class, ShortType.class, BooleanType.class };

	private static final Map<String, Class<?>> TYPE_TYPE_MAP;

	static {
		TYPE_TYPE_MAP = new HashMap<String, Class<?>>(TYPE_CLASSES.length);
		for (Class<?> typeClass : TYPE_CLASSES) {
			TYPE_TYPE_MAP.put(ReflectionUtils.getTypeStrFromClass(typeClass),
					typeClass);
		}
	}

	public abstract int getType();

	public abstract String getTypeStr();

	@Override
	public OtpErlangObject erlSerialise() {
		return new OtpErlangTuple(new OtpErlangObject[] {
				new OtpErlangAtom(TYPE_ATOM),
				new OtpErlangAtom(this.getTypeStr()),
				this.concreteErlSerialise() });
	}

	protected abstract OtpErlangObject concreteErlSerialise();

	public static Type erlDeserialise(OtpErlangObject object) {
		OtpErlangObject[] tuple = ErlSerialisationUtils.tupleOfSizeToArray(
				object, 3);
		ErlSerialisationUtils.checkIsAtom(tuple[0], TYPE_ATOM);
		String typeStr = ErlSerialisationUtils.getStringFromAtom(tuple[1]);
		Class<?> typeClass = TYPE_TYPE_MAP.get(typeStr);
		return ReflectionUtils.callConcreteDeserialise(Type.class, typeClass,
				new Object[] { tuple[2] },
				new Class<?>[] { OtpErlangObject.class });
	}

	public abstract Class<?> getTypeClass();

	public static Class<?>[] mapTypesToClass(Type[] paramTypes) {
		Class<?>[] classObjects = new Class<?>[paramTypes.length];
		for (int i = 0; i < paramTypes.length; i++) {
			classObjects[i] = paramTypes[i].getTypeClass();
		}
		return classObjects;
	}
}


text:
'use strict';

import React from 'react';
import List from '../components/List';
import TrainingStore from '../stores/TrainingStore.js';
import SimpleHeaderMixin from '../mixins/SimpleHeaderMixin';
import AppState from '../stores/AppState';

let Home = React.createClass({
    contextTypes: {
        router: React.PropTypes.func.isRequired
    },

    header: {
        title: 'Home'
    },

    mixins: [React.addons.PureRenderMixin, SimpleHeaderMixin],

    getInitialState() {
        return {
            timer: AppState.getTimer()
        };
    },

    goToTrainingHandler() {
        this.context.router.transitionTo('training');
    },

    goToDetailHandler(e, item) {
        this.context.router.transitionTo('detail', {}, {training: item.id});
    },

    render() {
        let activeTraining = AppState.getActiveTraining(),
            handlers = {
                default: this.goToDetailHandler
            },
            trainingDiv,
            trainings = TrainingStore.getTrainings().map((item) => {
                let date = new Date(item.get('dateStart'));
                return item.set('label', date.toLocaleDateString() + ' ' +
                    date.toLocaleTimeString() + ' - ' + item.getIn(['workout', 'label']));
            }).reverse(),
            timerDiv;

        if (activeTraining) {
            trainingDiv = (

             {activeTraining.getIn(['workout', 'label'])}
);
            timerDiv =
{this.state.timer}
;
        }
        return (

                {trainingDiv}
                {timerDiv}

 Recent Trainings:

                <List handlers={handlers} editAble={false} items={trainings.toJS()} />

        );
    },

    componentDidMount() {
        let self = this;
        AppState.addChangeListener(self._onChange);
    },

    componentWillUnmount() {
        AppState.removeChangeListener(this._onChange);
    },

    _onChange() {
        this.setState({
            timer: AppState.getTimer()
        });
    }
});

module.exports = Home;


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "grade".
 *
 * @property string $id
 * @property integer $grade_protection
 * @property string $enrolled_id
 * @property integer $grading_period
 * @property integer $core_value_1
 * @property integer $core_value_2
 * @property integer $core_value_3
 * @property integer $core_value_4
 * @property integer $subject_1
 * @property integer $subject_2
 * @property integer $subject_3
 * @property integer $subject_4
 * @property integer $subject_5
 * @property integer $subject_6
 * @property integer $subject_7
 * @property integer $subject_8
 * @property integer $subject_9
 * @property integer $subject_10
 *
 * @property Enrolled $enrolled
 */
class GradeElevenFirstSemForm extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'grade';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['grade_protection', 'enrolled_id', 'grading_period', 'core_value_1', 'core_value_2', 'core_value_3', 'core_value_4', 'subject_1', 'subject_2', 'subject_3', 'subject_4', 'subject_5', 'subject_6', 'subject_7', 'subject_8', 'subject_9', 'subject_10'], 'integer'],
            [['enrolled_id','grading_period'], 'required']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'grade_protection' => 'Grade Protection',
            'enrolled_id' => 'Enrolled ID',
            'grading_period' => 'Grading Period',
            'core_value_1' => 'Makadiyos',
            'core_value_2' => 'Makatao',
            'core_value_3' => 'Makakalikasan',
            'core_value_4' => 'Makabansa',
            'subject_1' => 'Oral Communication',
            'subject_2' => 'Organization and Management',
            'subject_3' => 'General Mathematics',
            'subject_4' => 'Komunikasyon at pananaliksik',
            'subject_5' => 'Entreprenuership',
            'subject_6' => 'PE and Health',
            'subject_7' => 'Animation',
            'subject_8' => 'Computer Programming',
            'subject_9' => 'Bread and Pastry Production',
            'subject_10' => 'Creative Industries I: Arts and Design',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getEnrolled()
    {
        return $this->hasOne(EnrolledForm::className(), ['id' => 'enrolled_id']);
    }
}


text:
Changelog
=========

0.1
---
#. Django 1.6 compatibility.
#. Prepare test framework. Actual tests are not implemented yet.

0.0.4-beta (09-05-2013)
-----------------------
#. Better error messages if locating the request fails on /set-location/.
#. Use http/https depending on current connection to get Google Maps javascript.

0.0.3-beta (20-02-2013)
-----------------------
#. Ajax POST to `/set-location/` rather than GET. Better semantics and it avoids browser caching issue.

0.0.2-beta (08-11-2012)
-----------------------
#. Remove dependency on JQuery.
#. Make location selection form easily overrideable.
#. Fix location_required decorator so that it is chainable.

0.0.1-beta
----------
#. Initial release.


text:
// Distrubuted under the MIT license
// ===================================================
// SharpMC uses the permissive MIT license.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ©Copyright Kenny van Vulpen - 2015

using SharpMC.Core.Blocks;
using SharpMC.Core.Entity;
using SharpMC.Core.Enums;
using SharpMC.Core.Utils;
using SharpMC.Core.Worlds;

namespace SharpMC.Core.Items
{
	internal class ItemFlintAndSteel : Item
	{
		public ItemFlintAndSteel() : base(259, 0)
		{
			IsUsable = false;
		}

		public override void UseItem(Level world, Player player, Vector3 blockCoordinates, BlockFace face)
		{
			blockCoordinates = GetNewCoordinatesFromFace(blockCoordinates, face);
			var block = world.GetBlock(blockCoordinates);
			ConsoleFunctions.WriteInfoLine("Block: " + block.Id);
			if (block.Id != 46)
			{
				var affectedBlock = world.GetBlock(blockCoordinates);
				if (affectedBlock.Id == 0)
				{
					var fire = new BlockFire
					{
						Coordinates = affectedBlock.Coordinates
					};
					world.SetBlock(fire);
				}
			}
			else
			{
				new PrimedTNTEntity(world) {KnownPosition = blockCoordinates.ToPlayerLocation()}.SpawnEntity();
			}
		}
	}
}


text:
/*
 * PipelineImpllinks.h
 *
 *
 */

#ifndef TINY_CPP_CLIENT_PipelineImpllinks_H_
#define TINY_CPP_CLIENT_PipelineImpllinks_H_

#include <string>
#include "bourne/json.hpp"
#include "Helpers.h"
#include "Link.h"

namespace Tiny {

/*! \brief
 *
 *  \ingroup Models
 *
 */

class PipelineImpllinks{
public:

    /*! \brief Constructor.
	 */
    PipelineImpllinks();
    PipelineImpllinks(std::string jsonString);

    /*! \brief Destructor.
	 */
    virtual ~PipelineImpllinks();

    /*! \brief Retrieve a bourne JSON representation of this class.
	 */
    bourne::json toJson();

    /*! \brief Fills in members of this class from bourne JSON object representing it.
	 */
    void fromJson(std::string jsonObj);

	/*! \brief Get
	 */
	Link getRuns();

	/*! \brief Set
	 */
	void setRuns(Link  runs);
	/*! \brief Get
	 */
	Link getSelf();

	/*! \brief Set
	 */
	void setSelf(Link  self);
	/*! \brief Get
	 */
	Link getQueue();

	/*! \brief Set
	 */
	void setQueue(Link  queue);
	/*! \brief Get
	 */
	Link getActions();

	/*! \brief Set
	 */
	void setActions(Link  actions);
	/*! \brief Get
	 */
	std::string getClass();

	/*! \brief Set
	 */
	void setClass(std::string  _class);

    private:
    Link runs;
    Link self;
    Link queue;
    Link actions;
    std::string _class{};
};
}

#endif /* TINY_CPP_CLIENT_PipelineImpllinks_H_ */


text:
describe 'common/patch.rb' do
  def before_first
    screen.must_equal catalog
  end

  t 'before_first' do
    before_first
  end

  # Attributes are busted in Android.
  # Blocked on https://github.com/appium/appium/issues/628
  describe 'Selenium::WebDriver::Element methods' do
    # TODO: t 'value' do; end

    t 'name' do
      first_text.name.must_equal 'UICatalog'
    end

    # t 'tag_name' do; end # Doesn't work on Android

    t 'location_rel' do
      loc = first_text.location_rel
      loc.x.class.must_equal String
      loc.y.class.must_equal String
    end
  end

  describe 'common patch' do
    # By default, the webdriver gem will return message instead of origValue
    # {"message":"An unknown server-side error occurred while processing the command.","origValue":"Strategy id is not valid."}
    t 'error_message' do
      value = ''
      begin
        set_wait 0
        find_element(:css, 'ok')
      rescue Exception => e
        value = e.message
      ensure
        set_wait
      end
      value.must_equal 'Invalid locator strategy: css selector'
    end
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>The nova.tests.hyperv.db_fakes Module — nova 2012.2.1 documentation</title>

    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/tweaks.css" type="text/css" />

    <link rel="top" title="nova 2012.2.1 documentation" href="../index.html" />
    <link rel="up" title="<no title>" href="autoindex.html" />
    <link rel="next" title="The nova.tests.hyperv.hypervutils Module" href="nova.tests.hyperv.hypervutils.html" />
    <link rel="prev" title="The nova.tests.hyperv.basetestcase Module" href="nova.tests.hyperv.basetestcase.html" />

OpenStack

Home

Projects

User Stories

Community

Blog

Wiki

Documentation

The <tt class="xref py py-mod docutils literal">nova.tests.hyperv.db_fakes</tt> Module¶

Stubouts, mocks and fixtures for the test suite

<tt class="descname">get_fake_block_device_info</tt><big>(</big>target_portal, volume_id<big>)</big>¶

<tt class="descname">get_fake_image_data</tt><big>(</big>project_id, user_id<big>)</big>¶

<tt class="descname">get_fake_instance_data</tt><big>(</big>name, project_id, user_id<big>)</big>¶

<tt class="descname">get_fake_volume_info_data</tt><big>(</big>target_portal, volume_id<big>)</big>¶

<tt class="descname">stub_out_db_instance_api</tt><big>(</big>stubs<big>)</big>¶

Stubs out the db API for creating Instances.

Previous topic

The <tt class="docutils literal docutils literal docutils literal">nova.tests.hyperv.basetestcase</tt> Module

Next topic

The <tt class="docutils literal">nova.tests.hyperv.hypervutils</tt> Module

This Page

Show Source

Quick search

              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>

              Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

nova 2012.2.1 documentation »

Developer Guide »

<no title> »

        © Copyright 2010-present, OpenStack, LLC.
      Last updated on Thu Nov 1 16:11:51 2012, commit 4ed8d3e.
      Created using Sphinx 1.1.3.


text:
package raptor.chat;

/**
 * This code was adapted from some code johnthegreat for Raptor.
 */
public class Partnership implements Comparable<Partnership> {
	private Bugger bugger1;
	private Bugger bugger2;

	public int compareTo(Partnership partnership) {
		int teamRating1 = getTeamRating();
		int teamRating2 = partnership.getTeamRating();
		return teamRating1 < teamRating2 ? 1 : teamRating1 == teamRating2 ? 0
				: -1;
	}

	public Bugger getBugger1() {
		return bugger1;
	}

	public Bugger getBugger2() {
		return bugger2;
	}

	public int getTeamRating() {
		return bugger1.getRatingAsInt() + bugger2.getRatingAsInt();
	}

	public void setBugger1(Bugger bugger) {
		bugger1 = bugger;
	}

	public void setBugger2(Bugger bugger) {
		bugger2 = bugger;
	}

	@Override
	public String toString() {
		return bugger1 + " " + bugger2;
	}

}


text:
package net.oneandone.troilus.example;

public enum ClassifierEnum  {

    ONE, TWO, THREE, FOUR, FIVE
}


text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

          <title>HivemallStreamingOps - org.apache.spark.streaming.HivemallStreamingOps</title>
          <meta name="description" content="HivemallStreamingOps - org.apache.spark.streaming.HivemallStreamingOps" />
          <meta name="keywords" content="HivemallStreamingOps org.apache.spark.streaming.HivemallStreamingOps" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

org.apache.spark.streaming

HivemallStreamingOps

        object

        HivemallStreamingOps

          Linear Supertypes

AnyRef, Any

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

HivemallStreamingOps

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Value Members

        final
        def

        !=(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

Any

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        implicit
        def

        dataFrameToHivemallStreamingOps(ds: DStream[HmLabeledPoint]): HivemallStreamingOps

Implicitly inject the HivemallStreamingOps into DStream.

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toString(): String

Definition Classes

AnyRef → Any

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
<?php

use App\Page;
use Illuminate\Database\Seeder;

class PagesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Page::truncate();
        factory(Page::class, 15)->create();
    }
}


text:
namespace ph
{

}// end namespace ph


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Acta microbiol. sin. 20(2): 123 (1980)

#### Original name
Phyllactinia desmodii J.F. Tao, J.Z. Qin & Y.Z. Shen

### Remarks
null


text:
package com.linecorp.armeria.server.saml;

import static java.util.Objects.requireNonNull;

import org.opensaml.saml.saml2.core.NameIDPolicy;
import org.opensaml.security.credential.Credential;

import com.google.common.base.MoreObjects;

import com.linecorp.armeria.common.annotation.Nullable;

/**
 * A configuration for an identity provider.
 */
public final class SamlIdentityProviderConfig {

    // IdP(Identity Provider) related:
    private final String entityId;
    private final Credential signingCredential;
    private final Credential encryptionCredential;
    private final SamlEndpoint ssoEndpoint;
    @Nullable
    private final SamlEndpoint sloReqEndpoint;
    @Nullable
    private final SamlEndpoint sloResEndpoint;

    // SP(Service Provider) related:
    @Nullable
    private final SamlEndpoint acsEndpoint;

    // AuthnRequest related:
    private final SamlNameIdPolicy nameIdPolicy;

    SamlIdentityProviderConfig(String entityId,
                               Credential signingCredential,
                               Credential encryptionCredential,
                               SamlEndpoint ssoEndpoint,
                               @Nullable SamlEndpoint sloReqEndpoint,
                               @Nullable SamlEndpoint sloResEndpoint,
                               @Nullable SamlEndpoint acsEndpoint,
                               SamlNameIdPolicy nameIdPolicy) {
        this.entityId = requireNonNull(entityId, "entityId");
        this.signingCredential = requireNonNull(signingCredential, "signingCredential");
        this.encryptionCredential = requireNonNull(encryptionCredential, "encryptionCredential");
        this.ssoEndpoint = requireNonNull(ssoEndpoint, "ssoEndpoint");
        this.sloReqEndpoint = sloReqEndpoint;
        this.sloResEndpoint = sloResEndpoint;
        this.acsEndpoint = acsEndpoint;
        this.nameIdPolicy = requireNonNull(nameIdPolicy, "nameIdPolicy");
    }

    /**
     * Returns an entity ID of the identity provider.
     */
    public String entityId() {
        return entityId;
    }

    /**
     * Returns a {@link Credential} of the identity provider for signing.
     */
    public Credential signingCredential() {
        return signingCredential;
    }

    /**
     * Returns a {@link Credential} of the identity provider for encryption.
     */
    public Credential encryptionCredential() {
        return encryptionCredential;
    }

    /**
     * Returns a {@link SamlEndpoint} of the identity provider for receiving an authentication request.
     */
    public SamlEndpoint ssoEndpoint() {
        return ssoEndpoint;
    }

    /**
     * Returns a {@link SamlEndpoint} of the identity provider for receiving a single logout request.
     */
    @Nullable
    public SamlEndpoint sloReqEndpoint() {
        return sloReqEndpoint;
    }

    /**
     * Returns a {@link SamlEndpoint} of the identity provider for receiving a single logout response.
     */
    @Nullable
    public SamlEndpoint sloResEndpoint() {
        return sloResEndpoint;
    }

    /**
     * Returns a {@link SamlEndpoint} of the service provider that the assertion will be sent to in response
     * to the authentication request.
     */
    @Nullable
    public SamlEndpoint acsEndpoint() {
        return acsEndpoint;
    }

    /**
     * Returns a {@link NameIDPolicy} of the service provider which is sent to the identity provider via
     * an authentication request.
     */
    public SamlNameIdPolicy nameIdPolicy() {
        return nameIdPolicy;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                          .add("entityId", entityId)
                          .add("signingCredential", signingCredential)
                          .add("encryptionCredential", encryptionCredential)
                          .add("ssoEndpoint", ssoEndpoint)
                          .add("sloReqEndpoint", sloReqEndpoint)
                          .add("sloResEndpoint", sloResEndpoint)
                          .add("acsEndpoint", acsEndpoint)
                          .add("nameIdPolicy", nameIdPolicy)
                          .toString();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.github.monchenkoid.project_9_10_14">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>

    <application
            android:name=".CoreApplication"
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.DarkActionBar">
        <meta-data
                android:name="com.google.android.gms.version"
                android:value="@integer/google_play_services_version"/>
        <activity
                android:name=".ui.activities.DetailsActivity"
                android:label="@string/title_activity_details"/>

        <activity
                android:name=".ui.activities.MainActivity"
                android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <meta-data
            android:name="com.crashlytics.ApiKey"
            android:value="734d9ca104fbaf410252a85a4b8520c9e0f80b99" />
    </application>

</manifest>


text:
require 'redmine'

Redmine::Plugin.register :redmine_restricted_members_managament do

  name 'Redmine Restricted Members Managament'
  author 'Dariusz Kowalski'
  description 'This plugin add restriction for member management'
  version '0.0.3'
  author_url 'https://github.com/darioo'
  url "https://github.com/darioo/redmine_restricted_members_managament" if respond_to?(:url)

   settings :default => { 'restricted_members_table' => {} },
           :partial => 'settings/restricted_memebers_managament'

end

require_dependency 'restricted_members_managament/patches/projects_controller_path'
require_dependency 'restricted_members_managament/patches/members_controller_path'


text:
//Description

//Write a program that reads from the console two integer numbers P and N and prints on the console the value of P's N-th bit.

namespace _12.N_thBit
{
    using System;

    class NthBit
    {
        static void Main()
        {
            long number = long.Parse(Console.ReadLine());
            int position = int.Parse(Console.ReadLine());

            long numAndPos = number >> position;
            long bit = numAndPos & 1;
            Console.WriteLine(bit);
        }
    }
}


text:
<?php

namespace SanAuth;

use Zend\ModuleManager\Feature\AutoloaderProviderInterface;

use Zend\Authentication\AuthenticationService;
use Zend\Authentication\Adapter\DbTable as DbTableAuthAdapter;

class Module implements AutoloaderProviderInterface
{
    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\ClassMapAutoloader' => array(
                __DIR__ . '/autoload_classmap.php',
            ),
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
            // if we're in a namespace deeper than one level we need to fix the \ in the path
                    __NAMESPACE__ => __DIR__ . '/src/' . str_replace('\\', '/' , __NAMESPACE__),
                ),
            ),
        );
    }

    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getServiceConfig()
    {
        return array(

    // setting db config immediately if necessary, ignore if already defined in global.php
    //   'db' => array(
    //	'username' => 'YOUR USERNAME HERE',
    //	'password' => 'YOUR PASSWORD HERE',
    //	'driver'         => 'Pdo',
    //	'dsn'            => 'mysql:dbname=zf2tutorial;host=localhost',
    //	'driver_options' => array(
    //	    PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
    //	),
    //    ),

            'factories'=>array(
//		 'Zend\Db\Adapter\Adapter'
  //                  => 'Zend\Db\Adapter\AdapterServiceFactory',

        'SanAuth\Model\MyAuthStorage' => function ($sm) {
            return new \SanAuth\Model\MyAuthStorage('zf_tutorial');
        },

        'AuthService' => function ($sm) {
            $dbAdapter      = $sm->get('Zend\Db\Adapter\Adapter');
                    $dbTableAuthAdapter  = new DbTableAuthAdapter($dbAdapter, 'fg_users','email','password', 'MD5(?)');

            $authService = new AuthenticationService();
            $authService->setAdapter($dbTableAuthAdapter);
            $authService->setStorage($sm->get('SanAuth\Model\MyAuthStorage'));

            return $authService;
        },
            ),
        );
    }

}


text:
// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html

var sourcePreprocessors = ['coverage'];

function isDebug() {
    return process.argv.indexOf('--debug') >= 0;
}

if (isDebug()) {
    // Disable JS minification if Karma is run with debug option.
    sourcePreprocessors = [];
}

module.exports = function (config) {
    config.set({
        // base path, that will be used to resolve files and exclude
        basePath: 'src/test/javascript/'.replace(/[^/]+/g,'..'),

        // testing framework to use (jasmine/mocha/qunit/...)
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            // bower:js
            'src/main/webapp/bower_components/jquery/dist/jquery.js',
            'src/main/webapp/bower_components/json3/lib/json3.js',
            'src/main/webapp/bower_components/messageformat/messageformat.js',
            'src/main/webapp/bower_components/lodash/lodash.js',
            'src/main/webapp/bower_components/sockjs-client/dist/sockjs.js',
            'src/main/webapp/bower_components/stomp-websocket/lib/stomp.min.js',
            'src/main/webapp/bower_components/perfect-scrollbar/src/perfect-scrollbar.js',
            'src/main/webapp/bower_components/showdown/src/showdown.js',
            'src/main/webapp/bower_components/jquery-ui/jquery-ui.js',
            'src/main/webapp/bower_components/angular/angular.js',
            'src/main/webapp/bower_components/angular-aria/angular-aria.js',
            'src/main/webapp/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
            'src/main/webapp/bower_components/angular-cache-buster/angular-cache-buster.js',
            'src/main/webapp/bower_components/angular-cookies/angular-cookies.js',
            'src/main/webapp/bower_components/ngstorage/ngStorage.js',
            'src/main/webapp/bower_components/angular-loading-bar/build/loading-bar.js',
            'src/main/webapp/bower_components/angular-resource/angular-resource.js',
            'src/main/webapp/bower_components/angular-sanitize/angular-sanitize.js',
            'src/main/webapp/bower_components/angular-ui-router/release/angular-ui-router.js',
            'src/main/webapp/bower_components/bootstrap-ui-datetime-picker/dist/datetime-picker.js',
            'src/main/webapp/bower_components/ng-file-upload/ng-file-upload.js',
            'src/main/webapp/bower_components/ngInfiniteScroll/build/ng-infinite-scroll.js',
            'src/main/webapp/bower_components/angular-gravatar/build/angular-gravatar.js',
            'src/main/webapp/bower_components/angular-animate/angular-animate.js',
            'src/main/webapp/bower_components/angular-ui-layout/src/ui-layout.js',
            'src/main/webapp/bower_components/angular-perfect-scrollbar/src/angular-perfect-scrollbar.js',
            'src/main/webapp/bower_components/angular-markdown-directive/markdown.js',
            'src/main/webapp/bower_components/angular-debounce/dist/angular-debounce.js',
            'src/main/webapp/bower_components/angular-mocks/angular-mocks.js',
            // endbower
            'src/main/webapp/app/app.module.js',
            'src/main/webapp/app/app.state.js',
            'src/main/webapp/app/app.constants.js',
            'src/main/webapp/app/**/*.+(js|html)',
            'src/test/javascript/spec/helpers/module.js',
            'src/test/javascript/spec/helpers/httpBackend.js',
            'src/test/javascript/**/!(karma.conf|protractor.conf).js'
        ],

        // list of files / patterns to exclude
        exclude: ['src/test/javascript/e2e/**'],

        preprocessors: {
            './**/*.js': sourcePreprocessors
        },

        reporters: ['dots', 'jenkins', 'coverage', 'progress'],

        jenkinsReporter: {

            outputFile: 'build/test-results/karma/TESTS-results.xml'
        },

        coverageReporter: {

            dir: 'build/test-results/coverage',
            reporters: [
                {type: 'lcov', subdir: 'report-lcov'}
            ]
        },

        // web server port
        port: 9876,

        // level of logging
        // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
        logLevel: config.LOG_INFO,

        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: false,

        // Start these browsers, currently available:
        // - Chrome
        // - ChromeCanary
        // - Firefox
        // - Opera
        // - Safari (only Mac)
        // - PhantomJS
        // - IE (only Windows)
        browsers: ['PhantomJS'],

        // Continuous Integration mode
        // if true, it capture browsers, run tests and exit
        singleRun: false,

        // to avoid DISCONNECTED messages when connecting to slow virtual machines
        browserDisconnectTimeout : 10000, // default 2000
        browserDisconnectTolerance : 1, // default 0
        browserNoActivityTimeout : 4*60*1000 //default 10000
    });
};


text:
{-# LANGUAGE RecordWildCards #-}

module Main where

import Numeric
import Control.Monad
import Text.Printf
import Text.PrettyPrint

import Foreign.CUDA.Analysis                            as CUDA
import qualified Foreign.CUDA.Driver                    as CUDA

main :: IO ()
main = do
  version       <- CUDA.driverVersion
  printf "CUDA device query (Driver API, statically linked)\n"
  printf "CUDA driver version %d.%d\n" (version`div`1000) ((version`mod`100)`div`10)

  CUDA.initialise []
  numDevices <- CUDA.count

  if numDevices == 0
     then printf "There are no available devices that support CUDA\n"
     else printf "Detected %d CUDA capable device%s\n" numDevices (if numDevices > 1 then "s" else "")

  forM_ [0 .. numDevices-1] $ \n -> do
    deviceProp <- CUDA.props =<< CUDA.device n
    printf "\nDevice %d: %s\n" n (deviceName deviceProp)
    statDevice deviceProp

statDevice :: DeviceProperties -> IO ()
statDevice dev@DeviceProperties{..} =
  let
      DeviceResources{..} = deviceResources dev

      pad v             = take width $ v ++ repeat ' '
      width             = maximum $ map (length . fst) props
      table             = nest 2 $ vcat $ map (\(k,v) -> text (pad k) <+> v) props

      grid (x,y)        = int x <+> char 'x' <+> int y
      cube (x,y,z)      = int x <+> char 'x' <+> int y <+> char 'x' <+> int z

      bool True         = text "Yes"
      bool False        = text "No"

      props =
        [("CUDA capability:",                    text $ show computeCapability)
        ,("CUDA cores:",                         text $ printf "%d cores in %d multiprocessors (%d cores/MP)" (coresPerMP * multiProcessorCount) multiProcessorCount coresPerMP)
        ,("Global memory:",                      text $ showBytes totalGlobalMem)
        ,("Constant memory:",                    text $ showBytes totalConstMem)
        ,("Shared memory per block:",            text $ showBytes sharedMemPerBlock)
        ,("Registers per block:",                int regsPerBlock)
        ,("Warp size:",                          int warpSize)
        ,("Maximum threads per multiprocessor:", int maxThreadsPerMultiProcessor)
        ,("Maximum threads per block:",          int maxThreadsPerBlock)
        ,("Maximum grid dimensions:",            cube maxGridSize)
        ,("Maximum block dimensions:",           cube maxBlockSize)
        ,("GPU clock rate:",                     text . showFreq $ clockRate * 1000)
        ,("Memory clock rate:",                  text . showFreq $ memClockRate * 1000)
        ,("Memory bus width:",                   int memBusWidth <> text "-bit")
        ,("L2 cache size:",                      text $ showBytes cacheMemL2)
        ,("Maximum texture dimensions",          empty)
        ,("  1D:",                               int maxTextureDim1D)
        ,("  2D:",                               grid maxTextureDim2D)
        ,("  3D:",                               cube maxTextureDim3D)
        ,("Texture alignment:",                  text $ showBytes textureAlignment)
        ,("Maximum memory pitch:",               text $ showBytes memPitch)
        ,("Concurrent kernel execution:",        bool concurrentKernels)
        ,("Concurrent copy and execution:",      bool deviceOverlap <> text (printf ", with %d copy engine%s" asyncEngineCount (if asyncEngineCount > 1 then "s" else "")))
        ,("Runtime limit on kernel execution:",  bool kernelExecTimeoutEnabled)
        ,("Integrated GPU sharing host memory:", bool integrated)
        ,("Host page-locked memory mapping:",    bool canMapHostMemory)
        ,("ECC memory support:",                 bool eccEnabled)
        ,("Unified addressing (UVA):",           bool unifiedAddressing)
        ,("PCI bus/location:",                   int (busID pciInfo) <> char '/' <> int (deviceID pciInfo))
        ,("Compute mode:",                       text (show computeMode))
        ]
  in
  putStrLn . render
    $ hang table 4
    $ case computeMode of
        Default          -> text "Multiple host threads can use the device simultaneously"
        Exclusive        -> text "Only one host thread in a process is able to use this device"
        Prohibited       -> text "No host thread can use this device"
        ExclusiveProcess -> text "Multiple threads in one process can use the device simultaneously"

showFreq :: Integral i => i -> String
showFreq x = showFFloatSIBase Nothing 1000 (fromIntegral x :: Double) "Hz"

showBytes :: Integral i => i -> String
showBytes x = showFFloatSIBase (Just 0) 1024 (fromIntegral x :: Double) "B"

showFFloatSIBase :: RealFloat a => Maybe Int -> a -> a -> ShowS
showFFloatSIBase p b n
  = showString
  $ showFFloat p n' (' ':si_unit)
  where
    n'          = n / (b ^^ pow)
    pow         = (-4) `max` floor (logBase b n) `min` 4        :: Int
    si_unit     = case pow of
                       -4 -> "p"
                       -3 -> "n"
                       -2 -> "µ"
                       -1 -> "m"
                       0  -> ""
                       1  -> "k"
                       2  -> "M"
                       3  -> "G"
                       4  -> "T"
                       _  -> error "out of range!"


text:
enum class ErrorType {
  // Data retrieved successfully.
  NONE,

  // Network error occurred.
  NET_ERROR,

  // Response from backend couldn't be read.
  SERVICE_ERROR,
};

std::string GetThumbnailImageOptionsForTesting();

// Background images are organized into collections, according to a theme. This
// struct contains the data required to display information about a collection,
// including a representative image. The complete set of CollectionImages must
// be requested separately, by referencing the identifier for this collection.
struct CollectionInfo {
  CollectionInfo();
  CollectionInfo(const CollectionInfo&);
  CollectionInfo(CollectionInfo&&);
  ~CollectionInfo();

  CollectionInfo& operator=(const CollectionInfo&);
  CollectionInfo& operator=(CollectionInfo&&);

  static CollectionInfo CreateFromProto(
      const ntp::background::Collection& collection);

  // A unique identifier for the collection.
  std::string collection_id;
  // A human-readable name for the collection.
  std::string collection_name;
  // A representative image from the collection.
  GURL preview_image_url;
};

bool operator==(const CollectionInfo& lhs, const CollectionInfo& rhs);
bool operator!=(const CollectionInfo& lhs, const CollectionInfo& rhs);

// Represents an image within a collection. The associated collection_id may be
// used to get CollectionInfo.
struct CollectionImage {
  CollectionImage();
  CollectionImage(const CollectionImage&);
  CollectionImage(CollectionImage&&);
  ~CollectionImage();

  CollectionImage& operator=(const CollectionImage&);
  CollectionImage& operator=(CollectionImage&&);

  // default_image_options are applied to the image.image_url() if options
  // (specifying resolution, cropping, etc) are not already present.
  static CollectionImage CreateFromProto(
      const std::string& collection_id,
      const ntp::background::Image& image,
      const std::string& default_image_options);

  // A unique identifier for the collection the image is in.
  std::string collection_id;
  // A unique identifier for the image.
  uint64_t asset_id;
  // The thumbnail image URL, typically lower resolution than the image_url.
  GURL thumbnail_image_url;
  // The image URL.
  GURL image_url;
  // The attribution list for the image.
  std::vector<std::string> attribution;
  // A URL that can be accessed to find out more information about the image.
  GURL attribution_action_url;
};

bool operator==(const CollectionImage& lhs, const CollectionImage& rhs);
bool operator!=(const CollectionImage& lhs, const CollectionImage& rhs);

// Represents errors that occur when communicating with the Backdrop service and
// Google Photos.
struct ErrorInfo {
  ErrorInfo();
  ErrorInfo(const ErrorInfo&);
  ErrorInfo(ErrorInfo&&);
  ~ErrorInfo();

  ErrorInfo& operator=(const ErrorInfo&);
  ErrorInfo& operator=(ErrorInfo&&);

  void ClearError();

  // Network error number, listed at chrome://network-errors.
  int net_error;

  // Category of error that occured.
  ErrorType error_type;
};

// Represents a custom background on the new tab page.
struct CustomBackground {
  CustomBackground();
  CustomBackground(const CustomBackground&);
  CustomBackground(CustomBackground&&);
  ~CustomBackground();

  CustomBackground& operator=(const CustomBackground&);
  CustomBackground& operator=(CustomBackground&&);

  // Url of the custom background selected by the user.
  GURL custom_background_url;

  // First attribution string for custom background.
  std::string custom_background_attribution_line_1;

  // Second attribution string for custom background.
  std::string custom_background_attribution_line_2;

  // Url to learn more info about the custom background.
  GURL custom_background_attribution_action_url;

  // Id of the collection being used for "daily refresh".
  std::string collection_id;

  // Main color of the image.
  SkColor custom_background_main_color;
};

#endif  // CHROME_BROWSER_SEARCH_BACKGROUND_NTP_BACKGROUND_DATA_H_


text:
function output = pomdpMusic(filename)

%get note information
midi = readmidi(filename);
notes = midiInfo(midi);

note_in_bar = zeros(1, 12); %Which notes were played in the current bar

quarter_notes_per_bar = 4; %Assume 4/4 time for now.
bar_length = 50000 * 4 * quarter_notes_per_bar / 1000000; %seconds per bar, based on default midi length.
next_bar_start = bar_length;

belief_state = zeros(1, 24);

output_index = 1;
for i = 1:length(notes) %for each input note

    %Get time of the note start
    note_start = notes(i, 5);
    note_end = notes(i, 6);
    note_num = notes(i, 3);

    if note_start > next_bar_start
       %Finished a bar, update belief state
       belief_state = detectKeyNew(note_in_bar);
       note_in_bar = zeros(1, 12);
       next_bar_start = next_bar_start + bar_length;
    end

    %add this note to the notes played this bar
    %Want 57 -> 1
    % 84 -> 4
    note_index = mod(note_num + 3, 12) + 1;
    note_in_bar(note_index) = 1;

    %If the note is above a certain value, I want to output another note
    %with it.
    %Calculate reward for each note

    if note_num > 60 && sum(belief_state) ~= 0

        rewards = rewardFunction(belief_state);

        %Find maximum reward, play that note.
        [r, idx] = max(rewards);

        % we want to play in a certain octave above middle C, so we want midi
        % notes 60-72
        midi_note = idx + 32;
        output_notes(output_index, :) = [notes(i, 1:2), midi_note, notes(i, 4:6)];
        output_index = output_index +1;
        %Add input note and generated note to output matrix

        output_notes(output_index, :) = notes(i, 1:6);
        output_index = output_index +1;
    end

    %Test our note conversion:
    octave = floor(note_num / 12) - 1;

    %output_notes(output_index, :) = [notes(i, 1:2), (note_index - 1) + (12*octave) + 9, notes(i, 4:6)];
    %output_index = output_index +1;

end

output = matrix2midi(output_notes, midi.ticks_per_quarter_note);

end


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width">
	<title>Exclusiveunlock:: <?php echo $Title; ?></title>

	<link rel="stylesheet" href="<?php echo base_url(); ?>css/style.css" type="text/css" media="screen">
	<link rel="stylesheet" href="<?php echo base_url(); ?>css/bootstrap.css" type="text/css" media="screen">
    <link rel="stylesheet" href="<?php echo base_url(); ?>css/demo_table.css" type="text/css" media="screen">
    <link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.2/css/select2.min.css" rel="stylesheet" />

Welcome Back, <?php echo $this->session->userdata('MemberFirstName') ." ". $this->session->userdata("MemberLastName"); ?>

Balance : <?php echo $credit[0]['credit'] ?> Credits

<a href="<?php echo site_url('member/dashboard/addfund'); ?>">+Add Fund

<a href="<?php echo site_url(); ?>" class="logo">

	<a href="<?php echo site_url('logout') ?>" class="btn btn-danger pull-right" >Logout

            <button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
            Toggle navigation

            </button>

            <li <?php echo($this->uri->uri_string()=='member/dashboard'?'class="active"':''); ?>><a href="<?php echo site_url('member/dashboard'); ?>">Home

            <li <?php echo($this->uri->uri_string(2)=='member/imeirequest'?'class="active"':''); ?>><a href="<?php echo site_url('member/imeirequest'); ?>">IMEI Request

            <li <?php echo($this->uri->uri_string(2)=='member/fileservices'?'class="active"':''); ?>><a href="<?php echo site_url('member/fileservices'); ?>">File Request

            <li <?php echo($this->uri->uri_string(2)=='member/imeirequest/history'?'class="active"':''); ?>><a href="<?php echo site_url('member/imeirequest/history'); ?>">IMEI History

            <?php /*<li <?php echo($this->uri->uri_string(2)=='member/imeirequest/verify'?'class="active"':''); ?>><a href="<?php echo site_url('member/imeirequest/verify'); ?>">Verify IMEI Request
*/ ?>
            <li <?php echo($this->uri->uri_string(2)=='member/fileservices/history'?'class="active"':''); ?>><a href="<?php echo site_url('member/fileservices/history'); ?>">File History

            <li <?php echo($this->uri->uri_string(2)=='member/dashboard/profile'?'class="active"':''); ?>><a href="<?php echo site_url('member/dashboard/profile'); ?>">My Account

<?php $this->load->view($template); ?>


text:
package org.springframework.boot.autoconfigure.test;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.core.annotation.AliasFor;

/**
 * Import and apply the selected auto-configuration classes for testing purposes. Applies
 * the same ordering rules as {@code @EnableAutoConfiguration} but restricts the
 * auto-configuration classes to the specified set, rather than consulting
 * {@code spring.factories}.
 *
 * @author Phillip Webb
 * @since 1.3.0
 * @deprecated as of 1.4 in favor of
 * {@link org.springframework.boot.autoconfigure.ImportAutoConfiguration}
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@org.springframework.boot.autoconfigure.ImportAutoConfiguration({})
@Deprecated
public @interface ImportAutoConfiguration {

	/**
	 * The auto-configuration classes that should be imported.
	 * @return the classes to import
	 */
	@AliasFor(annotation = org.springframework.boot.autoconfigure.ImportAutoConfiguration.class, attribute = "value")
	Class<?>[] value();

}


text:
const path = require('path');
const visit = require('unist-util-visit');

const isInternal = (url) => !url.includes(':') && !url.startsWith('//');

module.exports = ({ markdownNode, markdownAST, getNode, files }) => {
  if (!markdownNode.fileAbsolutePath) {
    return;
  }

  const filteredFiles = files.filter((x) => x && x.relativePath);

  const parentNode = getNode(markdownNode.parent);
  const parentNodeAbsoluteDir = parentNode.dir + '/';
  const parentNodeRelativeDir = path.posix.dirname(parentNode.relativePath) + '/';

  const fixUrl = (url) => {
    if (isInternal(url)) {
      const relativePath = path.posix.resolve('/', parentNodeRelativeDir, url);
      const rootlessRelativePath = relativePath.substr(1);

      const fileNode = filteredFiles.find((x) => x.relativePath === rootlessRelativePath);

      if (fileNode) {
        const relativePath = path.posix.relative(parentNodeAbsoluteDir, fileNode.absolutePath);

        return relativePath;
      }
    }

    return url;
  };

  visit(markdownAST, 'image', (node) => {
    node.url = fixUrl(node.url);
  });

  visit(markdownAST, 'link', (node) => {
    node.url = fixUrl(node.url);
  });

  const frontmatterImage = markdownNode.frontmatter && markdownNode.frontmatter.image;

  if (frontmatterImage) {
    markdownNode.frontmatter.image = fixUrl(frontmatterImage);
  }
};


text:
namespace System.Security.Policy
{

#if CONFIG_POLICY_OBJECTS

using System.Collections;
using System.Security.Permissions;

[Serializable]
public sealed class UrlMembershipCondition
	: IMembershipCondition, ISecurityEncodable, ISecurityPolicyEncodable
{
	// Internal state.
	private UrlParser parser;

	// Constructors.
	internal UrlMembershipCondition() {}
	public UrlMembershipCondition(String url)
			{
				if(url == null)
				{
					throw new ArgumentNullException("url");
				}
				parser = new UrlParser(url);
			}

	// Get or set this object's properties.
	public String Url
			{
				get
				{
					return parser.URL;
				}
				set
				{
					if(value == null)
					{
						throw new ArgumentNullException("value");
					}
					parser = new UrlParser(value);
				}
			}

	// Implement the IMembership interface.
	public bool Check(Evidence evidence)
			{
				if(evidence == null)
				{
					return false;
				}
				IEnumerator e = evidence.GetHostEnumerator();
				while(e.MoveNext())
				{
					Url url = (e.Current as Url);
					if(url != null)
					{
						if(parser.Matches(url.parser))
						{
							return true;
						}
					}
				}
				return false;
			}
	public IMembershipCondition Copy()
			{
				return new UrlMembershipCondition(parser.URL);
			}
	public override bool Equals(Object obj)
			{
				UrlMembershipCondition other;
				other = (obj as UrlMembershipCondition);
				if(other != null)
				{
					return (other.parser.URL == parser.URL);
				}
				else
				{
					return false;
				}
			}
	public override String ToString()
			{
				return "Url - " + parser.URL;
			}

	// Implement the ISecurityEncodable interface.
	public void FromXml(SecurityElement et)
			{
				FromXml(et, null);
			}
	public SecurityElement ToXml()
			{
				return ToXml(null);
			}

	// Implement the ISecurityPolicyEncodable interface.
	public void FromXml(SecurityElement et, PolicyLevel level)
			{
				if(et == null)
				{
					throw new ArgumentNullException("et");
				}
				if(et.Tag != "IMembershipCondition")
				{
					throw new ArgumentException(_("Security_PolicyName"));
				}
				if(et.Attribute("version") != "1")
				{
					throw new ArgumentException(_("Security_PolicyVersion"));
				}
				String value = et.Attribute("Url");
				if(value != null)
				{
					parser = new UrlParser(value);
				}
				else
				{
					throw new ArgumentException(_("Arg_InvalidUrl"));
				}
			}
	public SecurityElement ToXml(PolicyLevel level)
			{
				SecurityElement element;
				element = new SecurityElement("IMembershipCondition");
				element.AddAttribute
					("class",
					 SecurityElement.Escape(typeof(UrlMembershipCondition).
					 						AssemblyQualifiedName));
				element.AddAttribute("version", "1");
				element.AddAttribute("Url", SecurityElement.Escape(parser.URL));
				return element;
			}

	// Get the hash code for this instance.
	public override int GetHashCode()
			{
				return parser.URL.GetHashCode();
			}

}; // class UrlMembershipCondition

#endif // CONFIG_POLICY_OBJECTS

}; // namespace System.Security.Policy


text:
import * as AbilityModels from "../models/abilities";

export namespace Abilities {
    export const AbilityList: { [index: string]: AbilityModels.Ability } = {};

    export const Strength: AbilityModels.Ability = new AbilityModels.Ability("STR", "Strength");
    export const Dexterity: AbilityModels.Ability = new AbilityModels.Ability("DEX", "Dexterity");
    export const Constitution: AbilityModels.Ability = new AbilityModels.Ability("CON", "Constitution");
    export const Wisdom: AbilityModels.Ability = new AbilityModels.Ability("WIS", "Wisdom");
    export const Intelligence: AbilityModels.Ability = new AbilityModels.Ability("INT", "Intelligence");
    export const Charisma: AbilityModels.Ability = new AbilityModels.Ability("CHA", "Charisma");

    AbilityList[Strength.code] = Strength;
    AbilityList[Dexterity.code] = Dexterity;
    AbilityList[Constitution.code] = Constitution;
    AbilityList[Wisdom.code] = Wisdom;
    AbilityList[Intelligence.code] = Intelligence;
    AbilityList[Charisma.code] = Charisma;
};


text:
package org.apache.shardingsphere.test.integration.engine;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.test.integration.env.IntegrationTestEnvironment;

/**
 * Total test suites count calculator.
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class TotalSuitesCountCalculator {

    private static final IntegrationTestEnvironment ENV = IntegrationTestEnvironment.getInstance();

    private static final int GENERIC_SUITES_COUNT = 4;

    private static final int ADDITIONAL_SUITES_COUNT = 2;

    private static final int DCL_SUITES_COUNT = 1;

    private static final int DAL_SUITES_COUNT = 1;

    private static final int DISTSQL_SUITES_COUNT = 3;

    /**
     * Calculate total test suites count.
     *
     * @return total test suites count
     */
    public static int calculate() {
        int result = GENERIC_SUITES_COUNT;
        if (ENV.isRunAdditionalTestCases()) {
            result += ADDITIONAL_SUITES_COUNT;
        }
        if (isRunDCL()) {
            result += DCL_SUITES_COUNT;
        }
        if (isRunProxy()) {
            result += DAL_SUITES_COUNT;
            result += DISTSQL_SUITES_COUNT;
        }
        return result;
    }

    private static boolean isRunDCL() {
        return ENV.getRunModes().contains("Cluster");
    }

    private static boolean isRunProxy() {
        return ENV.getRunModes().contains("Cluster") && ENV.getClusterEnvironment().getAdapters().contains("proxy");
    }
}


text:
package org.apache.velocity.app.event.implement;

import org.apache.velocity.app.event.IncludeEventHandler;
import org.apache.velocity.context.Context;

/**
 *
Event handler that looks for included files relative to the path of the
 * current template. The handler assumes that paths are separated by a forward
 * slash "/" or backwards slash "\".
 *
 * @author Will Glass-Husain
 * @version $Id$
 * @since 1.5
 */
public class IncludeRelativePath implements IncludeEventHandler {

    /**
     * Return path relative to the current template's path.
     *
     * @param includeResourcePath  the path as given in the include directive.
     * @param currentResourcePath the path of the currently rendering template that includes the
     *            include directive.
     * @param directiveName  name of the directive used to include the resource. (With the
     *            standard directives this is either "parse" or "include").

     * @return new path relative to the current template's path
     */
    @Override
    public String includeEvent(
        Context context,
        String includeResourcePath,
        String currentResourcePath,
        String directiveName)
    {
        // if the resource name starts with a slash, it's not a relative path
        if (includeResourcePath.startsWith("/") || includeResourcePath.startsWith("\\") ) {
            return includeResourcePath;
        }

        int lastslashpos = Math.max(
                currentResourcePath.lastIndexOf("/"),
                currentResourcePath.lastIndexOf("\\")
                );

        // root of resource tree
        if (lastslashpos == -1) {
            return includeResourcePath;
        }

        // prepend path to the include path
        return currentResourcePath.substring(0,lastslashpos) + "/" + includeResourcePath;
    }
}


text:
using Hearthstone_Deck_Tracker.Hearthstone;
using Shamanic.Properties;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static HearthDb.CardIds.Collectible.Shaman;

namespace Shamanic.Effects
{
    internal class OverloadTotal : IEffectConfig
    {
        public string Name => Strings.Get("OverloadTotalEffectName");
        public string[] Cards => new string[] { SnowfuryGiantCore };
        public DisplayMode Player => Settings.Default.PlayerShowOverloadTotal;
        public DisplayMode Opponent => Settings.Default.OpponentShowOverloadTotal;
        public Predicate<Card> Condition => card => card.Overload > 0;
        public Func<Card,int> Increment => card => card.Overload;
        public IncrementOn IncrementOn => IncrementOn.Play;
    }
}


text:
descr   = """Talkbox, to make your numpy environment speech aware !

Talkbox is set of python modules for speech/signal processing. The goal of this
toolbox is to be a sandbox for features which may end up in scipy at some
point. The following features are planned before a 1.0 release:

    * Spectrum estimation related functions: both parametic (lpc, high
    resolution methods like music and co), and non-parametric (Welch,
    periodogram)
    * Fourier-like transforms (DCT, DST, MDCT, etc...)
    * Basic signal processing tasks such as resampling
    * Speech related functionalities: mfcc, mel spectrum, etc..
    * More as it comes

I want talkbox to be useful for both research and educational purpose. As such,
a requirement is to have a pure python implementation for everything - for
educational purpose and reproducibility - and optional C for speed."""

DISTNAME            = 'scikits.talkbox'
DESCRIPTION         = 'Talkbox, a set of python modules for speech/signal processing'
LONG_DESCRIPTION    = descr
MAINTAINER          = 'David Cournapeau',
MAINTAINER_EMAIL    = 'david@ar.media.kyoto-u.ac.jp',
URL                 = 'http://projects.scipy.org/scipy/scikits'
LICENSE             = 'MIT'
DOWNLOAD_URL        = URL

MAJOR = 0
MINOR = 2
MICRO = 3
DEV = False

CLASSIFIERS = [ 'Development Status :: 1 - Planning',
              'Environment :: Console',
              'Intended Audience :: Developers',
              'Intended Audience :: Science/Research',
              'License :: OSI Approved :: BSD License',
              'Topic :: Scientific/Engineering']

def build_verstring():
    return '%d.%d.%d' % (MAJOR, MINOR, MICRO)

def build_fverstring():
    if DEV:
        return build_verstring() + '.dev'
    else:
        return build_verstring()

def write_version(fname):
    f = open(fname, "w")
    f.write("""
short_version='%s'
version=short_version
dev=%s
if dev:
    version += '.dev'
""" % (build_verstring(), DEV))
    f.close()

VERSION = build_fverstring()
INSTALL_REQUIRE = 'numpy'


text:
import React from 'react';
import { mount } from 'enzyme';
import toJson from 'enzyme-to-json';
import { ThemeProvider } from 'styled-components';
import { theme } from 'mcs-lite-theme';
import { StyledButton, NaWrapper } from '../styled-components';

jest.mock('mcs-lite-ui/lib/Button');

it('should render components correctly', () => {
  const wrapper = mount(
    <ThemeProvider theme={theme}>
      <div>
        <StyledButton />
        <NaWrapper />
      </div>
    </ThemeProvider>,
  );

  expect(toJson(wrapper.find('div'))).toMatchSnapshot();
});


text:
import sys
import yaml
import unittest

# Load Module
sys.path.append('../src')
import cobbler_puppet

class EncParserTests(unittest.TestCase):

    def setUp(self):
        self.enc = cobbler_puppet.EncParser(yaml.load('---\nclasses:\n  ntp:\n  foobar:\n  whatever:\nparameters:\n  cobbler_system_name: web.example.com\n  cobbler_hostname: web.example.com\n  cobbler_profile: default\n  cobbler_kernel_opts:\n    aspci: "off"\n    quiet: None\n  cobbler_ks_meta:\n    location: Atlanta\n  cobbler_interfaces:\n    eth0:\n      mac: DE:AD:DE:AD:BE:EF\n      ipaddress: 192.168.2.2\n      netmask: 255.255.255.0\n      gateway: 192.168.2.1'))

    def testParsing(self):
        print "Testing parsing..."
        self.assertEqual(self.enc.hostname, "web.example.com")
        self.assertEqual(self.enc.system_name, "web.example.com")
        self.assertEqual(self.enc.profile, "default")
        self.assertEqual(self.enc.kernel_opts["aspci"], "off")
        self.assertEqual(self.enc.kernel_opts["quiet"], 'None')
        self.assertEqual(self.enc.ks_meta["location"], "Atlanta")
        self.assertEqual(self.enc.interfaces["eth0"]["mac"], "DE:AD:DE:AD:BE:EF")
        self.assertEqual(self.enc.interfaces["eth0"]["ipaddress"], "192.168.2.2")
        self.assertEqual(self.enc.interfaces["eth0"]["netmask"], "255.255.255.0")
        self.assertEqual(self.enc.interfaces["eth0"]["gateway"], "192.168.2.1")

    def testMissing(self):
        print "Testing missing parameter..."
        try:
            self.enc.boogers
        except cobbler_puppet.EncParameterNotFound:
            pass
        else:
            self.fail("EncParameterNotFound not thrown.")

if __name__ == "__main__":
    unittest.main()


text:
NEXT
Sign up for a Team3 KickAss PXE

    <form class="login">

Welcome to

            Vamos PXE

Use your Company ID to sign in or create one now

            <input class="username" [(ngModel)]="user" name="user" type="text" id="login_username" placeholder="Username">
            <input class="password" [(ngModel)]="password" name="password" type="password" id="login_password" placeholder="Password">

                <input type="checkbox" id="rememberme">

                    Remember me

            <ng-container *ngIf="messagelogin">

                  {{messagelogin}}

            </ng-container>
            <button type="submit" (click)="onClick()" class="btn btn-primary">NEXT</button>

    </form>


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

/**
 * @fileoverview Provides the TimelineSliceGroup class.
 */
base.require('range');
base.require('timeline_slice');
base.require('timeline_color_scheme');
base.require('timeline_filter');

base.exportTo('tracing', function() {
  var TimelineSlice = tracing.TimelineSlice;

  /**
   * A group of TimelineSlices, plus code to create them from B/E events, as
   * well as arrange them into subRows.
   *
   * Do not mutate the slices array directly. Modify it only by
   * TimelineSliceGroup mutation methods.
   *
   * @constructor
   * @param {function(new:TimelineSlice, category, title, colorId, start, args)}
   *     opt_sliceConstructor The constructor to use when creating slices.
   */
  function TimelineSliceGroup(opt_sliceConstructor) {
    var sliceConstructor = opt_sliceConstructor || TimelineSlice;
    this.sliceConstructor = sliceConstructor;

    this.openPartialSlices_ = [];

    this.slices = [];
    this.bounds = new base.Range();
  }

  TimelineSliceGroup.prototype = {
    __proto__: Object.prototype,

    /**
     * Helper function that pushes the provided slice onto the slices array.
     * @param {TimelineSlice} slice The slice to be added to the slices array.
     */
    pushSlice: function(slice) {
      this.slices.push(slice);
      return slice;
    },

    /**
     * Helper function that pushes the provided slice onto the slices array.
     * @param {Array.<TimelineSlice>} slices An array of slices to be added.
     */
    pushSlices: function(slices) {
      this.slices.push.apply(this.slices, slices);
    },

    /**
     * Opens a new slice in the group's slices.
     *
     * Calls to beginSlice and
     * endSlice must be made with non-monotonically-decreasing timestamps.
     *
     * @param {String} title Title of the slice to add.
     * @param {Number} ts The timetsamp of the slice, in milliseconds.
     * @param {Object.<string, Object>} opt_args Arguments associated with
     * the slice.
     */
    beginSlice: function(category, title, ts, opt_args) {
      if (this.openPartialSlices_.length) {
        var prevSlice = this.openPartialSlices_[
            this.openPartialSlices_.length - 1];
        if (ts < prevSlice.start)
          throw new Error('Slices must be added in increasing timestamp order');
      }

      var colorId = tracing.getStringColorId(title);
      var slice = new this.sliceConstructor(category, title, colorId, ts,
                                            opt_args ? opt_args : {});
      this.openPartialSlices_.push(slice);
      return slice;
    },

    isTimestampValidForBeginOrEnd: function(ts) {
      if (!this.openPartialSlices_.length)
        return true;
      var top = this.openPartialSlices_[this.openPartialSlices_.length - 1];
      return ts >= top.start;
    },

    /**
     * @return {Number} The number of beginSlices for which an endSlice has not
     * been issued.
     */
    get openSliceCount() {
      return this.openPartialSlices_.length;
    },

    /**
     * Ends the last begun slice in this group and pushes it onto the slice
     * array.
     *
     * @param {Number} ts Timestamp when the slice ended.
     * @return {TimelineSlice} slice.
     */
    endSlice: function(ts) {
      if (!this.openSliceCount)
        throw new Error('endSlice called without an open slice');
      var slice = this.openPartialSlices_[this.openSliceCount - 1];
      this.openPartialSlices_.splice(this.openSliceCount - 1, 1);
      if (ts < slice.start)
        throw new Error('Slice ' + slice.name +
                        ' end time is before its start.');

      slice.duration = ts - slice.start;
      this.pushSlice(slice);

      return slice;
    },

    /**
     * Closes any open slices.
     * @param {Number} opt_maxTimestamp The end time to use for the closed
     * slices. If not provided,
     * the max timestamp for this slice is provided.
     */
    autoCloseOpenSlices: function(opt_maxTimestamp) {
      if (!opt_maxTimestamp) {
        this.updateBounds();
        opt_maxTimestamp = this.bounds.max;
      }
      while (this.openSliceCount > 0) {
        var slice = this.endSlice(opt_maxTimestamp);
        slice.didNotFinish = true;
      }
    },

    /**
     * Shifts all the timestamps inside this group forward by the amount
     * specified.
     */
    shiftTimestampsForward: function(amount) {
      for (var sI = 0; sI < this.slices.length; sI++) {
        var slice = this.slices[sI];
        slice.start = (slice.start + amount);
      }
      for (var sI = 0; sI < this.openPartialSlices_.length; sI++) {
        var slice = this.openPartialSlices_[i];
        slice.start = (slice.start + amount);
      }
    },

    /**
     * Updates the bounds for this group based on the slices it contains.
     */
    updateBounds: function() {
      this.bounds.reset();
      for (var i = 0; i < this.slices.length; i++) {
        this.bounds.addValue(this.slices[i].start);
        this.bounds.addValue(this.slices[i].end);
      }

      if (this.openPartialSlices_.length) {
        this.bounds.addValue(this.openPartialSlices_[0].start);
        this.bounds.addValue(
            this.openPartialSlices_[this.openPartialSlices_.length - 1].start);
      }
    }
  };

  return {
    TimelineSliceGroup: TimelineSliceGroup
  };
});


text:
<!doctype html>
<html>
<head>
    <title>MediaRecorder Pause and Resume</title>
    <link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#mediarecorder">
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="utils/sources.js"></script>
</head>
<body>
<script>
    function recordEvents(target, events) {
        let arr = [];
        for (let ev of events) {
            target.addEventListener(ev, _ => arr.push(ev));
        }
        return arr;
    }

    promise_test(async t => {
        const {stream: video, control} = createVideoStream(t);
        control.addVideoFrame();
        const recorder = new MediaRecorder(video);
        const events = recordEvents(recorder,
            ["start", "stop", "dataavailable", "pause", "resume", "error"]);

        recorder.start();
        assert_equals(recorder.state, "recording", "MediaRecorder has been started successfully");
        await new Promise(r => recorder.onstart = r);

        recorder.pause();
        assert_equals(recorder.state, "paused", "MediaRecorder should be paused immediately following pause()");

        // A second call to pause should be idempotent
        recorder.pause();
        assert_equals(recorder.state, "paused", "MediaRecorder should be paused immediately following pause()");

        let event = await new Promise(r => recorder.onpause = r);
        assert_equals(event.type, "pause", "the event type should be pause");
        assert_true(event.isTrusted, "isTrusted should be true when the event is created by C++");

        recorder.resume();
        assert_equals(recorder.state, "recording", "MediaRecorder state should be recording immediately following resume() call");

        // A second call to resume should be idempotent
        recorder.resume();
        assert_equals(recorder.state, "recording", "MediaRecorder state should be recording immediately following resume() call");

        event = await new Promise(r => recorder.onresume = r);
        assert_equals(event.type, "resume", "the event type should be resume");
        assert_true(event.isTrusted, "isTrusted should be true when the event is created by C++");

        recorder.stop();
        await new Promise(r => recorder.onstop = r);

        assert_array_equals(events, ["start", "pause", "resume", "dataavailable", "stop"],
            "Should have gotten expected events");
    }, "MediaRecorder handles pause() and resume() calls appropriately in state and events");

    promise_test(async () => {
        let video = createVideoStream();
        let recorder = new MediaRecorder(video);
        let events = recordEvents(recorder,
            ["start", "stop", "dataavailable", "pause", "resume", "error"]);

        recorder.start();
        assert_equals(recorder.state, "recording", "MediaRecorder has been started successfully");
        await new Promise(r => recorder.onstart = r);

        recorder.pause();
        assert_equals(recorder.state, "paused", "MediaRecorder should be paused immediately following pause()");
        let event = await new Promise(r => recorder.onpause = r);
        assert_equals(event.type, "pause", "the event type should be pause");
        assert_true(event.isTrusted, "isTrusted should be true when the event is created by C++");

        recorder.stop();
        assert_equals(recorder.state, "inactive", "MediaRecorder should be inactive after being stopped");
        await new Promise(r => recorder.onstop = r);

        recorder.start();
        assert_equals(recorder.state, "recording", "MediaRecorder has been started successfully");
        await new Promise(r => recorder.onstart = r);

        assert_array_equals(events, ["start", "pause", "dataavailable", "stop", "start"],
            "Should have gotten expected events");
    }, "MediaRecorder handles stop() in paused state appropriately");
</script>
</body>
</html>


text:
import React            from 'react';

import CounterComponent from '../../components/counter';

class HomePage extends React.Component {

  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div className="home-page">
        <CounterComponent {...this.props} />
      </div>
    );
  }

}

HomePage.propTypes = {
  count: React.PropTypes.number,
  incrementCount: React.PropTypes.func,
  decrementCount: React.PropTypes.func
};

export default HomePage;


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Excipulina valtellinensis Traverso, 1903

### Remarks
null