text:
package org.apache.tinkerpop.gremlin.process.traversal.util;

import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.VertexProgramStep;
import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.TraverserGenerator;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.DefaultTraverserGeneratorFactory;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.EmptyTraverser;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.util.CloseableIterator;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;

import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.Set;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class DefaultTraversal<S, E> implements Traversal.Admin<S, E> {

    private Traverser.Admin<E> lastTraverser = EmptyTraverser.instance();
    private Step<?, E> finalEndStep = EmptyStep.instance();
    private final StepPosition stepPosition = new StepPosition();
    protected transient Graph graph;
    protected transient TraversalSource g;
    protected List<Step> steps = new ArrayList<>();
    // steps will be repeatedly retrieved from this traversal so wrap them once in an immutable list that can be reused
    protected List<Step> unmodifiableSteps = Collections.unmodifiableList(steps);
    protected TraversalParent parent = EmptyStep.instance();
    protected TraversalSideEffects sideEffects = new DefaultTraversalSideEffects();
    protected TraversalStrategies strategies;
    protected transient TraverserGenerator generator;
    protected Set<TraverserRequirement> requirements;

    protected boolean locked = false;
    protected boolean closed = false;
    protected Bytecode bytecode;

    private DefaultTraversal(final Graph graph, final TraversalStrategies traversalStrategies, final Bytecode bytecode) {
        this.graph = graph;
        this.strategies = traversalStrategies;
        this.bytecode = bytecode;
        this.g = null;
    }

    public DefaultTraversal(final Graph graph) {
        this(graph, TraversalStrategies.GlobalCache.getStrategies(graph.getClass()), new Bytecode());
    }

    public DefaultTraversal(final TraversalSource traversalSource) {
        this(traversalSource.getGraph(), traversalSource.getStrategies(), traversalSource.getBytecode());
        this.g = traversalSource;
    }

    public DefaultTraversal(final TraversalSource traversalSource, final DefaultTraversal.Admin<S,E> traversal) {
        this(traversalSource.getGraph(), traversalSource.getStrategies(), traversal.getBytecode());
        this.g = traversalSource;
        steps.addAll(traversal.getSteps());
    }

    public DefaultTraversal() {
        this(EmptyGraph.instance(), TraversalStrategies.GlobalCache.getStrategies(EmptyGraph.class), new Bytecode());
    }

    public DefaultTraversal(final Bytecode bytecode) {
        this(EmptyGraph.instance(), TraversalStrategies.GlobalCache.getStrategies(EmptyGraph.class), bytecode);
    }

    public Bytecode getBytecode() {
        return this.bytecode;
    }

    @Override
    public Traversal.Admin<S, E> asAdmin() {
        return this;
    }

    @Override
    public TraverserGenerator getTraverserGenerator() {
        if (null == this.generator)
            this.generator = isRoot() ?
                    DefaultTraverserGeneratorFactory.instance().getTraverserGenerator(this.getTraverserRequirements()) :
                    TraversalHelper.getRootTraversal(this).getTraverserGenerator();
        return this.generator;
    }

    @Override
    public void applyStrategies() throws IllegalStateException {
        if (this.locked) throw Traversal.Exceptions.traversalIsLocked();
        TraversalHelper.reIdSteps(this.stepPosition, this);
        final boolean hasGraph = null != this.graph;

        // we only want to apply strategies on the top-level step or if we got some graphcomputer stuff going on.
        // seems like in that case, the "top-level" of the traversal is really held by the VertexProgramStep which
        // needs to have strategies applied on "pure" copies of the traversal it is holding (i think). it further
        // seems that we need three recursions over the traversal hierarchy to ensure everything "works", where
        // strategy application requires top-level strategies and side-effects pushed into each child and then after
        // application of the strategies we need to call applyStrategies() on all the children to ensure that their
        // steps get reId'd and traverser requirements are set.
        if (isRoot() || this.getParent() instanceof VertexProgramStep) {

            // prepare the traversal and all its children for strategy application
            TraversalHelper.applyTraversalRecursively(t -> {
                if (hasGraph) t.setGraph(this.graph);
                t.setStrategies(this.strategies);
                t.setSideEffects(this.sideEffects);
            }, this);

            // note that prior to applying strategies to children we used to set side-effects and strategies of all
            // children to that of the parent. under this revised model of strategy application from TINKERPOP-1568
            // it doesn't appear to be necessary to do that (at least from the perspective of the test suite). by,
            // moving side-effect setting after actual recursive strategy application we save a loop and by
            // consequence also fix a problem where strategies might reset something in sideeffects which seems to
            // happen in TranslationStrategy.
            final Iterator<TraversalStrategy<?>> strategyIterator = this.strategies.iterator();
            while (strategyIterator.hasNext()) {
                final TraversalStrategy<?> strategy = strategyIterator.next();
                TraversalHelper.applyTraversalRecursively(t -> {
                    strategy.apply(t);

                    // after the strategy is applied, it may have modified the traversal where a new traversal object
                    // was added. if the strategy didn't set the Graph object it could leave that new traversal in a
                    // state where another strategy might fail if that dependency is not satisfied
                    TraversalHelper.applyTraversalRecursively(i -> {
                        if (hasGraph) i.setGraph(this.graph);
                    }, this);
                }, this);
            }

            // don't need to re-apply strategies to "this" - leads to endless recursion in GraphComputer.
            TraversalHelper.applyTraversalRecursively(t -> {
                if (hasGraph) t.setGraph(this.graph);
                if(!(t.isRoot()) && t != this && !t.isLocked()) {
                    t.setSideEffects(this.sideEffects);
                    t.applyStrategies();
                }
            }, this);
        }

        this.finalEndStep = this.getEndStep();

        // finalize requirements
        if (this.isRoot()) {
            resetTraverserRequirements();
        }
        this.locked = true;
    }

    private void resetTraverserRequirements() {
        this.requirements = null;
        this.getTraverserRequirements();
    }

    @Override
    public Set<TraverserRequirement> getTraverserRequirements() {
        if (null == this.requirements) {
            this.requirements = EnumSet.noneOf(TraverserRequirement.class);
            for (final Step<?, ?> step : this.getSteps()) {
                this.requirements.addAll(step.getRequirements());
            }
            if (!this.requirements.contains(TraverserRequirement.LABELED_PATH) && TraversalHelper.hasLabels(this))
                this.requirements.add(TraverserRequirement.LABELED_PATH);
            if (!this.getSideEffects().keys().isEmpty())
                this.requirements.add(TraverserRequirement.SIDE_EFFECTS);
            if (null != this.getSideEffects().getSackInitialValue())
                this.requirements.add(TraverserRequirement.SACK);
            if (this.requirements.contains(TraverserRequirement.ONE_BULK))
                this.requirements.remove(TraverserRequirement.BULK);
            this.requirements = Collections.unmodifiableSet(this.requirements);
        }
        return this.requirements;
    }

    @Override
    public List<Step> getSteps() {
        return this.unmodifiableSteps;
    }

    @Override
    public Traverser.Admin<E> nextTraverser() {
        try {
            if (!this.locked) this.applyStrategies();
            if (this.lastTraverser.bulk() > 0L) {
                final Traverser.Admin<E> temp = this.lastTraverser;
                this.lastTraverser = EmptyTraverser.instance();
                return temp;
            } else {
                return this.finalEndStep.next();
            }
        } catch (final FastNoSuchElementException e) {
            throw this.isRoot() ? new NoSuchElementException() : e;
        }
    }

    @Override
    public boolean hasNext() {
        // if the traversal is closed then resources are released and there is nothing else to iterate
        if (this.isClosed()) return false;

        if (!this.locked) this.applyStrategies();
        final boolean more = this.lastTraverser.bulk() > 0L || this.finalEndStep.hasNext();
        if (!more) CloseableIterator.closeIterator(this);
        return more;
    }

    @Override
    public E next() {
        // if the traversal is closed then resources are released and there is nothing else to iterate
        if (this.isClosed())
            throw this.parent instanceof EmptyStep ? new NoSuchElementException() : FastNoSuchElementException.instance();

        try {
            if (!this.locked) this.applyStrategies();
            if (this.lastTraverser.bulk() == 0L)
                this.lastTraverser = this.finalEndStep.next();
            this.lastTraverser.setBulk(this.lastTraverser.bulk() - 1L);
            return this.lastTraverser.get();
        } catch (final FastNoSuchElementException e) {
            // No more elements will be produced by this traversal. Close this traversal
            // and release the resources.
            CloseableIterator.closeIterator(this);

            throw this.isRoot() ? new NoSuchElementException() : e;
        }
    }

    @Override
    public void reset() {
        this.steps.forEach(Step::reset);
        this.finalEndStep.reset();
        this.lastTraverser = EmptyTraverser.instance();
        this.closed = false;
    }

    @Override
    public void addStart(final Traverser.Admin<S> start) {
        if (!this.locked) this.applyStrategies();
        if (!this.steps.isEmpty()) {
            this.steps.get(0).addStart(start);

            // match() expects that a traversal that has been iterated can continue to iterate if new starts are
            // added therefore the closed state must be reset.
            this.closed = false;
        }
    }

    @Override
    public void addStarts(final Iterator<Traverser.Admin<S>> starts) {
        if (!this.locked) this.applyStrategies();

        if (!this.steps.isEmpty()) {
            this.steps.get(0).addStarts(starts);

            // match() expects that a traversal that has been iterated can continue to iterate if new starts are
            // added therefore the closed state must be reset.
            this.closed = false;
        }
    }

    @Override
    public String toString() {
        return StringFactory.traversalString(this);
    }

    @Override
    public Step<S, ?> getStartStep() {
        return this.steps.isEmpty() ? EmptyStep.instance() : this.steps.get(0);
    }

    @Override
    public Step<?, E> getEndStep() {
        return this.steps.isEmpty() ? EmptyStep.instance() : this.steps.get(this.steps.size() - 1);
    }

    @Override
    public DefaultTraversal<S, E> clone() {
        try {
            final DefaultTraversal<S, E> clone = (DefaultTraversal<S, E>) super.clone();
            clone.lastTraverser = EmptyTraverser.instance();
            clone.steps = new ArrayList<>();
            clone.unmodifiableSteps = Collections.unmodifiableList(clone.steps);
            clone.sideEffects = this.sideEffects.clone();
            clone.strategies = this.strategies;
            clone.bytecode = this.bytecode.clone();
            for (final Step<?, ?> step : this.steps) {
                final Step<?, ?> clonedStep = step.clone();
                clonedStep.setTraversal(clone);
                final Step previousStep = clone.steps.isEmpty() ? EmptyStep.instance() : clone.steps.get(clone.steps.size() - 1);
                clonedStep.setPreviousStep(previousStep);
                previousStep.setNextStep(clonedStep);
                clone.steps.add(clonedStep);
            }
            clone.finalEndStep = clone.getEndStep();
            clone.closed = false;
            return clone;
        } catch (final CloneNotSupportedException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }

    @Override
    public boolean isLocked() {
        return this.locked;
    }

    /**
     * Determines if the traversal has been fully iterated and resources released.
     */
    public boolean isClosed() {
        return closed;
    }

    @Override
    public void notifyClose() {
        this.closed = true;
    }

    @Override
    public void setSideEffects(final TraversalSideEffects sideEffects) {
        this.sideEffects = sideEffects;
    }

    @Override
    public TraversalSideEffects getSideEffects() {
        return this.sideEffects;
    }

    @Override
    public void setStrategies(final TraversalStrategies strategies) {
        this.strategies = strategies;
    }

    @Override
    public TraversalStrategies getStrategies() {
        return this.strategies;
    }

    @Override
    public <S2, E2> Traversal.Admin<S2, E2> addStep(final int index, final Step<?, ?> step) throws IllegalStateException {
        if (this.locked) throw Exceptions.traversalIsLocked();
        step.setId(this.stepPosition.nextXId());
        this.steps.add(index, step);
        final Step previousStep = this.steps.size() > 0 && index != 0 ? steps.get(index - 1) : null;
        final Step nextStep = this.steps.size() > index + 1 ? steps.get(index + 1) : null;
        step.setPreviousStep(null != previousStep ? previousStep : EmptyStep.instance());
        step.setNextStep(null != nextStep ? nextStep : EmptyStep.instance());
        if (null != previousStep) previousStep.setNextStep(step);
        if (null != nextStep) nextStep.setPreviousStep(step);
        step.setTraversal(this);
        return (Traversal.Admin<S2, E2>) this;
    }

    @Override
    public <S2, E2> Traversal.Admin<S2, E2> removeStep(final int index) throws IllegalStateException {
        if (this.locked) throw Exceptions.traversalIsLocked();
        final Step previousStep = this.steps.size() > 0 && index != 0 ? steps.get(index - 1) : null;
        final Step nextStep = this.steps.size() > index + 1 ? steps.get(index + 1) : null;
        //this.steps.get(index).setTraversal(EmptyTraversal.instance());
        this.steps.remove(index);
        if (null != previousStep) previousStep.setNextStep(null == nextStep ? EmptyStep.instance() : nextStep);
        if (null != nextStep) nextStep.setPreviousStep(null == previousStep ? EmptyStep.instance() : previousStep);
        return (Traversal.Admin<S2, E2>) this;
    }

    @Override
    public void setParent(final TraversalParent step) {
        this.parent = null == step ? EmptyStep.instance() : step;
    }

    @Override
    public TraversalParent getParent() {
        return this.parent;
    }

    @Override
    public Optional<Graph> getGraph() {
        return Optional.ofNullable(this.graph);
    }

    @Override
    public Optional<TraversalSource> getTraversalSource() {
        return Optional.ofNullable(this.g);
    }

    @Override
    public void setGraph(final Graph graph) {
        this.graph = graph;
    }

    @Override
    public boolean equals(final Object other) {
        return other != null && other.getClass().equals(this.getClass()) && this.equals(((Traversal.Admin) other));
    }

    @Override
    public int hashCode() {
        int index = 0;
        int result = this.getClass().hashCode();
        for (final Step step : this.asAdmin().getSteps()) {
            result ^= Integer.rotateLeft(step.hashCode(), index++);
        }
        return result;
    }
}


text:
"use strict";
/**
 * A namespace for the BCD-UI widget effects.
 * @namespace bcdui.widget.effects
 */
bcdui.widget.effects = Object.assign(bcdui.widget.effects,
/** @lends bcdui.widget.effects */
{
  /**
   * default duration of effects
   * @default 0.2
   * @constant
   */
  defaultDuration:0.2,
  /**
   * @default bcduiBlindBody
   * @constant
   */
  defaultBlindBodyClassName:"bcdBlindUpDownBody",
  /**
   * @default bcduiBlindHead
   * @constant
   */
  defaultBlindHeadClassName:"bcdBlindUpDownHead",

  /**
   * blinds the content Up/Down
   * @param {Object}     args                  The parameter map contains the following properties.
   * @param {Object}     args.idOrElement      HTML element or ID that contains element(s) to blind Up/Down
   * @param {string}     [args.blindBodyClassName=bcdBlindUpDownBody] CSS className of HTML element to blind Up/Down
   * @param {integer}    [args.duration=2]     duration in seconds used for blind animation
   * @param {boolean}    [args.noEffect=false] True for a simple show/hide without blind effect (blind can influence charts gradients on IE
   */
  blindUpDown: function(args){
    var elem = bcdui._migPjs._$(args.idOrElement);
    var actualId = elem.get(0).id;
    var className = "."+(args.blindBodyClassName || this.defaultBlindBodyClassName);
    var noEffect = args.noEffect || false;
    var els = elem.find(className);

    if(els.length > 0)
      elem = bcdui._migPjs._$(els[0]);
    else if(elem.parent().find(className).length > 0)
      elem = bcdui._migPjs._$(elem.parent().find(className)[0]);
    else
      bcdui.log.warn("did not find element with CSS className:" + className);

    var state;
    if(elem.hasClass('bcdClosed') ) {// open
      if (noEffect)
        elem.show();
      else
        elem.show("blind", {direction: "vertical"}, (args.duration || this.defaultDuration) * 1000);
      elem.removeClass('bcdClosed');
      elem.addClass('bcdOpened');
      if(bcdui._migPjs._$(args.idOrElement).find("."+this.defaultBlindHeadClassName).length > 0){
        var hEl = bcdui._migPjs._$(args.idOrElement).find("."+this.defaultBlindHeadClassName);
        hEl.first().removeClass('bcdHeadClosed');
        hEl.first().addClass('bcdHeadOpened');
      }
      state="open";
    }
    else{
      if (noEffect)
        elem.hide();
      else
        elem.hide("blind", {direction: "vertical"}, (args.duration || this.defaultDuration) * 1000);
      elem.removeClass('bcdOpened');
      elem.addClass('bcdClosed');
      if(bcdui._migPjs._$(args.idOrElement).find("."+this.defaultBlindHeadClassName).length > 0){
        var hEl = bcdui._migPjs._$(args.idOrElement).find("."+this.defaultBlindHeadClassName);
        hEl.first().removeClass('bcdHeadOpened');
        hEl.first().addClass('bcdHeadClosed');
      }
      state="closed";
    }

    // in case we call blindUpDown directly we need the default target information again
    args.targetModelId = args.targetModelId || "guiStatus";
    args.targetModelXPath = args.targetModelXPath || "/*/guiStatus:ClientSettings/BlindUpDown[@id='"+ (actualId + "_bcduiBlindBody") +"']";
    bcdui.factory.objectRegistry.getObject(args.targetModelId).write(args.targetModelXPath, state, true);
  },

  /**
   * Called from the targetModel listener. It updates the area according to the xpath given state
   * @private
   */
  _syncBlindUpDown: function(args){
    var elem = bcdui._migPjs._$(args.idOrElement);
    var className = "."+(args.blindBodyClassName || this.defaultBlindBodyClassName);
    var els = elem.find(className);

    if(els.length > 0)
      elem = bcdui._migPjs._$(els[0]);
    else if(elem.parent().find(className).length > 0)
      elem = bcdui._migPjs._$(elem.parent().find(className)[0]);
    else
      bcdui.log.warn("did not find element with CSS className:" + className);

    // determine current state and call blindUpDown accordingly if state is not in sync
    var state = bcdui.factory.objectRegistry.getObject(args.targetModelId).read(args.targetModelXPath, "");
    if (state == "closed" && ! elem.hasClass('bcdClosed')) {
      elem.addClass('bcdOpened');
      elem.removeClass('bcdClosed');
      bcdui.widget.effects.blindUpDown(args);
    }
    if (state == "open" && ! elem.hasClass('bcdOpened')) {
      elem.addClass('bcdClosed');
      elem.removeClass('bcdOpened');
      bcdui.widget.effects.blindUpDown(args);
    }
  }
});

redpajama_set_name: RedPajamaGithub


text:
module Coupler
  class Base < Sinatra::Base

    inst_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", ".."))
    set :environment, Coupler.environment
    set :root, File.join(inst_dir, "webroot")
    set :static, true
    set :erb, :trim => '-'
    set :raise_errors, Proc.new { test? }
    set :show_exceptions, false
    set :dump_errors, true
    set :logging, Proc.new { !test? }
    set :methodoverride, true
    set :bind, '127.0.0.1'
    enable :sessions

    use Rack::Flash
    register Extensions::Connections
    register Extensions::Projects
    register Extensions::Resources
    register Extensions::Transformations
    register Extensions::Scenarios
    register Extensions::Matchers
    register Extensions::Results
    register Extensions::Jobs
    register Extensions::Transformers
    register Extensions::Imports
    register Extensions::Notifications
    register Extensions::Exceptions

    helpers do
      include Coupler::Helpers
      include Rack::Utils
      alias_method :h, :escape_html
    end

    get "/" do
      if Models::Project.count > 0
        redirect "/projects"
      else
        session[:first_use] = true
        erb :index
      end
    end
  end
end


text:
Project
========
E-sports Community Site(TBD)

Team Manager
--------
Byron Samaripa

Team Members
--------
* Forrest Williams
* John Richards

Topic
--------
The goal is to enhance and improve the users ability to watch, follow, and track E-sports tournaments and information across various games. The key features would be to wrangle many features and sources of information for quicker consumption in a pleasant and easy service. One key design choice should be to not try to replace the communities that exist on other sites. Instead it should complement the E-sports experience.

Similar Systems
--------
* Teamliquid.net
Has a very comprehensive list of streams and good tournament coverage for several games. More of a community site and less of a service.
* reddit.com
Subreddits specific to each game have become the most popular
* gosugamers.net
This is community site that specializes in news

Target Users
--------
Fans of E-sports teams and players. Ideally the user will have a social media account or a twitch.tv account to authenticate on our service.

Plan for accessing intended users
--------
Distribution will be done through a single website that will be hosted on either a VPS or a deployment platform such as Heroku or OpenShift. Users will be able to sign up using a valid social media or twitch.tv account.


text:
(function () {
    'use strict';
    var extend = require('extend');
    var b = require('ast-types').builders;
    return module.exports = function (compiler) {
        var counter = 0;
        compiler.on('VariableDeclaration', { '$.declarations[*].id.type': 'ObjectPattern' }, function (node) {
            var replacement = extend({}, node, { declarations: [] });
            node.declarations.forEach(function (declaration) {
                if (declaration.id.type !== 'ObjectPattern') {
                    replacement.declarations.push(declaration);
                } else {
                    var temp = '$fsodtmp' + counter++;
                    replacement.declarations.push(b.variableDeclarator(b.identifier(temp), declaration.init));
                    declaration.id.properties.forEach(function (prop) {
                        return replacement.declarations.push(b.variableDeclarator(prop.value, b.memberExpression(b.identifier(temp), b.literal(prop.key.name), true)));
                    });
                }
            });
            return replacement;
        });
        compiler.on('AssignmentExpression', { '$.left.type': 'ObjectPattern' }, function (node) {
            var temp = '$fsodtmp' + counter++;
            var replacement = b.callExpression(b.functionExpression(null, [b.identifier(temp)], b.blockStatement(node.left.properties.map(function (prop) {
                    return b.expressionStatement(b.assignmentExpression('=', extend({}, prop.value), b.memberExpression(b.identifier(temp), b.literal(prop.key.name), true)));
                }).concat([b.returnStatement(b.identifier(temp))]))), [extend({}, node.right)]);
            return replacement;
        });
        return compiler.on([
            'FunctionDeclaration',
            'FunctionExpression'
        ], { '$.params[*].type': 'ObjectPattern' }, function (node) {
            var replacement = extend({}, node, { params: [] });
            var temps = {};
            node.params.forEach(function (param) {
                if (param.type !== 'ObjectPattern') {
                    replacement.params.push(param);
                } else {
                    var temp = '$fsodtmp' + counter++;
                    replacement.params.push(b.identifier(temp));
                    temps[temp] = param;
                }
            });
            Object.keys(temps).reverse().forEach(function (temp) {
                var param = temps[temp];
                return replacement.body.body.unshift(b.variableDeclaration('var', param.properties.map(function (prop, index) {
                    return b.variableDeclarator(prop.value, b.memberExpression(b.identifier(temp), b.literal(prop.key.name), true));
                })));
            });
            return replacement;
        });
    };
}.call(this));


text:
package com.github.robozonky.internal.util.stream;

import static java.util.Spliterator.IMMUTABLE;
import static java.util.Spliterator.ORDERED;
import static java.util.Spliterator.SIZED;
import static java.util.Spliterator.SUBSIZED;

import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import com.github.robozonky.internal.Settings;

public final class PagingStreams {

    static final int CHARACTERISTICS = IMMUTABLE
            | ORDERED
            | SIZED
            | SUBSIZED;

    public static <T> Stream<T> build(final PageSource<T> source) {
        return build(source, Settings.INSTANCE.getDefaultApiPageSize());
    }

    public static <T> Stream<T> build(final PageSource<T> source, final long pageSize) {
        return StreamSupport.stream(() -> PagingSpliterator.build(source, pageSize), CHARACTERISTICS, false);
    }

}


text:
namespace NewsSystem.Data
{
    using System;
    using System.Data.Entity;
    using Microsoft.AspNet.Identity.EntityFramework;
    using Models;

    public class NewsSystemDbContext : IdentityDbContext<User>, INewsSystemDbContext
    {
        public NewsSystemDbContext()
            : base("DefaultConnection", throwIfV1Schema: false)
        {
        }

        public IDbSet<Article> Articles { get; set; }

        public IDbSet<Category> Categories { get; set; }

        public IDbSet<Like> Likes { get; set; }

        public static NewsSystemDbContext Create()
        {
            return new NewsSystemDbContext();
        }
    }
}


text:
import time
import BaseHTTPServer

from pyfirmata import Arduino, util

HOST_NAME = '192.168.0.27' # !!!REMEMBER TO CHANGE THIS!!!
PORT_NUMBER = 8080 # Maybe set this to 9000.

# micro USB on Arduino UNO
arduinoDev = '/dev/ttyUSB0'
# USB B on Arduino Mega
# arduinoDev = '/dev/ttyACM0'

board = Arduino(arduinoDev)

maxVoltage = 7.2
minVoltage = 3.0
increment = 0.1

class Car:
    pinLeftPower = board.get_pin('d:10:p')
    pinLeftDirection = board.get_pin('d:12:o')
    pinRightPower = board.get_pin('d:11:p')
    pinRightDirection = board.get_pin('d:13:o')

    pinHorn = board.get_pin('d:4:o')

    speed = float(0)

    minThrottle = minVoltage / maxVoltage

    def normalizeSpeed(self, s, direction):
        if direction == 'FORWARD':
            if s < -1:
                return -1
            if s < -self.minThrottle:
                return s
            if s < 0:
                return 0
            if s < self.minThrottle:
                return self.minThrottle
            if s < 1:
                return s
            return 1
        else:
            if s > 1:
                return 1
            if s > self.minThrottle:
                return s
            if s > 0:
                return 0
            if s > -self.minThrottle:
                return -self.minThrottle
            if s > -1:
                return s
            return -1

    def setSpeed(self, pinS, pinD, s):
        print pinS, pinD, s, self.speed
        if s > 0:
            pinS.write(s)
            pinD.write(0)
        else:
            pinS.write(-s)
            pinD.write(1)

    def accelerate(self):
        self.speed = self.speed + increment
        self.speed = self.normalizeSpeed(self.speed, 'FORWARD')
        self.setSpeed(self.pinLeftPower, self.pinLeftDirection, self.speed)
        self.setSpeed(self.pinRightPower, self.pinRightDirection, self.speed)

    def brake(self):
        self.speed = self.speed - increment
        self.speed = self.normalizeSpeed(self.speed, 'BACKWARD')
        self.setSpeed(self.pinLeftPower, self.pinLeftDirection, self.speed)
        self.setSpeed(self.pinRightPower, self.pinRightDirection, self.speed)

    def turn(self, r):
        if r > 0:
            rightSpeed = self.normalizeSpeed(self.speed - (r * increment), 'BACKWARD')
            leftSpeed = self.normalizeSpeed(self.speed, 'FORWARD')
        if r < 0:
            leftSpeed = self.normalizeSpeed(self.speed - (r * increment), 'BACKWARD')
            rightSpeed = self.normalizeSpeed(self.speed, 'FORWARD')
        if r == 0:
            rightSpeed = self.normalizeSpeed(self.speed, 'FORWARD')
            leftSpeed = self.normalizeSpeed(self.speed, 'FORWARD')
        self.setSpeed(self.pinLeftPower, self.pinLeftDirection, leftSpeed)
        self.setSpeed(self.pinRightPower, self.pinRightDirection, rightSpeed)

    def stop(self):
        self.speed = 0;
        self.setSpeed(self.pinLeftPower, self.pinLeftDirection, self.speed)
        self.setSpeed(self.pinRightPower, self.pinRightDirection, self.speed)

    def horn(self):
        self.pinHorn.write(1)
        time.sleep(0.5)
        self.pinHorn.write(0)

car = Car()

class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):

    def address_string(self):
        # return BaseHTTPServer.BaseHTTPRequestHandler.address_string(self)
        return str(self.client_address[0])

    def do_HEAD(s):
        s.send_response(200)
        s.send_header("Content-type", "text/html")
        s.end_headers()
    def do_GET(s):
        """Respond to a GET request."""
        start = time.time()
        s.send_response(200)
        s.send_header("Content-type", "text/html")
        s.end_headers()
        # If someone went to "http://something.somewhere.net/foo/bar/",
        # then s.path equals "/foo/bar/".
        p = s.path.split('/')
        if p[1] == 'accelerate':
            car.accelerate()
        if p[1] == 'brake':
            car.brake()
        if p[1] == 'stop':
            car.stop()
        if p[1] == 'horn':
            car.horn()
        if p[1] == 'turn':
            turnSpeed = 0
            if  p[2] != 'undefined':
                turnSpeed = int(p[2])
            car.turn(turnSpeed)
        s.wfile.write("
Speed: ")
        s.wfile.write(car.speed)
        s.wfile.write("

Time: ")
        s.wfile.write(time.time() - start)
        s.wfile.write("
")
        s.finish()

if __name__ == '__main__':
    server_class = BaseHTTPServer.HTTPServer
    httpd = server_class((HOST_NAME, PORT_NUMBER), MyHandler)
    print time.asctime(), "Server Starts - %s:%s" % (HOST_NAME, PORT_NUMBER)
    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        pass
    httpd.server_close()
    print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)


text:
FOUNDATION_EXPORT double GagatVersionNumber;

//! Project version string for Gagat.
FOUNDATION_EXPORT const unsigned char GagatVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <Gagat/PublicHeader.h>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="MPSProject">
    <projectModules>
      <modulePath path="${mbeddr.github.core.home}/code/plugins/sl-all/mps-apache-commons/solutions/org.apache.commons/org.apache.commons.msd" folder="" />
      <modulePath path="$PROJECT_DIR$/languages/de.slisson.richtext.customcell/de.slisson.richtext.customcell.mpl" folder="" />
      <modulePath path="$PROJECT_DIR$/languages/javadoc/javadoc.mpl" folder="" />
      <modulePath path="$PROJECT_DIR$/languages/richtext/richtext.mpl" folder="" />
      <modulePath path="$PROJECT_DIR$/solutions/de.slisson.mps.richtext.sandbox/de.slisson.mps.richtext.sandbox.msd" folder="" />
    </projectModules>
  </component>
</project>


text:
shopt -s autocd
shopt -s checkhash
shopt -s checkjobs
shopt -s checkwinsize
shopt -s cmdhist
shopt -s extglob
shopt -s globstar
shopt -s histappend
shopt -s histverify
shopt -s lithist

HISTCONTROL='ignoreboth'
HISTSIZE=-1

export EDITOR='vim'
export LC_ALL='en_US.UTF-8'
export LESS='-F -g -i -r -w -X -z-3'
export LESS_ADVANCED_PREPROCESSOR=1
export VISUAL=$EDITOR


text:
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Mitten.Server.Extensions;
using Mitten.Server.Notifications.Events;
using Mitten.Server.Notifications.Push;
using NSubstitute;
using NUnit.Framework;

namespace Mitten.Server.Notifications.Tests.Unit
{
    [TestFixture]
    public class NotificationSchedulerTests
    {
        [Test]
        public void SchedulePushNotificationTest()
        {
            NotificationTest test = new NotificationTest();
            NotificationScheduler<Guid> scheduler = this.CreateScheduler(test);

            PushNotification notification = this.CreateNotification();
            NotificationAccount<Guid> account = test.AddNotificationAccount(Guid.NewGuid(), timeZone: "US/Pacific");

            DateTime deliveryDate = DateTime.UtcNow.AddDays(1);
            scheduler.Schedule(account.AccountId, notification, deliveryDate);

            DateTimeOffset expectedDeliveryDate = deliveryDate.ToDateTimeOffset("US/Pacific");
            this.AssertNotificationScheduledSuccessful(test, account, notification, expectedDeliveryDate);
        }

        [Test]
        public void SchedulePushNotificationWithoutTimeZoneTest()
        {
            NotificationTest test = new NotificationTest();
            NotificationScheduler<Guid> scheduler = this.CreateScheduler(test);

            PushNotification notification = this.CreateNotification();
            NotificationAccount<Guid> account = test.AddNotificationAccount(Guid.NewGuid(), timeZone: null);

            DateTime deliveryDate = DateTime.UtcNow.AddDays(1);
            scheduler.Schedule(account.AccountId, notification, deliveryDate);

            DateTimeOffset expectedDeliveryDate = deliveryDate.ToDateTimeOffset("US/Eastern");
            this.AssertNotificationScheduledSuccessful(test, account, notification, expectedDeliveryDate);
        }

        [Test]
        public void SendOverDueNotificationTest()
        {
            NotificationTest test = new NotificationTest();

            INotificationChannel channel;
            NotificationScheduler<Guid> scheduler = this.CreateScheduler(test, out channel);

            DateTime deliveryDate = DateTime.UtcNow;
            NotificationAccount<Guid> account = test.AddNotificationAccount(Guid.NewGuid(), "US/Pacific");
            PushNotification notificationToSend = this.CreateNotification();

            test.NotificationRepository.GetScheduledNotifications(Arg.Any<DateTime>()).Returns(new[] { new ScheduledNotification<Guid>(account.AccountId, notificationToSend, DateTime.UtcNow) });

            scheduler.SendScheduledNotifications(DateTime.UtcNow.AddDays(1)).Wait();

            channel.Received().SendAsync(account, notificationToSend);
            test.NotificationRepository.Received().DeleteScheduledNotification(notificationToSend.Id);
        }

        private void AssertNotificationScheduledSuccessful(NotificationTest test, NotificationAccount<Guid> account, Notification expectedNotification, DateTimeOffset expectedDeliveryDateTime)
        {
            ScheduledNotification<Guid> scheduledNotification = test.GetScheduledNotification();

            scheduledNotification.AccountId.ShouldBeEquivalentTo(account.AccountId);
            scheduledNotification.DeliveryDateTime.ShouldBeEquivalentTo(expectedDeliveryDateTime);

            this.AssertNotificationScheduledEventRaised(test, account, expectedNotification, expectedDeliveryDateTime);
        }

        private void AssertNotificationScheduledEventRaised(NotificationTest test, NotificationAccount<Guid> account, Notification expectedNotification, DateTimeOffset expectedDeliveryDateTime)
        {
            NotificationScheduled notificationScheduled = test.RaisedEvents.OfType<NotificationScheduled>().SingleOrDefault();

            notificationScheduled.Should().NotBeNull();
            notificationScheduled.AccountId.ShouldBeEquivalentTo(account.AccountId.ToString());
            notificationScheduled.DeliveryDateTime.ShouldBeEquivalentTo(expectedDeliveryDateTime);

            notificationScheduled.Notification.Should().BeSameAs(expectedNotification);
        }

        private NotificationScheduler<Guid> CreateScheduler(NotificationTest test)
        {
            INotificationChannel channel;
            return this.CreateScheduler(test, out channel);
        }

        private NotificationScheduler<Guid> CreateScheduler(NotificationTest test, out INotificationChannel channel)
        {
            channel = Substitute.For<INotificationChannel>();

            NotificationChannelFactory factory = new NotificationChannelFactory();
            factory.RegisterChannel<PushNotification>(channel);

            return
                new NotificationScheduler<Guid>(
                    new NotificationQueue(factory),
                    new NotificationAccountManager<Guid>(test.NotificationAccountRepository),
                    test.NotificationRepository,
                    test.EventPublisher);
        }

        private PushNotification CreateNotification(Version minimumAppVersion = null, Version maximumAppVersion = null)
        {
            return
                new PushNotification(
                    "TestNotification",
                    "This is a test.",
                    new[] { new KeyValuePair<string, string>("key", "some value") },
                    minimumAppVersion,
                    maximumAppVersion);
        }
    }
}


text:
using System.Threading.Tasks;
using OhadSoft.AzureLetsEncrypt.Renewal.Management;

namespace OhadSoft.AzureLetsEncrypt.Renewal.WebJob.Email
{
    public interface IEmailNotifier
    {
        Task NotifyAsync(RenewalParameters renewalParams);
    }
}


text:
{% extends path1+"/_layout-info.html" %}

{% block citizen_content %}

  {{ data.nuggets | log }}

  Back

Work capability assessment

    <form class="form">

      	  Condition history

          <textarea type="text" id="nugget" class="form-control" name="nugget" style="width: 80%; height: 300px;"></textarea>

    {% include path2+"/_addremove.html" %}

Moving around and using steps Standing and sitting

<input class="button" type="submit" value="Save" id="submitButton"/>

    </form>

{% endblock %}

{% block page_scripts %}
{{ super() }}

{% endblock %}


text:
package com.oneliang.util.common;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.oneliang.Constants;

public final class MixUtil {

	private static final char[] hexCharacters=new char[]{'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
	private static final char[][] mixMap=new char[][]{
		new char[]{'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'},
		new char[]{'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v'},
		new char[]{'w','x','y','z','~','!','@','#','$','%','^','*','(',')','+','='}
	};
	private static final Map<Character,Character> characterMap=new ConcurrentHashMap<Character, Character>();

	static{
		characterMap.put(mixMap[0][0], hexCharacters[0]);
		characterMap.put(mixMap[0][1], hexCharacters[1]);
		characterMap.put(mixMap[0][2], hexCharacters[2]);
		characterMap.put(mixMap[0][3], hexCharacters[3]);
		characterMap.put(mixMap[0][4], hexCharacters[4]);
		characterMap.put(mixMap[0][5], hexCharacters[5]);
		characterMap.put(mixMap[0][6], hexCharacters[6]);
		characterMap.put(mixMap[0][7], hexCharacters[7]);
		characterMap.put(mixMap[0][8], hexCharacters[8]);
		characterMap.put(mixMap[0][9], hexCharacters[9]);
		characterMap.put(mixMap[0][10], hexCharacters[10]);
		characterMap.put(mixMap[0][11], hexCharacters[11]);
		characterMap.put(mixMap[0][12], hexCharacters[12]);
		characterMap.put(mixMap[0][13], hexCharacters[13]);
		characterMap.put(mixMap[0][14], hexCharacters[14]);
		characterMap.put(mixMap[0][15], hexCharacters[15]);

		characterMap.put(mixMap[1][0], hexCharacters[0]);
		characterMap.put(mixMap[1][1], hexCharacters[1]);
		characterMap.put(mixMap[1][2], hexCharacters[2]);
		characterMap.put(mixMap[1][3], hexCharacters[3]);
		characterMap.put(mixMap[1][4], hexCharacters[4]);
		characterMap.put(mixMap[1][5], hexCharacters[5]);
		characterMap.put(mixMap[1][6], hexCharacters[6]);
		characterMap.put(mixMap[1][7], hexCharacters[7]);
		characterMap.put(mixMap[1][8], hexCharacters[8]);
		characterMap.put(mixMap[1][9], hexCharacters[9]);
		characterMap.put(mixMap[1][10], hexCharacters[10]);
		characterMap.put(mixMap[1][11], hexCharacters[11]);
		characterMap.put(mixMap[1][12], hexCharacters[12]);
		characterMap.put(mixMap[1][13], hexCharacters[13]);
		characterMap.put(mixMap[1][14], hexCharacters[14]);
		characterMap.put(mixMap[1][15], hexCharacters[15]);

		characterMap.put(mixMap[2][0], hexCharacters[0]);
		characterMap.put(mixMap[2][1], hexCharacters[1]);
		characterMap.put(mixMap[2][2], hexCharacters[2]);
		characterMap.put(mixMap[2][3], hexCharacters[3]);
		characterMap.put(mixMap[2][4], hexCharacters[4]);
		characterMap.put(mixMap[2][5], hexCharacters[5]);
		characterMap.put(mixMap[2][6], hexCharacters[6]);
		characterMap.put(mixMap[2][7], hexCharacters[7]);
		characterMap.put(mixMap[2][8], hexCharacters[8]);
		characterMap.put(mixMap[2][9], hexCharacters[9]);
		characterMap.put(mixMap[2][10], hexCharacters[10]);
		characterMap.put(mixMap[2][11], hexCharacters[11]);
		characterMap.put(mixMap[2][12], hexCharacters[12]);
		characterMap.put(mixMap[2][13], hexCharacters[13]);
		characterMap.put(mixMap[2][14], hexCharacters[14]);
		characterMap.put(mixMap[2][15], hexCharacters[15]);
	}

	/**
	 * mix by encoding utf8
	 * @param string
	 * @param offset
	 * @return String
	 * @throws Exception
	 */
	public static String mix(String string,int offset) throws Exception{
		return mix(string,Constants.Encoding.UTF8,offset);
	}

	/**
	 * mix
	 * @param string
	 * @param encoding
	 * @param offset
	 * @return String
	 * @throws Exception
	 */
	public static String mix(String string,String encoding,int offset) throws Exception{
		StringBuilder stringBuilder=new StringBuilder();
		if(string!=null){
			byte[] byteArray=string.getBytes(encoding);
			byte[] newByteArray=new byte[byteArray.length];
			int i=0;
			for(byte b:byteArray){
				newByteArray[i++]=(byte)(b+offset);
			}
			String hexString=StringUtil.byteArrayToHexString(newByteArray);
			for(i=0;i<hexString.length();i++){
				char c=hexString.charAt(i);
				int index=(int)(Math.random()*3);
				int position=0;
				int ascii=(int)c;
				if(ascii>=48&&ascii<=57){
					position=ascii-48;
				}else if(ascii>=65&&ascii<=90){
					position=ascii-65+10;
				}else if(ascii>=97&&ascii<=122){
					position=ascii-97+10;
				}
				stringBuilder.append(mixMap[index][position]);
			}
		}
		return stringBuilder.toString();
	}

	/**
	 * de mix by encoding utf8
	 * @param string
	 * @param offset
	 * @return String
	 * @throws Exception
	 */
	public static String deMix(String string,int offset) throws Exception{
		return deMix(string,Constants.Encoding.UTF8,offset);
	}

	/**
	 * de mix
	 * @param string
	 * @param encoding
	 * @param offset
	 * @return String
	 * @throws Exception
	 */
	public static String deMix(String string,String encoding,int offset) throws Exception{
		StringBuilder stringBuilder=new StringBuilder();
		for(int i=0;i<string.length();i++){
			char c=string.charAt(i);
			stringBuilder.append(characterMap.get(c));
		}
		byte[] byteArray=StringUtil.hexStringToByteArray(stringBuilder.toString());
		int i=0;
		for(byte b:byteArray){
			byteArray[i++]=(byte)(b-offset);
		}
		return new String(byteArray,encoding);
	}
}


text:
#ifndef QXLIBDISPLAY_H
#define QXLIBDISPLAY_H

#include "qxlibintegration.h"

class QXlibDisplay
{
public:
    QXlibDisplay(Display *display);
    ~QXlibDisplay();
    QString displayName() const;

    Display *nativeDisplay() const;

    void sync() const;
    void flush() const;
private:
    Display *mDisplay;
    QString mDisplayName;
};

#endif // QXLIBDISPLAY_H


text:
// @param url {String} URL to Meteor app
//   "http://subdomain.meteor.com/" or "/" or
//   "ddp+sockjs://foo-**.meteor.com/sockjs"
LivedataTest.ClientStream = function (url) {
  var self = this;
  self._initCommon();

  //// Constants

  // how long between hearing heartbeat from the server until we declare
  // the connection dead. heartbeats come every 25s (stream_server.js)
  //
  // NOTE: this is a workaround until sockjs detects heartbeats on the
  // client automatically.
  // https://github.com/sockjs/sockjs-client/issues/67
  // https://github.com/sockjs/sockjs-node/issues/68
  self.HEARTBEAT_TIMEOUT = 60000;

  self.rawUrl = url;
  self.socket = null;

  self.sent_update_available = false;

  self.heartbeatTimer = null;

  // Listen to global 'online' event if we are running in a browser.
  // (IE8 does not support addEventListener)
  if (typeof window !== 'undefined' && window.addEventListener)
    window.addEventListener("online", _.bind(self._online, self),
                            false /* useCapture. make FF3.6 happy. */);

  //// Kickoff!
  self._launchConnection();
};

_.extend(LivedataTest.ClientStream.prototype, {

  // data is a utf8 string. Data sent while not connected is dropped on
  // the floor, and it is up the user of this API to retransmit lost
  // messages on 'reset'
  send: function (data) {
    var self = this;
    if (self.currentStatus.connected) {
      self.socket.send(data);
    }
  },

  // Changes where this connection points
  _changeUrl: function (url) {
    var self = this;
    self.rawUrl = url;
  },

  _connected: function (welcome_message) {
    var self = this;

    if (self.connectionTimer) {
      clearTimeout(self.connectionTimer);
      self.connectionTimer = null;
    }

    if (self.currentStatus.connected) {
      // already connected. do nothing. this probably shouldn't happen.
      return;
    }

    // inspect the welcome data and decide if we have to reload
    try {
      var welcome_data = JSON.parse(welcome_message);
    } catch (err) {
      Meteor._debug("DEBUG: malformed welcome packet", welcome_message);
    }

    if (welcome_data && welcome_data.server_id) {
      if (__meteor_runtime_config__.serverId &&
          __meteor_runtime_config__.serverId !== welcome_data.server_id &&
          !self.sent_update_available) {
        self.sent_update_available = true;
        _.each(self.eventCallbacks.update_available,
               function (callback) { callback(); });
      }
    } else
      Meteor._debug("DEBUG: invalid welcome packet", welcome_data);

    // update status
    self.currentStatus.status = "connected";
    self.currentStatus.connected = true;
    self.currentStatus.retryCount = 0;
    self.statusChanged();

    // fire resets. This must come after status change so that clients
    // can call send from within a reset callback.
    _.each(self.eventCallbacks.reset, function (callback) { callback(); });

  },

  _cleanup: function () {
    var self = this;

    self._clearConnectionAndHeartbeatTimers();
    if (self.socket) {
      self.socket.onmessage = self.socket.onclose
        = self.socket.onerror = self.socket.onheartbeat = function () {};
      self.socket.close();
      self.socket = null;
    }
  },

  _clearConnectionAndHeartbeatTimers: function () {
    var self = this;
    if (self.connectionTimer) {
      clearTimeout(self.connectionTimer);
      self.connectionTimer = null;
    }
    if (self.heartbeatTimer) {
      clearTimeout(self.heartbeatTimer);
      self.heartbeatTimer = null;
    }
  },

  _heartbeat_timeout: function () {
    var self = this;
    Meteor._debug("Connection timeout. No heartbeat received.");
    self._lostConnection();
  },

  _heartbeat_received: function () {
    var self = this;
    // If we've already permanently shut down this stream, the timeout is
    // already cleared, and we don't need to set it again.
    if (self._forcedToDisconnect)
      return;
    if (self.heartbeatTimer)
      clearTimeout(self.heartbeatTimer);
    self.heartbeatTimer = setTimeout(
      _.bind(self._heartbeat_timeout, self),
      self.HEARTBEAT_TIMEOUT);
  },

  _sockjsProtocolsWhitelist: function () {
    // only allow polling protocols. no streaming.  streaming
    // makes safari spin.
    var protocolsWhitelist = [
      'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling'];

    // iOS 4 and 5 and below crash when using websockets over certain
    // proxies. this seems to be resolved with iOS 6. eg
    // https://github.com/LearnBoost/socket.io/issues/193#issuecomment-7308865.
    //
    // iOS <4 doesn't support websockets at all so sockjs will just
    // immediately fall back to http
    var noWebsockets = navigator &&
          /iPhone|iPad|iPod/.test(navigator.userAgent) &&
          /OS 4_|OS 5_/.test(navigator.userAgent);

    if (!noWebsockets)
      protocolsWhitelist = ['websocket'].concat(protocolsWhitelist);

    return protocolsWhitelist;
  },

  _launchConnection: function () {
    var self = this;
    self._cleanup(); // cleanup the old socket, if there was one.

    // Convert raw URL to SockJS URL each time we open a connection, so that we
    // can connect to random hostnames and get around browser per-host
    // connection limits.
    self.socket = new SockJS(
      toSockjsUrl(self.rawUrl), undefined, {
        debug: false, protocols_whitelist: self._sockjsProtocolsWhitelist()
      });
    self.socket.onmessage = function (data) {
      self._heartbeat_received();

      // first message we get when we're connecting goes to _connected,
      // which connects us. All subsequent messages (while connected) go to
      // the callback.
      if (self.currentStatus.status === "connecting")
        self._connected(data.data);
      else if (self.currentStatus.connected)
        _.each(self.eventCallbacks.message, function (callback) {
          callback(data.data);
        });
    };
    self.socket.onclose = function () {
      // Meteor._debug("stream disconnect", _.toArray(arguments), (new Date()).toDateString());
      self._lostConnection();
    };
    self.socket.onerror = function () {
      // XXX is this ever called?
      Meteor._debug("stream error", _.toArray(arguments), (new Date()).toDateString());
    };

    self.socket.onheartbeat =  function () {
      self._heartbeat_received();
    };

    if (self.connectionTimer)
      clearTimeout(self.connectionTimer);
    self.connectionTimer = setTimeout(
      _.bind(self._lostConnection, self),
      self.CONNECT_TIMEOUT);
  }
});


text:
<title>Learning WebGL — lesson 5</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">

  << Back to Lesson 5

  <canvas id="lesson05-canvas" style="border: none;" width="500" height="500"></canvas>

  << Back to Lesson 5


text:
CREATE TABLE employees (
store_id INT NOT NULL
)
PARTITION BY RANGE (store_id) (
PARTITION p0 VALUES LESS THAN (null),
PARTITION p1 VALUES LESS THAN (100)
);

drop class range_test;


text:
module pgm

#This would be a prime candidate for decoupling
include("factor.jl")
# Representation of factors
export Domain, Variable, AbstractFactor, Factor, DiscreteFactor, generate_factor
# Wrapped distributions
export supported_distributions
# Probably together with that one
include("factorgraph.jl")
export FactorGraph
# Algorithms
include("algorithms.jl")
export compute_Z_brute_force, normalize, reduce_factor, factor_product
include("core.jl")
export @model

end


text:
package dk.brics.tajs.monitoring.inspector.dataprocessing;

import dk.brics.tajs.flowgraph.AbstractNode;
import dk.brics.tajs.flowgraph.FlowGraph;
import dk.brics.tajs.flowgraph.SourceLocation;
import dk.brics.tajs.flowgraph.jsnodes.ReadPropertyNode;
import dk.brics.tajs.flowgraph.jsnodes.ReadVariableNode;
import dk.brics.tajs.flowgraph.jsnodes.WritePropertyNode;
import dk.brics.tajs.flowgraph.jsnodes.WriteVariableNode;
import dk.brics.tajs.util.Collectors;
import dk.brics.tajs.util.Pair;

import java.net.URL;
import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

import static dk.brics.tajs.util.Collections.newMap;
import static dk.brics.tajs.util.Collections.newSet;

/**
 * Utility-methods for matching simple source positions (file/line/column) to {@link AbstractNode}.
 */
public class SyntaxMatcher {

    Map<URL, Map<Integer, Map<Integer, Set<AbstractNode>>>> locLineColumnMap = newMap();

    private Map<Pair<String, ?>, Set<AbstractNode>> cache = newMap();

    public SyntaxMatcher(FlowGraph flowGraph) {
        flowGraph.getFunctions().stream()
                .flatMap(f -> f.getBlocks().stream())
                .flatMap(b -> b.getNodes().stream())
                .filter(n -> n.getSourceLocation().getLocation() != null)
                .forEach(n -> {
                    SourceLocation sourceLocation = n.getSourceLocation();
                    URL url = sourceLocation.getLocation();
                    int lineNumber = sourceLocation.getLineNumber();
                    int columnNumber = sourceLocation.getColumnNumber();
                    locLineColumnMap.putIfAbsent(url, newMap());
                    locLineColumnMap.get(url).putIfAbsent(lineNumber, newMap());
                    locLineColumnMap.get(url).get(lineNumber).putIfAbsent(columnNumber, newSet());
                    locLineColumnMap.get(url).get(lineNumber).get(columnNumber).add(n);
                });
    }

    public Set<AbstractNode> getNodeFromFixedAccessAtTAJSSourceLocation(SourceLocation location, String name) {
        Pair<String, Pair<SourceLocation, String>> cacheKey = Pair.make("getNodeFromFixedAccessAtTAJSSourceLocation", Pair.make(location, name));
        if (!cache.containsKey(cacheKey)) {
            cache.put(cacheKey, computeNodeFromFixedAccessAtTAJSSourceLocation(location, name));
        }
        return cache.get(cacheKey);
    }

    private Set<AbstractNode> computeNodeFromFixedAccessAtTAJSSourceLocation(SourceLocation location, String name) {
        URL url = location.getLocation();
        Set<AbstractNode> candidates = getNodesStartingAt(url, location.getLineNumber(), location.getColumnNumber());
        Set<AbstractNode> results = candidates.stream()
                .filter(n -> {
                    if (n instanceof ReadVariableNode) {
                        return name.equals(((ReadVariableNode) n).getVariableName());
                    } else if (n instanceof WriteVariableNode) {
                        return name.equals(((WriteVariableNode) n).getVariableName());
                    } else if (n instanceof ReadPropertyNode) {
                        return name.equals(((ReadPropertyNode) n).getPropertyString());
                    } else if (n instanceof WritePropertyNode) {
                        return name.equals(((WritePropertyNode) n).getPropertyString());
                    }
                    return false;
                })
                .collect(Collectors.toSet());
        return results;
    }

    private Set<AbstractNode> getNodesStartingAt(URL url, int lineNumber, int columnNumber) {
        return locLineColumnMap.getOrDefault(url, newMap()).getOrDefault(lineNumber, newMap()).getOrDefault(columnNumber, newSet());
    }

    public Optional<AbstractNode> getLastEnclosingNode(URL url, int targetLine, int targetColumn) {
        // An expression can be uniquely identified by a source position by picking the expression that covers the smallest source code region that contains the source position.
        // Or put another way: the smallest subtree in an AST which contains a source position is unique (in practice).
        // NB: a range-tree yields an efficient implementation.
        Set<AbstractNode> nodesForFile = getNodesForFile(url);
        Set<AbstractNode> candidates = nodesForFile.stream()
                .filter(n -> {
                    int lineBegin = n.getSourceLocation().getLineNumber();
                    int columnBegin = n.getSourceLocation().getColumnNumber();
                    int lineEnd = n.getSourceLocation().getEndLineNumber();
                    int columnEnd = n.getSourceLocation().getEndColumnNumber();
                    boolean beginOK = targetLine == lineBegin ? columnBegin <= targetColumn : lineBegin < targetLine;
                    boolean endOK = targetLine == lineEnd ? targetColumn <= columnEnd : targetLine < lineEnd;
                    return beginOK && endOK;
                })
                .collect(Collectors.toSet());
        Optional<AbstractNode> last = candidates.stream()
                .sorted(Comparator.comparing((AbstractNode n) -> n.getSourceLocation().getEndLineNumber() - n.getSourceLocation().getLineNumber()) // prefer smallest line range
                        .thenComparing(n -> n.getSourceLocation().getEndColumnNumber() - n.getSourceLocation().getColumnNumber()) // prefer smallest column range
                        .thenComparing(
                                // in case of ambiguities due to (aux) nodes with the same source position
                                Comparator.comparing((AbstractNode n) -> !n.isArtificial()) // prefer non-artificials
                                        .thenComparing(n -> n.getBlock().getTopologicalOrder()) // prefer later blocks
                                        // in case of (unexpected) overlaps
                                        .thenComparing(n -> n.getSourceLocation().getEndLineNumber()) // prefer biggest line and column
                                        .thenComparing(n -> n.getSourceLocation().getEndColumnNumber())
                                        .reversed()
                        ))
                .findFirst();
        return last;
    }

    private Set<AbstractNode> getNodesForFile(URL url) {
        return locLineColumnMap.getOrDefault(url, newMap()).values().stream()
                .flatMap(e -> e.values().stream())
                .flatMap(Collection::stream)
                .collect(Collectors.toSet());
    }

    public Set<AbstractNode> getNodesForLine(URL url, int line) {
        // nodes starting on a specific line
        return getNodesForFile(url).stream()
                .filter(n -> n.getSourceLocation().getLineNumber() == line)
                .collect(Collectors.toSet());
    }
}


text:
object Test {
  // a problematic implicit conversion, should we flag it?
  given Conversion[String, Int] {
    def apply(x: String): Int = Integer.parseInt(toString)
  }
}


text:
from django.conf.urls import url

from . import views

app_name = 'landing_page'
urlpatterns = [
    url(r'^$', views.IndexView.as_view())
]


text:
function h = freq (y,values,names)
%FREQ  frequency histogram -- this is my special version of HIST that
%only works with positive integers.
%
%requires the statistics toolbox
%
%   FREQ(Y) plots the number of occurences of each of
%   the elements of Y.
%
%   FREQ(Y,VALUES), where VALUES is an array of values ensures that all and
%   only these values will show up on the plot.
%
%   FREQ(Y,VALUES,NAMES), where NAMES is a cell array of the same length as VALUES
%   associates a name on the X axis of the plot for each value.
%
%   H = BAR(...) returns a vector of patch handles.
%
%   See also HIST.

if nargin == 0
    error('Requires one or two input arguments.')
end
if isempty(y)
    newplot
    if nargin==1
        bar(0)
		set(gca, 'XTick', 1); %make sure there are tick values for all numbers
		set(gca, 'XTickLabel', 0); %and change the name of the tick values
    end
    if nargin==2
        bar(zeros(1,length(values)));
		set(gca, 'XTick', 1:length(values)); %make sure there are tick values for all numbers
		set(gca, 'XTickLabel', values); %and change the name of the tick values
    end
    if nargin==3
        bar(zeros(1,length(names)));
		set(gca, 'XTick', 1:length(names)); %make sure there are tick values for all numbers
		set(gca, 'XTickLabel', names); %and change the name of the tick values
    end
    return
end
if min(size(y)) > 1,
   error('Requires Y to be a vector');
end
tmp = y(find(~isnan(y)));
if any(tmp ~= round(tmp)) | any(tmp < 1),
   error('Requires the values of Y to be positive integers.');
end
maxlevels = max(max(tmp));
[cnts vals] = hist(tmp,(1:maxlevels)); %get the frequency of each element

newcnts=[];
if nargin>1  %if there is a VALUES argument, get the frequency for all and only those values
    for i=1:length(values)
        index=find(values(i)==vals);
        if isempty(index)
            newcnts(end+1) = 0;
        else
            newcnts(end+1) = cnts(find(values(i)==vals));
        end
    end
    counts = newcnts;
	if nargin==2  %and use those values as the x-labels
        names=values;
	else %unless NAMES parameter exists, in which case substitute for the names
        names = names;
	end
else  %if no VALUES parameter was passed, print frequency for all non-zero elements
	counts = cnts(cnts>0);
    names = vals(cnts>0);
end
bar(counts); %show the bar plot
set(gca, 'XTick', 1:length(names)); %make sure there are tick values for all numbers
set(gca, 'XTickLabel', names); %and change the name of the tick values


text:
namespace Google.Cloud.Bigtable.Admin.V2.Snippets
{
    // [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync]
    using Google.Cloud.Bigtable.Admin.V2;
    using Google.Cloud.Bigtable.Common.V2;

    public sealed partial class GeneratedBigtableTableAdminClientSnippets
    {
        /// <summary>Snippet for DeleteTable</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void DeleteTableRequestObject()
        {
            // Create client
            BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create();
            // Initialize request argument(s)
            DeleteTableRequest request = new DeleteTableRequest
            {
                TableName = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]"),
            };
            // Make the request
            bigtableTableAdminClient.DeleteTable(request);
        }
    }
    // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync]
}


text:
import React from 'react'
import AccountSettingForm from '../../forms/AccountSettingForm'

type Props = {
  accounts: Array,
  itemFunction: Function
};

export class AccountList extends React.Component<void, Props, void> {
  constructor (props) {
    super(props)
    this.state = { activeFormId: null }
  }
  // JSX props should not use .bind() according to eslint rule,
  // bind each function for all mapping items outside of JSX.
  defineMappingfunctions () {
    this.eachFunction = {}
    if (this.props.itemFunction) {
      this.props.accounts.forEach((account) => {
        this.eachFunction[account._id] =
          () => {
            if (account.id !== this.state.activeFormId) {
              this.setState({activeFormId: null}, () => { this.setState({activeFormId: account.id}) })
            } else {
              this.setState({activeFormId: null})
            }
          }
      })
      this.itemStyle = {
        cursor: 'pointer'
      }
    } else {
      this.props.accounts.forEach((account) => {
        this.eachFunction[account._id] = () => {}
      })
    }
  }

  props: Props;

  render () {
    this.defineMappingfunctions()

    return (

              id
              name
              email

          {this.props.accounts.map(function (account) {
            return

                    {account.id}
                    {account.name}
                    {account.email}

              {this.state.activeFormId === account.id
                ? <AccountSettingForm key={account._id} accountDetail={account} /> : null}

          }.bind(this))}

    )
  }
}

export default AccountList


text:
//*****************************************************************************
//
// flash.h - Driver for the FLASH Module.
//
//*****************************************************************************

#ifndef __MSP430WARE_FLASH_H__
#define __MSP430WARE_FLASH_H__

#include "inc/hw_memmap.h"

#ifdef __MSP430_HAS_FLASH__

//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif

//*****************************************************************************
//
// The following are values that can be passed to the mask parameter for
// functions: FLASH_status() as well as returned by the FLASH_status()
// function.
//
//*****************************************************************************
#define FLASH_READY_FOR_NEXT_WRITE                                         WAIT
#define FLASH_ACCESS_VIOLATION_INTERRUPT_FLAG                           ACCVIFG
#define FLASH_PASSWORD_WRITTEN_INCORRECTLY                                 KEYV
#define FLASH_BUSY                                                         BUSY

//*****************************************************************************
//
// The following are values that can be passed to the clockSource parameter for
// functions: FLASH_setupClock().
//
//*****************************************************************************
#define FLASH_MCLK                                                      FSSEL_1
#define FLASH_SMCLK                                                     FSSEL_2

//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
extern void FLASH_segmentErase(uint8_t *flash_ptr);

extern void FLASH_massErase(uint8_t *flash_ptr);

extern bool FLASH_eraseCheck(uint8_t *flash_ptr,
                             uint16_t numberOfBytes);

extern void FLASH_write8(uint8_t *data_ptr,
                         uint8_t *flash_ptr,
                         uint16_t count);

extern void FLASH_write16(uint16_t *data_ptr,
                          uint16_t *flash_ptr,
                          uint16_t count);

extern void FLASH_write32(uint32_t *data_ptr,
                          uint32_t *flash_ptr,
                          uint16_t count);

extern void FLASH_memoryFill32(uint32_t value,
                               uint32_t *flash_ptr,
                               uint16_t count);

extern uint8_t FLASH_status(uint8_t mask);

extern void FLASH_lockInfo(void);

extern void FLASH_unlockInfo(void);

extern uint8_t FLASH_setupClock(uint32_t clockTargetFreq,
                                uint32_t clockSourceFreq,
                                uint16_t clockSource);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

#endif
#endif // __MSP430WARE_FLASH_H__


text:
"use strict";
var core_1 = require("@angular/core");
require("rxjs/add/operator/do");
require("rxjs/add/operator/map");
var http_service_1 = require("../../custom-http/http-service");
var ValeService = (function () {
    function ValeService(http) {
        this.http = http;
    }
    ValeService.prototype.index = function (cliente_id) {
        return this.http.get("clientes/" + cliente_id + "/vales").map(function (response) { return response.json(); });
    };
    ValeService = __decorate([
        core_1.Injectable(),
        __metadata('design:paramtypes', [http_service_1.HttpService])
    ], ValeService);
    return ValeService;
}());
exports.ValeService = ValeService;


text:
package com.xiaogua.better.bean;

public class Friend_Bean {
	private Integer id;
	private String friendName;

	public Friend_Bean() {
		super();
	}

	public Friend_Bean(Integer id, String friendName) {
		super();
		this.id = id;
		this.friendName = friendName;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getFriendName() {
		return friendName;
	}

	public void setFriendName(String friendName) {
		this.friendName = friendName;
	}

	public String toString() {
		return "Friend_Bean [id=" + id + ", friendName=" + friendName + "]";
	}

}


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.appengine.v1.model;

/**
 * Response message for Firewall.ListIngressRules.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the App Engine Admin API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class ListIngressRulesResponse extends com.google.api.client.json.GenericJson {

  /**
   * The ingress FirewallRules for this application.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<FirewallRule> ingressRules;

  static {
    // hack to force ProGuard to consider FirewallRule used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(FirewallRule.class);
  }

  /**
   * Continuation token for fetching the next page of results.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String nextPageToken;

  /**
   * The ingress FirewallRules for this application.
   * @return value or {@code null} for none
   */
  public java.util.List<FirewallRule> getIngressRules() {
    return ingressRules;
  }

  /**
   * The ingress FirewallRules for this application.
   * @param ingressRules ingressRules or {@code null} for none
   */
  public ListIngressRulesResponse setIngressRules(java.util.List<FirewallRule> ingressRules) {
    this.ingressRules = ingressRules;
    return this;
  }

  /**
   * Continuation token for fetching the next page of results.
   * @return value or {@code null} for none
   */
  public java.lang.String getNextPageToken() {
    return nextPageToken;
  }

  /**
   * Continuation token for fetching the next page of results.
   * @param nextPageToken nextPageToken or {@code null} for none
   */
  public ListIngressRulesResponse setNextPageToken(java.lang.String nextPageToken) {
    this.nextPageToken = nextPageToken;
    return this;
  }

  @Override
  public ListIngressRulesResponse set(String fieldName, Object value) {
    return (ListIngressRulesResponse) super.set(fieldName, value);
  }

  @Override
  public ListIngressRulesResponse clone() {
    return (ListIngressRulesResponse) super.clone();
  }

}


text:
"""\
Includes only the bare minimum required to run wordcount. See
wordcount-full.py for an example that uses counters, RecordReader, etc.
"""
# DOCS_INCLUDE_START
import pydoop.mapreduce.api as api
import pydoop.mapreduce.pipes as pipes

class Mapper(api.Mapper):

    def map(self, context):
        for w in context.value.split():
            context.emit(w, 1)

class Reducer(api.Reducer):

    def reduce(self, context):
        context.emit(context.key, sum(context.values))

FACTORY = pipes.Factory(Mapper, reducer_class=Reducer)

def main():
    pipes.run_task(FACTORY)

if __name__ == "__main__":
    main()


text:
      PROJECT INFORMATION FOR PUDs (if applicable)

                Is the developer/builder in control of the Homeowners' Association (HOA)?

                <select id="homeowners-association">
                  <option>Select</option>
                  <option>Yes</option>
                  <option>No </option>
                </select>

Unit type(s)

                <select id="unit-types">
                  <option>Select</option>
                  <option>Detached</option>
                  <option>Attached </option>
                </select>

            Provide the following information for PUDs ONLY if the developer/builder is in control
            of the HOA and the subject property is an attached dwelling unit.

Legal name of project

                <input type="text" id="legal-name-of-project" placeholder="Legal name of project" />

Total number of phases

                <input type="text" id="total-number-of-phases" placeholder="Total number of phases" />

Total number of units

                <input type="text" id="total-number-of-units" placeholder="Total number of units" />

Total number of units sold

                <input type="text" id="total-number-of-units-sold" placeholder="Total number of units sold" />

Total number of units rented

                <input type="text" id="total-number-of-units-rented" placeholder="Total number of units rented" />

Total number of units for sale

                <input type="text" id="total-number-of-units-for-sale" placeholder="Total number of units for sale" />

Data source(s)

                <input type="text" id="data-sources-pud" placeholder="Data source(s)" />

Was the project created by the conversion of an existing building(s) into a PUD?

                <select id="project-created-by-conversion">
                  <option>Select</option>
                  <option>Yes</option>
                  <option>No </option>
                </select>

If Yes, date of conversion

                <input type="date" id="project-created-by-conversion-yes" />

Data source(s)

                <input type="text" id="data-sources-conversion" placeholder="Data source(s)" />

Does the project contain any multi-dwelling units?

                <select id="multi-dwelling">
                  <option>Select</option>
                  <option>Yes</option>
                  <option>No </option>
                </select>

Data source(s)

                <input type="text" id="data-sources-multi-dwelling" placeholder="Data source(s)" />

Are the units, common elements, and recreation facilities complete?

                <select id="facilities-complete">
                  <option>Select</option>
                  <option>Yes</option>
                  <option>No </option>
                </select>

If No, describe the status of completion

                <input type="text" id="facilities-complete-no" placeholder="If No, describe the status of completion" />

Are the common elements leased to or by the Homeowners' Association?

                <select id="leased-to-homeowners-association">
                  <option>Select</option>
                  <option>Yes</option>
                  <option>No </option>
                </select>

If Yes, describe the rental terms and options.

                <input type="text" id="leased-to-homeowners-association-yes" placeholder="If Yes, describe the rental terms and options." />

Describe common elements and recreational facilities

                <textarea type="text" id="describe-common-elements" placeholder="Describe common elements and recreational facilities"></textarea>


text:
class CreateGuesses < ActiveRecord::Migration
 def change
    create_table :guesses do |t|
      t.boolean :correct, :default => false
      t.references :user
      t.references :round
      t.references :card
      t.string :answer

      t.timestamps
    end
  end
end