text:
package com.fly.cj.ui.object;

public class ActiveUserRequest {
    /*Local Data Send To Server*/
    String email;
    String password;
    private String auth_token;

    /*Initiate Class*/
    public ActiveUserRequest(){}

    public ActiveUserRequest(ActiveUserRequest data){
        email = data.getUsername();
        password = data.getPassword();
        auth_token = data.getAuth_token();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return email;
    }

    public void setUsername(String username) {
        this.email = username;
    }

    public String getAuth_token() {
        return auth_token;
    }

    public void setAuth_token(String auth_token) {
        this.auth_token = auth_token;
    }

    /*Response Data From Server*/
    String status;

    public String getStatus() {
        return status;
    }
}


text:
exports.up = (knex, Promise) => {
  return knex.schema.createTableIfNotExists('transactions', (table) => {
    table.increments('id').primary();
    table.integer('amount');
    table.string('description');
    table.integer('from_account_id');
    table.integer('to_account_id');
  })
};

exports.down = (knex, Promise) => {
  return knex.schema.dropTable('transactions');
};

redpajama_set_name: RedPajamaGithub


text:
package com.canyinghao.cananimation;

import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.Interpolator;
import android.widget.ViewAnimator;

public class CanFlipAnimation {

    public enum FlipDirection {
        LEFT_RIGHT,
        RIGHT_LEFT,
        TOP_BOTTOM,
        BOTTOM_TOP;

        public float getStartDegreeForFirstView() {
            return 0;
        }

        public float getStartDegreeForSecondView() {
            switch (this) {
                case LEFT_RIGHT:
                case TOP_BOTTOM:
                    return -90;
                case RIGHT_LEFT:
                case BOTTOM_TOP:
                    return 90;
                default:
                    return 0;
            }
        }

        public float getEndDegreeForFirstView() {
            switch (this) {
                case LEFT_RIGHT:
                case TOP_BOTTOM:
                    return 90;
                case RIGHT_LEFT:
                case BOTTOM_TOP:
                    return -90;
                default:
                    return 0;
            }
        }

        public float getEndDegreeForSecondView() {
            return 0;
        }

    }

    private static Animation[] flipAnim(final View fromView, FlipDirection dir, long duration, Interpolator interpolator,  float scale) {
        Animation[] result = new Animation[2];
        float centerX;
        float centerY;

        centerX = fromView.getWidth() / 2.0f;
        centerY = fromView.getHeight() / 2.0f;

        FlipAnimation outFlip = new FlipAnimation(dir.getStartDegreeForFirstView(), dir.getEndDegreeForFirstView(), centerX, centerY, scale);
        outFlip.setDuration(duration);
        outFlip.setFillAfter(true);
        outFlip.setInterpolator(interpolator == null ? new AccelerateInterpolator() : interpolator);

        if (dir == FlipDirection.BOTTOM_TOP || dir == FlipDirection.TOP_BOTTOM) {
            outFlip.setIsX(true);
        } else {
            outFlip.setIsX(false);
        }

        AnimationSet outAnimation = new AnimationSet(true);
        outAnimation.addAnimation(outFlip);
        result[0] = outAnimation;

        FlipAnimation inFlip = new FlipAnimation(dir.getStartDegreeForSecondView(), dir.getEndDegreeForSecondView(), centerX, centerY, scale);
        inFlip.setDuration(duration);
        inFlip.setFillAfter(true);
        inFlip.setInterpolator(interpolator == null ? new AccelerateInterpolator() : interpolator);
        inFlip.setStartOffset(duration);

        if (dir == FlipDirection.BOTTOM_TOP || dir == FlipDirection.TOP_BOTTOM) {
            inFlip.setIsX(true);
        } else {
            inFlip.setIsX(false);
        }

        AnimationSet inAnimation = new AnimationSet(true);
        inAnimation.addAnimation(inFlip);
        result[1] = inAnimation;

        return result;

    }

    private static Animation[] flipTransition(final ViewAnimator viewAnimator, FlipDirection dir, long duration, Interpolator interpolator,  float scale) {

        Animation[] animations = flipAnim(viewAnimator, dir, duration, interpolator, scale);

        viewAnimator.setOutAnimation(animations[0]);
        viewAnimator.setInAnimation(animations[1]);
        viewAnimator.showNext();
        return animations;
    }

    /**
     * 翻转动画翻转一定次数
     *
     * @param count        int
     * @param viewAnimator ViewAnimator
     * @param dir          FlipDirection
     * @param duration     long
     * @param interpolator Interpolator
     * @param scale        float
     */
    public static void flipRepeat(final int count, final ViewAnimator viewAnimator, final FlipDirection dir, final long duration, final Interpolator interpolator,  final float scale) {

        if (count > 0) {
            if (viewAnimator.getTag() == null) {
                viewAnimator.setTag(1);
            } else {

                if (viewAnimator.getTag() instanceof Integer) {

                    int index = (int) viewAnimator.getTag();

                    if (index >= count) {
                        return;
                    }

                    viewAnimator.setTag(index + 1);
                }

            }
        } else {

            if (viewAnimator.getTag() instanceof Integer) {
                int index = (int) viewAnimator.getTag();

                if (index == -1) {
                    return;
                }
            }
        }

        try {
            Animation[] anims = flipTransition(viewAnimator, dir, duration, interpolator, scale);

            anims[1].setAnimationListener(new Animation.AnimationListener() {

                @Override
                public void onAnimationStart(Animation arg0) {

                }

                @Override
                public void onAnimationRepeat(Animation arg0) {

                }

                @Override
                public void onAnimationEnd(Animation arg0) {
                    flipRepeat(count, viewAnimator, dir, duration, interpolator, scale);

                }
            });
        } catch (Throwable e) {
            e.printStackTrace();
        }

    }

    public static void flipForever(final ViewAnimator viewAnimator, final FlipDirection dir, final long duration, final Interpolator interpolator,  final float scale) {

        flipRepeat(0, viewAnimator, dir, duration, interpolator, scale);
    }

}


text:
@extends('layouts/email')

@section('content')

Hey there, it seems you or someone else thought you forgot your password for
                                PatchNotes. If this is a mistake, just ignore this email.

Anyways, so here's how you can reset your password:

email, $forgotCode)) }}">Visit this page

Pick a new password

Login using the new password!

We hope that's pretty simple, if not, let us know!

    @stop


text:
<?xml version="1.0" encoding="UTF-8"?>
<LearningStandards>
  <LearningStandardItem xml:lang="en" RefID="CA34E348943F4bddAFCEF836A703E950">
    <RefURI>http://corestandards.org/ELA-Literacy/L/11-12/5/b/</RefURI>
    <StandardHierarchyLevel>
      <number>6</number>
      <description>Component</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.ELA-Literacy.L.11-12.5b</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>Analyze nuances in the meaning of words with similar denotations.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>11-12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>0FAC40650F514a459951A657F942B845</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">94DBD12EFA6C453aA36026D6B555CC7C</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
</LearningStandards>


text:
<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.yaz4j</groupId>
    <artifactId>yaz4j-lib</artifactId>
    <version>1.4-SNAPSHOT</version>
  </parent>
  <groupId>org.yaz4j</groupId>
  <artifactId>yaz4j</artifactId>
  <name>yaz4j</name>

   <packaging>dll</packaging>

   <build>
     <testSourceDirectory>../src/test</testSourceDirectory>
     <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>native-maven-plugin</artifactId>
         <extensions>true</extensions>
         <configuration>
           <javahOS>win32</javahOS>
           <!--<envFactoryName>org.codehaus.mojo.natives.msvc.MSVC6EnvFactory</envFactoryName>-->

           <compilerProvider>msvc</compilerProvider>

           <compilerStartOptions>
             <compilerStartOption>${yaz.include}</compilerStartOption>
             <compilerStartOption>/D WIN32</compilerStartOption>
           </compilerStartOptions>
           <sources>
            <source>
              <includes>
                <include>**/*.cpp</include>
              </includes>
              <directory>../src/main/native</directory>
            </source>
            <source>
              <includes>
                <include>**/*.cpp</include>
              </includes>
              <directory>../target/generated-sources/native</directory>
            </source>
          </sources>
	  <linkerStartOptions>
            <linkerStartOption>/dll</linkerStartOption>
          </linkerStartOptions>
          <linkerEndOptions>
            <linkerEndOption>${yaz.libs}</linkerEndOption>
          </linkerEndOptions>
        </configuration>
       </plugin>

      <!-- this is to compile and execute tests, that are arch-dependent
       because they need to load so/dll -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <encoding>UTF-8</encoding>
          <source>1.6</source>
          <target>1.6</target>
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>include-generated-test-sources</id>
            <phase>generate-test-sources</phase>
            <goals><goal>add-test-source</goal></goals>
            <configuration>
              <sources>
                <source>../src/main/java</source>
                <source>../target/generated-sources/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>once</forkMode>
	  <workingDirectory>target</workingDirectory>
	  <environmentVariables>
	    <PATH>${project.build.directory};${yaz.path}\bin</PATH>
          </environmentVariables>
        </configuration>
      </plugin>

    </plugins>
  </build>
</project>


text:
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace Citrina
{
    public class MessagesConversationPeer
    {
        public int? Id { get; set; }

        public int? LocalId { get; set; }

        public string Type { get; set; }
    }
}


text:
'use strict';

/**
 * @ignore
 * @suppress {duplicate}
 */
var utils = require('../utils');

/**
 * @typedef {{workingDirectory: !string,
 *            unitName: !string,
 *            globalSources: !Array<string>,
 *            unitSources: !Array<string>,
 *            globalExterns: !Array<string>,
 *            unitExterns: !Array<string>,
 *            globalBuildOptions: !Array<string>,
 *            unitBuildOptions: !Array<string>,
 *            outputFile: (?string|undefined),
 *            globalWarningsFilterFile: Array<string>,
 *            unitWarningsFilterFile: Array<string>}}
 */
var CompilerConfiguration;

/**
 * @typedef {{code: !number,
 *            stdout: ?string,
 *            stderr: ?string}}
 */
var CompilationResult;

/**
 * The constructor function for {@link Compiler}.
 *
 * @classdesc This class is an abstract base class for a compiler that returns the final JavaScript code.
 *
 * @constructor
 *
 * @throws {Error} Thrown if this class gets instaniated.
 */
function Compiler () { }

/**
 * Invokes the Closure Compiler and returns a Promise holding the compilation results.
 *
 * @virtual
 *
 * @returns {QPromise<CompilationResult>} A promise holding the compilation result.
 * @param {!CompilerConfiguration} compilationUnit The compiler configuration for the current compilation unit.
 *
 * @throws {Error} Thrown if compilationUnit is of a wrong type.
 */
Compiler.prototype.compile = function (compilationUnit) { };

/**
 * Transforms the passed unit configuration to a valid configuration for the Closure Compiler.
 *
 * @static
 *
 * @returns {Array<string>} An array of strings that describes all the compiler arguments based on the passed
 *          configuration for the compilation unit.
 * @param {CompilerConfiguration} unitConfiguration An object containing the entire configuration settings for one
 *        compilation unit.
 * @throws {Error} In case the configuration is not valid.
 */
Compiler.getCompilerArguments = function (unitConfiguration) {
    var buildOptions = utils.mergeArguments(unitConfiguration.globalBuildOptions, unitConfiguration.unitBuildOptions);
    var externs = utils.mergeArrays(unitConfiguration.globalExterns, unitConfiguration.unitExterns,
                                    utils.getValuesFromArgumentsArray(buildOptions, '--externs'));
    var sources = utils.mergeArrays(unitConfiguration.globalSources, unitConfiguration.unitSources,
                                    utils.getValuesFromArgumentsArray(buildOptions, '--js'));

    var outputFile = utils.getValuesFromArgumentsArray(buildOptions, '--js_output_file');
    if (outputFile.length !== 0) outputFile.unshift('--js_output_file');
    if (outputFile.length !== 0 && unitConfiguration.outputFile) {
        throw new Error('"--js_output_file" must not be set in "buildOptions" when "outputFile" property is used!');
    }
    if (unitConfiguration.outputFile) outputFile.push('--js_output_file', unitConfiguration.outputFile);
    if (externs.length !== 0) externs = utils.valuesToArgumentsArray(externs, '--externs');
    if (sources.length !== 0) sources = utils.valuesToArgumentsArray(sources, '--js');
    var cleanedBuildOptions =
            utils.removeTuplesFromArray(buildOptions, utils.listToTuples(externs.concat(sources).concat(outputFile)));
    return cleanedBuildOptions.concat(externs).concat(sources).concat(outputFile);
};

module.exports = Compiler;


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.PatternMatching;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.Tags;

namespace Microsoft.CodeAnalysis.Completion
{
    internal abstract partial class CommonCompletionService : CompletionService
    {
        protected CommonCompletionService(SolutionServices services, IAsynchronousOperationListenerProvider listenerProvider)
            : base(services, listenerProvider)
        {
        }

        protected override CompletionItem GetBetterItem(CompletionItem item, CompletionItem existingItem)
        {
            // We've constructed the export order of completion providers so
            // that snippets are exported after everything else. That way,
            // when we choose a single item per display text, snippet
            // glyphs appear by snippets. This breaks pre-selection of items
            // whose display text is also a snippet (workitem 852578),
            // the snippet item doesn't have its preselect bit set.
            // We'll special case this by not preferring later items
            // if they are snippets and the other candidate is preselected.
            if (existingItem.Rules.MatchPriority != MatchPriority.Default && IsSnippetItem(item))
            {
                return existingItem;
            }

            return base.GetBetterItem(item, existingItem);
        }

        protected static bool IsKeywordItem(CompletionItem item)
            => item.Tags.Contains(WellKnownTags.Keyword);

        protected static bool IsSnippetItem(CompletionItem item)
            => item.Tags.Contains(WellKnownTags.Snippet);

        internal override void FilterItems(
           Document document,
           IReadOnlyList<MatchResult> matchResults,
           string filterText,
           IList<MatchResult> builder)
        {
            var helper = CompletionHelper.GetHelper(document);
            CompletionService.FilterItems(helper, matchResults, filterText, builder);
        }
    }
}


text:
var part1 = require('./part1')
var part2 = require('./part2')

var fs = require('fs');
var input = fs.readFileSync('input.txt', 'utf8');

console.log('Part 1 Answer:', part1.process(input))
console.log('Part 2 Answer Table - Pick out the one you need')
part2.process(input)


text:
from __future__ import unicode_literals

from django.db import models, migrations

def populate_null_weight_rows(apps, schema_editor):
    Offer = apps.get_model('volontulo', 'Offer')
    records = Offer.objects.filter(weight__isnull=True)
    for row in records:
        row.weight = 0
        Offer(**row).save()

class Migration(migrations.Migration):

    dependencies = [
        ('volontulo', '0002_userprofile_phone_no'),
    ]

    operations = [
        migrations.AddField(
            model_name='offer',
            name='weight',
            field=models.IntegerField(blank=True, default=0, null=True),
        ),
        migrations.RunPython(populate_null_weight_rows),
    ]


text:
module com.baz
{
  requires com.bar;

  // workaround javadoc bug;
  exports com.baz;
}


text:
package net.tomorrowletter.tomorrow.web.model;

import java.util.Date;

/**
 * @author zhaofeng
 * @date 2016/11/12
 */
public class SysSender {
    public static int TYPE_LOOP = 0;
    public static int TYPE_ONCE = 1;

    public static int SEND_TO_ALL = 0;
    public static int SEND_TO_BIRTHDAY = 1;
    public static int SEND_TO_SOMEBODY = 2;

    private String uuid;
    private Date sendTime;
    private boolean isSend;
    private int type;
    private int sendTo;

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public boolean isSend() {
        return isSend;
    }

    public void setSend(boolean send) {
        isSend = send;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSendTo() {
        return sendTo;
    }

    public void setSendTo(int sendTo) {
        this.sendTo = sendTo;
    }
}


text:
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _snabbdomJsx = require('../../../snabbdom-jsx');

var _unionType = require('union-type');

var _unionType2 = _interopRequireDefault(_unionType);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/** @jsx html */

var Action = (0, _unionType2.default)({
  Increment: [],
  Decrement: []
});

var view = function view(_ref) {
  var model = _ref.model;
  var handler = _ref.handler;
  return (0, _snabbdomJsx.html)(
    'div',
    null,
    (0, _snabbdomJsx.html)(
      'button',
      {
        'on-click': [handler, Action.Increment()] },
      '+'
    ),
    (0, _snabbdomJsx.html)(
      'button',
      {
        'on-click': [handler, Action.Decrement()] },
      '-'
    ),
    (0, _snabbdomJsx.html)(
      'div',
      null,
      'Count : ',
      model
    )
  );
};

function init() {
  return 0;
}

function update(count, action) {
  return Action.case({
    Increment: function Increment() {
      return count + 1;
    },
    Decrement: function Decrement() {
      return count - 1;
    }
  }, action);
}

exports.default = { view: view, init: init, update: update, Action: Action };

},{"../../../snabbdom-jsx":17,"union-type":16}],2:[function(require,module,exports){
'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _snabbdomJsx = require('../../../snabbdom-jsx');

var _unionType = require('union-type');

var _unionType2 = _interopRequireDefault(_unionType);

var _counter = require('./counter');

var _counter2 = _interopRequireDefault(_counter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /** @jsx html */

var Action = (0, _unionType2.default)({
  Add: [],
  Remove: [Number],
  Reset: [],
  Update: [Number, _counter2.default.Action]
});

/*  model : {
      counters: [{id: Number, counter: counter.model}],
      nextID  : Number
    }
*/
var view = function view(_ref) {
  var model = _ref.model;
  var handler = _ref.handler;
  return (0, _snabbdomJsx.html)(
    'div',
    null,
    (0, _snabbdomJsx.html)(
      'button',
      {
        'on-click': [handler, Action.Add()] },
      'Add'
    ),
    (0, _snabbdomJsx.html)(
      'button',
      {
        'on-click': [handler, Action.Reset()] },
      'Reset'
    ),
    (0, _snabbdomJsx.html)('hr', null),
    (0, _snabbdomJsx.html)(
      'div',
      null,
      model.counters.map(function (item) {
        return (0, _snabbdomJsx.html)(CounterItem, { item: item, handler: handler });
      })
    )
  );
};

var CounterItem = function CounterItem(_ref2) {
  var item = _ref2.item;
  var _handler = _ref2.handler;
  return (0, _snabbdomJsx.html)(
    'div',
    { key: item.id },
    (0, _snabbdomJsx.html)(
      'button',
      {
        'on-click': [_handler, Action.Remove(item.id)] },
      'Remove'
    ),
    (0, _snabbdomJsx.html)(_counter2.default, {
      model: item.counter,
      handler: function handler(a) {
        return _handler(Action.Update(item.id, a));
      } })
  );
};

function init() {
  return { nextID: 1, counters: [] };
}

function addCounter(model) {
  var newCounter = { id: model.nextID, counter: _counter2.default.init() };
  return {
    counters: [].concat(_toConsumableArray(model.counters), [newCounter]),
    nextID: model.nextID + 1
  };
}

function resetCounters(model) {

  return _extends({}, model, {
    counters: model.counters.map(function (item) {
      return _extends({}, item, {
        counter: _counter2.default.init()
      });
    })
  });
}

function removeCounter(model, id) {
  return _extends({}, model, {
    counters: model.counters.filter(function (item) {
      return item.id !== id;
    })
  });
}

function updateCounter(model, id, action) {
  return _extends({}, model, {
    counters: model.counters.map(function (item) {
      return item.id !== id ? item : _extends({}, item, {
        counter: _counter2.default.update(item.counter, action)
      });
    })
  });
}

function update(model, action) {

  return Action.case({
    Add: function Add() {
      return addCounter(model);
    },
    Remove: function Remove(id) {
      return removeCounter(model, id);
    },
    Reset: function Reset() {
      return resetCounters(model);
    },
    Update: function Update(id, action) {
      return updateCounter(model, id, action);
    }
  }, action);
}

exports.default = { view: view, init: init, update: update, Action: Action };

},{"../../../snabbdom-jsx":17,"./counter":1,"union-type":16}],3:[function(require,module,exports){
'use strict';

var _snabbdom = require('snabbdom');

var _snabbdom2 = _interopRequireDefault(_snabbdom);

var _counterList = require('./counterList');

var _counterList2 = _interopRequireDefault(_counterList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var patch = _snabbdom2.default.init([require('snabbdom/modules/class'), // makes it easy to toggle classes
require('snabbdom/modules/props'), // for setting properties on DOM elements
require('snabbdom/modules/style'), // handles styling on elements with support for animations
require('snabbdom/modules/eventlisteners')]);

// attaches event listeners
function main(initState, oldVnode, _ref) {
  var view = _ref.view;
  var update = _ref.update;

  var newVnode = view({
    model: initState,
    handler: function handler(e) {
      var newState = update(initState, e);
      main(newState, newVnode, { view: view, update: update });
    }
  });
  patch(oldVnode, newVnode);
}

main(_counterList2.default.init(), // the initial state
document.getElementById('placeholder'), _counterList2.default);

},{"./counterList":2,"snabbdom":14,"snabbdom/modules/class":10,"snabbdom/modules/eventlisteners":11,"snabbdom/modules/props":12,"snabbdom/modules/style":13}],4:[function(require,module,exports){
var _curry2 = require('./internal/_curry2');

/**
 * Wraps a function of any arity (including nullary) in a function that accepts exactly `n`
 * parameters. Unlike `nAry`, which passes only `n` arguments to the wrapped function,
 * functions produced by `arity` will pass all provided arguments to the wrapped function.
 *
 * @func
 * @memberOf R
 * @sig (Number, (* -> *)) -> (* -> *)
 * @category Function
 * @param {Number} n The desired arity of the returned function.
 * @param {Function} fn The function to wrap.
 * @return {Function} A new function wrapping `fn`. The new function is
 *         guaranteed to be of arity `n`.
 * @deprecated since v0.15.0
 * @example
 *
 *      var takesTwoArgs = function(a, b) {
 *        return [a, b];
 *      };
 *      takesTwoArgs.length; //=> 2
 *      takesTwoArgs(1, 2); //=> [1, 2]
 *
 *      var takesOneArg = R.arity(1, takesTwoArgs);
 *      takesOneArg.length; //=> 1
 *      // All arguments are passed through to the wrapped function
 *      takesOneArg(1, 2); //=> [1, 2]
 */
module.exports = _curry2(function(n, fn) {
  // jshint unused:vars
  switch (n) {
    case 0: return function() {return fn.apply(this, arguments);};
    case 1: return function(a0) {return fn.apply(this, arguments);};
    case 2: return function(a0, a1) {return fn.apply(this, arguments);};
    case 3: return function(a0, a1, a2) {return fn.apply(this, arguments);};
    case 4: return function(a0, a1, a2, a3) {return fn.apply(this, arguments);};
    case 5: return function(a0, a1, a2, a3, a4) {return fn.apply(this, arguments);};
    case 6: return function(a0, a1, a2, a3, a4, a5) {return fn.apply(this, arguments);};
    case 7: return function(a0, a1, a2, a3, a4, a5, a6) {return fn.apply(this, arguments);};
    case 8: return function(a0, a1, a2, a3, a4, a5, a6, a7) {return fn.apply(this, arguments);};
    case 9: return function(a0, a1, a2, a3, a4, a5, a6, a7, a8) {return fn.apply(this, arguments);};
    case 10: return function(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {return fn.apply(this, arguments);};
    default: throw new Error('First argument to arity must be a non-negative integer no greater than ten');
  }
});

},{"./internal/_curry2":7}],5:[function(require,module,exports){
var _curry2 = require('./internal/_curry2');
var _curryN = require('./internal/_curryN');
var arity = require('./arity');

/**
 * Returns a curried equivalent of the provided function, with the
 * specified arity. The curried function has two unusual capabilities.
 * First, its arguments needn't be provided one at a time. If `g` is
 * `R.curryN(3, f)`, the following are equivalent:
 *
 *   - `g(1)(2)(3)`
 *   - `g(1)(2, 3)`
 *   - `g(1, 2)(3)`
 *   - `g(1, 2, 3)`
 *
 * Secondly, the special placeholder value `R.__` may be used to specify
 * "gaps", allowing partial application of any combination of arguments,
 * regardless of their positions. If `g` is as above and `_` is `R.__`,
 * the following are equivalent:
 *
 *   - `g(1, 2, 3)`
 *   - `g(_, 2, 3)(1)`
 *   - `g(_, _, 3)(1)(2)`
 *   - `g(_, _, 3)(1, 2)`
 *   - `g(_, 2)(1)(3)`
 *   - `g(_, 2)(1, 3)`
 *   - `g(_, 2)(_, 3)(1)`
 *
 * @func
 * @memberOf R
 * @category Function
 * @sig Number -> (* -> a) -> (* -> a)
 * @param {Number} length The arity for the returned function.
 * @param {Function} fn The function to curry.
 * @return {Function} A new, curried function.
 * @see R.curry
 * @example
 *
 *      var addFourNumbers = function() {
 *        return R.sum([].slice.call(arguments, 0, 4));
 *      };
 *
 *      var curriedAddFourNumbers = R.curryN(4, addFourNumbers);
 *      var f = curriedAddFourNumbers(1, 2);
 *      var g = f(3);
 *      g(4); //=> 10
 */
module.exports = _curry2(function curryN(length, fn) {
  return arity(length, _curryN(length, [], fn));
});

},{"./arity":4,"./internal/_curry2":7,"./internal/_curryN":8}],6:[function(require,module,exports){
/**
 * Optimized internal two-arity curry function.
 *
 * @private
 * @category Function
 * @param {Function} fn The function to curry.
 * @return {Function} The curried function.
 */
module.exports = function _curry1(fn) {
  return function f1(a) {
    if (arguments.length === 0) {
      return f1;
    } else if (a != null && a['@@functional/placeholder'] === true) {
      return f1;
    } else {
      return fn(a);
    }
  };
};

},{}],7:[function(require,module,exports){
var _curry1 = require('./_curry1');

/**
 * Optimized internal two-arity curry function.
 *
 * @private
 * @category Function
 * @param {Function} fn The function to curry.
 * @return {Function} The curried function.
 */
module.exports = function _curry2(fn) {
  return function f2(a, b) {
    var n = arguments.length;
    if (n === 0) {
      return f2;
    } else if (n === 1 && a != null && a['@@functional/placeholder'] === true) {
      return f2;
    } else if (n === 1) {
      return _curry1(function(b) { return fn(a, b); });
    } else if (n === 2 && a != null && a['@@functional/placeholder'] === true &&
                          b != null && b['@@functional/placeholder'] === true) {
      return f2;
    } else if (n === 2 && a != null && a['@@functional/placeholder'] === true) {
      return _curry1(function(a) { return fn(a, b); });
    } else if (n === 2 && b != null && b['@@functional/placeholder'] === true) {
      return _curry1(function(b) { return fn(a, b); });
    } else {
      return fn(a, b);
    }
  };
};

},{"./_curry1":6}],8:[function(require,module,exports){
var arity = require('../arity');

/**
 * Internal curryN function.
 *
 * @private
 * @category Function
 * @param {Number} length The arity of the curried function.
 * @return {array} An array of arguments received thus far.
 * @param {Function} fn The function to curry.
 */
module.exports = function _curryN(length, received, fn) {
  return function() {
    var combined = [];
    var argsIdx = 0;
    var left = length;
    var combinedIdx = 0;
    while (combinedIdx < received.length || argsIdx < arguments.length) {
      var result;
      if (combinedIdx < received.length &&
          (received[combinedIdx] == null ||
           received[combinedIdx]['@@functional/placeholder'] !== true ||
           argsIdx >= arguments.length)) {
        result = received[combinedIdx];
      } else {
        result = arguments[argsIdx];
        argsIdx += 1;
      }
      combined[combinedIdx] = result;
      if (result == null || result['@@functional/placeholder'] !== true) {
        left -= 1;
      }
      combinedIdx += 1;
    }
    return left <= 0 ? fn.apply(this, combined) : arity(left, _curryN(length, combined, fn));
  };
};

},{"../arity":4}],9:[function(require,module,exports){
module.exports = {
  array: Array.isArray,
  primitive: function(s) { return typeof s === 'string' || typeof s === 'number'; },
};

},{}],10:[function(require,module,exports){
function updateClass(oldVnode, vnode) {
  var cur, name, elm = vnode.elm,
      oldClass = oldVnode.data.class || {},
      klass = vnode.data.class || {};
  for (name in klass) {
    cur = klass[name];
    if (cur !== oldClass[name]) {
      elm.classList[cur ? 'add' : 'remove'](name);
    }
  }
}

module.exports = {create: updateClass, update: updateClass};

},{}],11:[function(require,module,exports){
var is = require('../is');

function arrInvoker(arr) {
  return function() {
    // Special case when length is two, for performance
    arr.length === 2 ? arr[0](arr[1]) : arr[0].apply(undefined, arr.slice(1));
  };
}

function fnInvoker(o) {
  return function(ev) { o.fn(ev); };
}

function updateEventListeners(oldVnode, vnode) {
  var name, cur, old, elm = vnode.elm,
      oldOn = oldVnode.data.on || {}, on = vnode.data.on;
  if (!on) return;
  for (name in on) {
    cur = on[name];
    old = oldOn[name];
    if (old === undefined) {
      if (is.array(cur)) {
        elm.addEventListener(name, arrInvoker(cur));
      } else {
        cur = {fn: cur};
        on[name] = cur;
        elm.addEventListener(name, fnInvoker(cur));
      }
    } else if (is.array(old)) {
      // Deliberately modify old array since it's captured in closure created with `arrInvoker`
      old.length = cur.length;
      for (var i = 0; i < old.length; ++i) old[i] = cur[i];
      on[name]  = old;
    } else {
      old.fn = cur;
      on[name] = old;
    }
  }
}

module.exports = {create: updateEventListeners, update: updateEventListeners};

},{"../is":9}],12:[function(require,module,exports){
function updateProps(oldVnode, vnode) {
  var key, cur, old, elm = vnode.elm,
      oldProps = oldVnode.data.props || {}, props = vnode.data.props || {};
  for (key in props) {
    cur = props[key];
    old = oldProps[key];
    if (old !== cur) {
      elm[key] = cur;
    }
  }
}

module.exports = {create: updateProps, update: updateProps};

},{}],13:[function(require,module,exports){
var raf = requestAnimationFrame || setTimeout;
var nextFrame = function(fn) { raf(function() { raf(fn); }); };

function setNextFrame(obj, prop, val) {
  nextFrame(function() { obj[prop] = val; });
}

function updateStyle(oldVnode, vnode) {
  var cur, name, elm = vnode.elm,
      oldStyle = oldVnode.data.style || {},
      style = vnode.data.style || {},
      oldHasDel = 'delayed' in oldStyle;
  for (name in style) {
    cur = style[name];
    if (name === 'delayed') {
      for (name in style.delayed) {
        cur = style.delayed[name];
        if (!oldHasDel || cur !== oldStyle.delayed[name]) {
          setNextFrame(elm.style, name, cur);
        }
      }
    } else if (name !== 'remove' && cur !== oldStyle[name]) {
      elm.style[name] = cur;
    }
  }
}

function applyDestroyStyle(vnode) {
  var style, name, elm = vnode.elm, s = vnode.data.style;
  if (!s || !(style = s.destroy)) return;
  for (name in style) {
    elm.style[name] = style[name];
  }
}

function applyRemoveStyle(vnode, rm) {
  var s = vnode.data.style;
  if (!s || !s.remove) {
    rm();
    return;
  }
  var name, elm = vnode.elm, idx, i = 0, maxDur = 0,
      compStyle, style = s.remove, amount = 0, applied = [];
  for (name in style) {
    applied.push(name);
    elm.style[name] = style[name];
  }
  compStyle = getComputedStyle(elm);
  var props = compStyle['transition-property'].split(', ');
  for (; i < props.length; ++i) {
    if(applied.indexOf(props[i]) !== -1) amount++;
  }
  elm.addEventListener('transitionend', function(ev) {
    if (ev.target === elm) --amount;
    if (amount === 0) rm();
  });
}

module.exports = {create: updateStyle, update: updateStyle, destroy: applyDestroyStyle, remove: applyRemoveStyle};

},{}],14:[function(require,module,exports){
// jshint newcap: false
/* global require, module, document, Element */
'use strict';

var VNode = require('./vnode');
var is = require('./is');

function isUndef(s) { return s === undefined; }
function isDef(s) { return s !== undefined; }

function emptyNodeAt(elm) {
  return VNode(elm.tagName, {}, [], undefined, elm);
}

var emptyNode = VNode('', {}, [], undefined, undefined);

function sameVnode(vnode1, vnode2) {
  return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
}

function createKeyToOldIdx(children, beginIdx, endIdx) {
  var i, map = {}, key;
  for (i = beginIdx; i <= endIdx; ++i) {
    key = children[i].key;
    if (isDef(key)) map[key] = i;
  }
  return map;
}

function createRmCb(childElm, listeners) {
  return function() {
    if (--listeners === 0) childElm.parentElement.removeChild(childElm);
  };
}

var hooks = ['create', 'update', 'remove', 'destroy', 'pre', 'post'];

function init(modules) {
  var i, j, cbs = {};
  for (i = 0; i < hooks.length; ++i) {
    cbs[hooks[i]] = [];
    for (j = 0; j < modules.length; ++j) {
      if (modules[j][hooks[i]] !== undefined) cbs[hooks[i]].push(modules[j][hooks[i]]);
    }
  }

  function createElm(vnode, insertedVnodeQueue) {
    var i, data = vnode.data;
    if (isDef(data)) {
      if (isDef(i = data.hook) && isDef(i = i.init)) i(vnode);
      if (isDef(i = data.vnode)) vnode = i;
    }
    var elm, children = vnode.children, sel = vnode.sel;
    if (isDef(sel)) {
      // Parse selector
      var hashIdx = sel.indexOf('#');
      var dotIdx = sel.indexOf('.', hashIdx);
      var hash = hashIdx > 0 ? hashIdx : sel.length;
      var dot = dotIdx > 0 ? dotIdx : sel.length;
      var tag = hashIdx !== -1 || dotIdx !== -1 ? sel.slice(0, Math.min(hash, dot)) : sel;
      elm = vnode.elm = isDef(data) && isDef(i = data.ns) ? document.createElementNS(i, tag)
                                                          : document.createElement(tag);
      if (hash < dot) elm.id = sel.slice(hash + 1, dot);
      if (dotIdx > 0) elm.className = sel.slice(dot+1).replace(/\./g, ' ');
      if (is.array(children)) {
        for (i = 0; i < children.length; ++i) {
          elm.appendChild(createElm(children[i], insertedVnodeQueue));
        }
      } else if (is.primitive(vnode.text)) {
        elm.appendChild(document.createTextNode(vnode.text));
      }
      for (i = 0; i < cbs.create.length; ++i) cbs.create[i](emptyNode, vnode);
      i = vnode.data.hook; // Reuse variable
      if (isDef(i)) {
        if (i.create) i.create(emptyNode, vnode);
        if (i.insert) insertedVnodeQueue.push(vnode);
      }
    } else {
      elm = vnode.elm = document.createTextNode(vnode.text);
    }
    return vnode.elm;
  }

  function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {
    for (; startIdx <= endIdx; ++startIdx) {
      parentElm.insertBefore(createElm(vnodes[startIdx], insertedVnodeQueue), before);
    }
  }

  function invokeDestroyHook(vnode) {
    var i = vnode.data, j;
    if (isDef(i)) {
      if (isDef(i = i.hook) && isDef(i = i.destroy)) i(vnode);
      for (i = 0; i < cbs.destroy.length; ++i) cbs.destroy[i](vnode);
      if (isDef(i = vnode.children)) {
        for (j = 0; j < vnode.children.length; ++j) {
          invokeDestroyHook(vnode.children[j]);
        }
      }
    }
  }

  function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
    for (; startIdx <= endIdx; ++startIdx) {
      var i, listeners, rm, ch = vnodes[startIdx];
      if (isDef(ch)) {
        if (isDef(ch.sel)) {
          invokeDestroyHook(ch);
          listeners = cbs.remove.length + 1;
          rm = createRmCb(ch.elm, listeners);
          for (i = 0; i < cbs.remove.length; ++i) cbs.remove[i](ch, rm);
          if (isDef(i = ch.data) && isDef(i = i.hook) && isDef(i = i.remove)) {
            i(ch, rm);
          } else {
            rm();
          }
        } else { // Text node
          parentElm.removeChild(ch.elm);
        }
      }
    }
  }

  function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) {
    var oldStartIdx = 0, newStartIdx = 0;
    var oldEndIdx = oldCh.length - 1;
    var oldStartVnode = oldCh[0];
    var oldEndVnode = oldCh[oldEndIdx];
    var newEndIdx = newCh.length - 1;
    var newStartVnode = newCh[0];
    var newEndVnode = newCh[newEndIdx];
    var oldKeyToIdx, idxInOld, elmToMove, before;

    while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
      if (isUndef(oldStartVnode)) {
        oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
      } else if (isUndef(oldEndVnode)) {
        oldEndVnode = oldCh[--oldEndIdx];
      } else if (sameVnode(oldStartVnode, newStartVnode)) {
        patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
        oldStartVnode = oldCh[++oldStartIdx];
        newStartVnode = newCh[++newStartIdx];
      } else if (sameVnode(oldEndVnode, newEndVnode)) {
        patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
        oldEndVnode = oldCh[--oldEndIdx];
        newEndVnode = newCh[--newEndIdx];
      } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
        patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
        parentElm.insertBefore(oldStartVnode.elm, oldEndVnode.elm.nextSibling);
        oldStartVnode = oldCh[++oldStartIdx];
        newEndVnode = newCh[--newEndIdx];
      } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
        patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
        parentElm.insertBefore(oldEndVnode.elm, oldStartVnode.elm);
        oldEndVnode = oldCh[--oldEndIdx];
        newStartVnode = newCh[++newStartIdx];
      } else {
        if (isUndef(oldKeyToIdx)) oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
        idxInOld = oldKeyToIdx[newStartVnode.key];
        if (isUndef(idxInOld)) { // New element
          parentElm.insertBefore(createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
          newStartVnode = newCh[++newStartIdx];
        } else {
          elmToMove = oldCh[idxInOld];
          patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
          oldCh[idxInOld] = undefined;
          parentElm.insertBefore(elmToMove.elm, oldStartVnode.elm);
          newStartVnode = newCh[++newStartIdx];
        }
      }
    }
    if (oldStartIdx > oldEndIdx) {
      before = isUndef(newCh[newEndIdx+1]) ? null : newCh[newEndIdx+1].elm;
      addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
    } else if (newStartIdx > newEndIdx) {
      removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
    }
  }

  function patchVnode(oldVnode, vnode, insertedVnodeQueue) {
    var i, hook;
    if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) {
      i(oldVnode, vnode);
    }
    if (isDef(i = oldVnode.data) && isDef(i = i.vnode)) oldVnode = i;
    if (isDef(i = vnode.data) && isDef(i = i.vnode)) vnode = i;
    var elm = vnode.elm = oldVnode.elm, oldCh = oldVnode.children, ch = vnode.children;
    if (oldVnode === vnode) return;
    if (isDef(vnode.data)) {
      for (i = 0; i < cbs.update.length; ++i) cbs.update[i](oldVnode, vnode);
      i = vnode.data.hook;
      if (isDef(i) && isDef(i = i.update)) i(oldVnode, vnode);
    }
    if (isUndef(vnode.text)) {
      if (isDef(oldCh) && isDef(ch)) {
        if (oldCh !== ch) updateChildren(elm, oldCh, ch, insertedVnodeQueue);
      } else if (isDef(ch)) {
        addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
      } else if (isDef(oldCh)) {
        removeVnodes(elm, oldCh, 0, oldCh.length - 1);
      }
    } else if (oldVnode.text !== vnode.text) {
      elm.textContent = vnode.text;
    }
    if (isDef(hook) && isDef(i = hook.postpatch)) {
      i(oldVnode, vnode);
    }
  }

  return function(oldVnode, vnode) {
    var i;
    var insertedVnodeQueue = [];
    for (i = 0; i < cbs.pre.length; ++i) cbs.pre[i]();
    if (oldVnode instanceof Element) {
      if (oldVnode.parentElement !== null) {
        createElm(vnode, insertedVnodeQueue);
        oldVnode.parentElement.replaceChild(vnode.elm, oldVnode);
      } else {
        oldVnode = emptyNodeAt(oldVnode);
        patchVnode(oldVnode, vnode, insertedVnodeQueue);
      }
    } else {
      patchVnode(oldVnode, vnode, insertedVnodeQueue);
    }
    for (i = 0; i < insertedVnodeQueue.length; ++i) {
      insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]);
    }
    for (i = 0; i < cbs.post.length; ++i) cbs.post[i]();
    return vnode;
  };
}

module.exports = {init: init};

},{"./is":9,"./vnode":15}],15:[function(require,module,exports){
module.exports = function(sel, data, children, text, elm) {
  var key = data === undefined ? undefined : data.key;
  return {sel: sel, data: data, children: children,
          text: text, elm: elm, key: key};
};

},{}],16:[function(require,module,exports){
var curryN = require('ramda/src/curryN');

function isString(s) { return typeof s === 'string'; }
function isNumber(n) { return typeof n === 'number'; }
function isObject(value) {
  var type = typeof value;
  return !!value && (type == 'object' || type == 'function');
}
function isFunction(f) { return typeof f === 'function'; }
var isArray = Array.isArray || function(a) { return 'length' in a; };

var mapConstrToFn = curryN(2, function(group, constr) {
  return constr === String    ? isString
       : constr === Number    ? isNumber
       : constr === Object    ? isObject
       : constr === Array     ? isArray
       : constr === Function  ? isFunction
       : constr === undefined ? group
                              : constr;
});

function Constructor(group, name, validators) {
  validators = validators.map(mapConstrToFn(group));
  var constructor = curryN(validators.length, function() {
    var val = [], v, validator;
    for (var i = 0; i < arguments.length; ++i) {
      v = arguments[i];
      validator = validators[i];
      if ((typeof validator === 'function' && validator(v)) ||
          (v !== undefined && v !== null && v.of === validator)) {
        val[i] = arguments[i];
      } else {
        throw new TypeError('wrong value ' + v + ' passed to location ' + i + ' in ' + name);
      }
    }
    val.of = group;
    val.name = name;
    return val;
  });
  return constructor;
}

function rawCase(type, cases, action, arg) {
  if (type !== action.of) throw new TypeError('wrong type passed to case');
  var name = action.name in cases ? action.name
           : '_' in cases         ? '_'
                                  : undefined;
  if (name === undefined) {
    throw new Error('unhandled value passed to case');
  } else {
    return cases[name].apply(undefined, arg !== undefined ? action.concat([arg]) : action);
  }
}

var typeCase = curryN(3, rawCase);
var caseOn = curryN(4, rawCase);

function Type(desc) {
  var obj = {};
  for (var key in desc) {
    obj[key] = Constructor(obj, key, desc[key]);
  }
  obj.case = typeCase(obj);
  obj.caseOn = caseOn(obj);
  return obj;
}

module.exports = Type;

},{"ramda/src/curryN":5}],17:[function(require,module,exports){
"use strict";

function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }

var SVGNS = 'http://www.w3.org/2000/svg';
var modulesNS = ['hook', 'on', 'style', 'class', 'props', 'attrs'];
var slice = Array.prototype.slice;

function isPrimitive(val) {
  return typeof val === 'string' || typeof val === 'number' || typeof val === 'boolean' || (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'symbol' || val === null || val === undefined;
}

function normalizeAttrs(attrs, nsURI, defNS, modules) {
  var map = { ns: nsURI };
  for (var i = 0, len = modules.length; i < len; i++) {
    var mod = modules[i];
    if (attrs[mod]) map[mod] = attrs[mod];
  }
  for (var key in attrs) {
    if (key !== 'key' && key !== 'classNames' && key !== 'selector') {
      var idx = key.indexOf('-');
      if (idx > 0) addAttr(key.slice(0, idx), key.slice(idx + 1), attrs[key]);else if (!map[key]) addAttr(defNS, key, attrs[key]);
    }
  }
  return map;

  function addAttr(namespace, key, val) {
    var ns = map[namespace] || (map[namespace] = {});
    ns[key] = val;
  }
}

function buildFromStringTag(nsURI, defNS, modules, tag, attrs, children) {

  if (attrs.selector) {
    tag = tag + attrs.selector;
  }
  if (attrs.classNames) {
    var cns = attrs.classNames;
    tag = tag + '.' + (Array.isArray(cns) ? cns.join('.') : cns.replace(/\s+/g, '.'));
  }

  return {
    sel: tag,
    data: normalizeAttrs(attrs, nsURI, defNS, modules),
    children: children.map(function (c) {
      return isPrimitive(c) ? { text: c } : c;
    }),
    key: attrs.key
  };
}

function buildFromComponent(nsURI, defNS, modules, tag, attrs, children) {
  var res;
  if (typeof tag === 'function') res = tag(attrs, children);else if (tag && typeof tag.view === 'function') res = tag.view(attrs, children);else if (tag && typeof tag.render === 'function') res = tag.render(attrs, children);else throw "JSX tag must be either a string, a function or an object with 'view' or 'render' methods";
  res.key = attrs.key;
  return res;
}

function buildVnode(nsURI, defNS, modules, tag, attrs, children) {
  attrs = attrs || {};
  if (typeof tag === 'string') {
    return buildFromStringTag(nsURI, defNS, modules, tag, attrs, children);
  } else {
    return buildFromComponent(nsURI, defNS, modules, tag, attrs, children);
  }
}

function JSX(nsURI, defNS, modules) {
  return function jsxWithCustomNS(tag, attrs, children) {
    if (arguments.length > 3 || !Array.isArray(children)) children = slice.call(arguments, 2);
    return buildVnode(nsURI, defNS || 'props', modules || modulesNS, tag, attrs, children);
  };
}

module.exports = {
  html: JSX(undefined),
  svg: JSX(SVGNS, 'attrs'),
  JSX: JSX
};

},{}]},{},[3]);


text:
import React from 'react';
import { Route, IndexRoute } from 'react-router';

import App from './App';
import Home from './Home';
import { InventoryItems, InventoryItemDetails } from './Inventory';
import NotFound from './NotFound';

export const routes = (
  <div>
    <Route path='/' component={App} >
        <IndexRoute component={Home} />
        <Route path='/inventory-items' component={InventoryItems} />
        <Route path='/inventory-items/:id' component={InventoryItemDetails} />
    </Route>
    <Route path='*' component={NotFound} />
  </div>
);


text:
<!DOCTYPE html>

    <meta charset='UTF-8'>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/thermostat.css">
    <title>mythermostat</title>

./thermostat

°C

      <input class='increase' type = 'button' value= '∧'>
      <input class='decrease' type = 'button' value= '∨'>

        <input class='reset' type = 'button' value='reset'>

        power saving

          <input id="powersaveInput" type='checkbox' checked>


text:
from django.contrib import admin

from models import DayPlan

class DayPlanAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'date', 'work_status')

admin.site.register(DayPlan, DayPlanAdmin)


text:
package com.google.bamboo.soy.format;

import com.google.bamboo.soy.SoyLanguage;
import com.intellij.application.options.CodeStyleAbstractConfigurable;
import com.intellij.application.options.CodeStyleAbstractPanel;
import com.intellij.application.options.TabbedLanguageCodeStylePanel;
import com.intellij.lang.Language;
import com.intellij.openapi.options.Configurable;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CodeStyleSettingsProvider;
import javax.annotation.Nonnull;

public class SoyCodeStyleSettingsProvider extends CodeStyleSettingsProvider {

  @Override
  public Language getLanguage() {
    return SoyLanguage.INSTANCE;
  }

  @Nonnull
  @Override
  public Configurable createSettingsPage(CodeStyleSettings settings,
      CodeStyleSettings originalSettings) {
    return new CodeStyleAbstractConfigurable(settings, originalSettings,
        getConfigurableDisplayName()) {
      @Override
      protected CodeStyleAbstractPanel createPanel(CodeStyleSettings settings) {
        return new TabbedLanguageCodeStylePanel(getLanguage(), settings, originalSettings) {
          @Override
          protected void initTabs(CodeStyleSettings settings) {
            addIndentOptionsTab(settings);
          }
        };
      }
    };
  }
}


text:
CKEDITOR.plugins.setLang( 'widget', 'id', {
	'move': 'Tekan dan geser untuk memindahkan'
} );


text:
import re

def timedReading(max_length, text):
    # Find all contiguous alphanumeric characters, these words have no hyphens.
    words = re.findall(r"[a-zA-Z]+", text)
    # Filter out words that have length greater than the max.
    words = list(filter(lambda word: len(word) <= max_length, words))
    # Return amount of words shorter than max length.
    return len(words)


text:
package controllers;

import org.junit.Test;

import play.mvc.Http.Response;
import play.test.FunctionalTest;

public class ApplicationTest extends FunctionalTest {

	@Test
	public void testThatIndexPageWorks() {
		Response response = GET("/");
		assertIsOk(response);
		assertContentType("text/html", response);
		assertCharset(play.Play.defaultWebEncoding, response);
	}

	@Test
	public void leTitreDuSiteDoitEtrePresentSurLaPageAccueil() {
		Response response = GET("/");
		assertIsOk(response);
		assertContentType("text/html", response);
		assertContentMatch("Bienvenue sur le trombinoscope", response);
	}

	@Test
	public void laPageAccueilDoitContenirRobertDupond() {
		Response response = GET("/");
		assertIsOk(response);
		assertContentType("text/html", response);
		assertContentMatch("Robert DUPOND", response);
	}

	@Test
	public void laRechercheDoitRemonterRobertDupond() {
		Response response = GET("/recherche/dupo");
		assertIsOk(response);
		assertContentType("text/html", response);
		assertContentMatch("Robert DUPOND", response);

		String strReponse = getContent(response);
		assertTrue("Henry MARTIN ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Henry MARTIN") == -1);

	}

	@Test
	public void laPageAccueilNeDoitAfficherQue15Profils() {
		Response response = GET("/");
		assertIsOk(response);
		assertContentType("text/html", response);

		// Vis-à-vis du jeu de données de test, nous devons avoir
		// sur la première page de Céline Ampère à Carine Lavoisier
		// Les profils de Henry MARTIN à Naomie WATT doivent
		// apparaitre en page 2

		assertContentMatch("Céline AMPÈRE", response);
		assertContentMatch("Carine LAVOISIER", response);

		String strReponse = getContent(response);
		assertTrue("Henry MARTIN ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Henry MARTIN") == -1);
		assertTrue("Naomie WATT ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Naomie WATT") == -1);
	}

	@Test
	public void laSecondePageDoitAfficherLesProfilsDe16a30() {
		Response response = GET("/page2");
		assertIsOk(response);
		assertContentType("text/html", response);

		// Vis-à-vis du jeu de données de test, nous devons avoir
		// sur la seconde page de Henry MARTIN à Naomie WATT
		// Les profils de Céline Ampère à Carine Lavoisier doivent
		// apparaitre en page 1

		assertContentMatch("Henry MARTIN", response);
		assertContentMatch("Naomie WATT", response);

		String strReponse = getContent(response);
		assertTrue("Céline AMPÈRE ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Céline AMPÈRE") == -1);
		assertTrue("Carine LAVOISIER ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Carine LAVOISIER") == -1);
	}

	@Test
	public void laRechercheNeDoitAfficherQue15Profils() {
		Response response = GET("/page1/a");
		assertIsOk(response);
		assertContentType("text/html", response);

		// Vis-à-vis du jeu de données de test, nous devons avoir
		// sur la première page de Céline Ampère à Henry MARTIN
		// -> Robert DUPOND ne doit pas remonter car il ne répond
		// pas aux critères de recherche
		// Les profils de Anaïs MENDELEÏEV à Naomie WATT doivent
		// apparaitre en page 2

		assertContentMatch("Céline AMPÈRE", response);
		assertContentMatch("Henry MARTIN", response);

		String strReponse = getContent(response);
		assertTrue("Robert DUPOND ne répond pas aux critères de recherche",
				strReponse.indexOf("Robert DUPOND") == -1);
		assertTrue("Anaïs MENDELEÏEV ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Anaïs MENDELEÏEV") == -1);
	}

	@Test
	public void laSecondepageDeRechercheDoitAfficherDesProfilsFiltrés() {
		Response response = GET("/page2/a");
		assertIsOk(response);
		assertContentType("text/html", response);

		// Vis-à-vis du jeu de données de test et du critère recherché,
		// nous devons avoir sur la seconde page de Anaïs MENDELEÏEV à
		// Naomie WATT
		// Les profils de Céline Ampère à Henry MARTIN doivent
		// apparaitre en page 1

		assertContentMatch("Anaïs MENDELEÏEV", response);
		assertContentMatch("Naomie WATT", response);

		String strReponse = getContent(response);
		assertTrue("Céline AMPÈRE ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Céline AMPÈRE") == -1);
		assertTrue("Henry MARTIN ne devrait pas apparaitre sur cette page",
				strReponse.indexOf("Henry MARTIN") == -1);

	}
}


text:
import { Injectable } from '@angular/core'
import { Action } from '@ngrx/store'

import { Effect, Actions } from '@ngrx/effects'
import 'rxjs/add/operator/switchMap'
import 'rxjs/add/operator/map'
import 'rxjs/add/operator/catch'

import { Observable } from 'rxjs/Observable'
import { of } from 'rxjs/observable/of'

import {
  REQUEST_PHONES,
  FETCH_PHONES_SUCCESS,
  FETCH_PHONES_FAILURE,
  FetchPhonesSuccessAction
} from './phonesReducer'
import { PhoneService } from './phoneService'

@Injectable()
export class PhoneEffects {
  constructor(private actions$: Actions, private phoneService: PhoneService) {}

  @Effect()
  loadPhones$ = this.actions$
    .ofType(REQUEST_PHONES)
    .switchMap(() =>
      this.phoneService
        .getPhones()
        .map(phones => new FetchPhonesSuccessAction(phones))
    )
}
//dispatch({type:FETCH_PHONES_SUCCESS,payload:phones})


text:
package com.jfinalshop.controller.admin;

import com.jfinal.kit.StrKit;
import com.jfinalshop.model.Shipping;

/**
 * 后台类 - 发货
 *
 */
public class ShippingController extends BaseAdminController<Shipping>{

	// 列表
	public void list() {
		findByPage();
		render("/admin/shipping_list.html");
	}

	// 查看
	public void view(){
		id = getPara("id","");
		if(StrKit.notBlank(id)){
			setAttr("shipping", Shipping.dao.findById(id));
		}
		render("/admin/shipping_view.html");
	}

	// 删除
	public void delete(){
		ids = getParaValues("ids");
		if(ids != null && ids.length > 0){
			for(String id : ids){
				if(Shipping.dao.deleteById(id)){
					ajaxJsonSuccessMessage("删除成功!");
				}else{
					ajaxJsonErrorMessage("删除失败!");
				}
			}
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <!--Default colors<color name="colorPrimary">#3F51B5</color>
  <color name="colorPrimaryDark">#303F9F</color>
  <color name="colorAccent">#FF4081</color>-->
  <color name="colorPrimary">#444444</color>
  <color name="colorPrimaryDark">#666666</color>
  <color name="colorAccent">#AAAAAA</color>

  <color name="button">#ff1493</color>
  <color name="buttonText">#FFFFFF</color>
</resources>


text:
<?php

namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;

use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Core\Repository\ShipmentRepositoryInterface;

class ShipmentRepository extends EntityRepository implements ShipmentRepositoryInterface
{
    /**
     * {@inheritdoc}
     */
    public function findByOrderIdAndId($orderId, $id)
    {
        $queryBuilder = $this->createQueryBuilder('o');

        return $queryBuilder
            ->where('o.order = :orderId')
            ->andWhere('o.id = :id')
            ->setParameter('orderId', $orderId)
            ->setParameter('id', $id)
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }

    /**
     * {@inheritdoc}
     */
    public function findByName($name, $localeCode)
    {
        return $this->createQueryBuilder('o')
            ->addSelect('translation')
            ->leftJoin('o.translations', 'translation')
            ->where('translation.name = :name')
            ->andWhere('translation.locale = :localeCode')
            ->setParameter('name', $name)
            ->setParameter('localeCode', $localeCode)
            ->getQuery()
            ->getResult()
        ;
    }
}


text:
MAXMIND_LICENSE_KEY="EbYgT3hZ3uxbHj0G"

rm -fR GeoLite2*
rm -fR $VENV/opt/geoip
mkdir -p $VENV/opt/geoip
GEOLITE2_CITY_SHA256SUM=$(curl -s "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz.sha256" | awk '{print $1}')
getpkg "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENSE_KEY&suffix=tar.gz" $GEOLITE2_CITY_SHA256SUM GeoLite2-City.tgz
tar zxf GeoLite2-City.tgz
cp GeoLite2-City_20*/GeoLite2-City.mmdb $VENV/opt/geoip


text:
package im.actor.model.entity.compat.content;

import java.io.IOException;

import im.actor.model.api.DocumentExVideo;
import im.actor.model.api.DocumentMessage;
import im.actor.model.droidkit.bser.BserValues;
import im.actor.model.droidkit.bser.BserWriter;
import im.actor.model.entity.content.internal.AbsContentContainer;
import im.actor.model.entity.content.internal.ContentLocalContainer;
import im.actor.model.entity.content.internal.ContentRemoteContainer;
import im.actor.model.entity.content.internal.LocalVideo;

public class ObsoleteVideo extends ObsoleteDocument {
    private int w;
    private int h;
    private int duration;

    public ObsoleteVideo(BserValues values) throws IOException {
        super(values);
    }

    public int getW() {
        return w;
    }

    public int getH() {
        return h;
    }

    public int getDuration() {
        return duration;
    }

    @Override
    public AbsContentContainer toContainer() {
        if (source instanceof ObsoleteLocalFileSource) {
            ObsoleteLocalFileSource fSource = (ObsoleteLocalFileSource) source;
            return new ContentLocalContainer(new LocalVideo(
                    name,
                    fSource.getFileDescriptor(),
                    fSource.getSize(),
                    mimeType,
                    fastThumb != null ? fastThumb.toFastThumb() : null,
                    w,
                    h,
                    duration));
        } else if (source instanceof ObsoleteRemoteFileSource) {
            ObsoleteRemoteFileSource fSource = (ObsoleteRemoteFileSource) source;
            return new ContentRemoteContainer(new DocumentMessage(
                    fSource.getFileReference().getFileId(),
                    fSource.getFileReference().getAccessHash(),
                    fSource.getFileReference().getFileSize(),
                    name,
                    mimeType,
                    fastThumb != null ? fastThumb.toApiFastThumb() : null,
                    new DocumentExVideo(w, h, duration)));
        } else {
            throw new RuntimeException("Unknwon source type");
        }
    }

    @Override
    public void parse(BserValues values) throws IOException {
        super.parse(values);
        w = values.getInt(10);
        h = values.getInt(11);
        duration = values.getInt(12);
    }

    @Override
    public void serialize(BserWriter writer) throws IOException {
        throw new UnsupportedOperationException();
    }
}


text:
package com.leeo.web.repository;

import java.util.Set;

import org.springframework.data.jpa.repository.Query;

import com.leeo.web.entity.Auth;

// 可以不加@Repository注解
public interface AuthRepository extends BaseRepository<Auth, Long>{

    @Query("select roleIds from Auth where userId=?1")
    Set<Long> findRoleIds(Long userId);

    @Query("select roleIds from Auth where groupId in (?1) ")
    Set<Long> findRoleIds(Set<Long> groupIds);

    //委托给AuthRepositoryImpl实现
    Set<Long> findRoleIds(Long userId, Set<Long> groupIds);
}


text:
View for displaying tag list

![portrait image](https://raw.githubusercontent.com/mokelab/ObjC-TagView/master/portrait.png)

![landscape image](https://raw.githubusercontent.com/mokelab/ObjC-TagView/master/landscape.png)

# How to use this

Copy `MLTagView.h` and `MLTagView.m` to your app project. This class is just a subclass of `UIView`

```
#import "MLTagView.h"

@interface ViewController : UIViewController

@property(weak, nonatomic) IBOutlet MLTagView *tagView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.tagView.margin = 4;
    self.tagView.itemBorderWidth = 2;
    self.tagView.itemCornerRadius = 8;
    self.tagView.itemTitleColor = [UIColor grayColor];
    self.tagView.itemTitlePadding = 16;
    for (int i = 0 ; i < 30 ; ++i) {
        [self.tagView addTag:[NSString stringWithFormat:@"Tag %d", i]];
    }
}

@end
```

# for AutoLayout

Add `height` constraint to this View and connect it to `heightConstraint` property. This view updates `constant` of constraint after `layoutSubviews`


text:
@interface DCMainEvent (DC)

@end


text:
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.RecoveryServicesSiteRecovery.Models;

namespace Azure.ResourceManager.RecoveryServicesSiteRecovery
{
    /// <summary> A class representing the StorageClassificationMapping data model. </summary>
    public partial class StorageClassificationMappingData : ResourceData
    {
        /// <summary> Initializes a new instance of StorageClassificationMappingData. </summary>
        internal StorageClassificationMappingData()
        {
        }

        /// <summary> Initializes a new instance of StorageClassificationMappingData. </summary>
        /// <param name="id"> The id. </param>
        /// <param name="name"> The name. </param>
        /// <param name="resourceType"> The resourceType. </param>
        /// <param name="systemData"> The systemData. </param>
        /// <param name="properties"> Properties of the storage mapping object. </param>
        /// <param name="location"> Resource Location. </param>
        internal StorageClassificationMappingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, StorageClassificationMappingProperties properties, AzureLocation? location) : base(id, name, resourceType, systemData)
        {
            Properties = properties;
            Location = location;
        }

        /// <summary> Properties of the storage mapping object. </summary>
        internal StorageClassificationMappingProperties Properties { get; }
        /// <summary> Target storage object Id. </summary>
        public string TargetStorageClassificationId
        {
            get => Properties?.TargetStorageClassificationId;
        }

        /// <summary> Resource Location. </summary>
        public AzureLocation? Location { get; }
    }
}


text:
#pragma once
#include <aws/awstransfer/Transfer_EXPORTS.h>
#include <aws/awstransfer/TransferRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Transfer
{
namespace Model
{

  /**
   */
  class AWS_TRANSFER_API ListSecurityPoliciesRequest : public TransferRequest
  {
  public:
    ListSecurityPoliciesRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "ListSecurityPolicies"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
Specifies the number of security policies to return as a response to the
     * ListSecurityPolicies query.

     */
    inline int GetMaxResults() const{ return m_maxResults; }

    /**
     *
Specifies the number of security policies to return as a response to the
     * ListSecurityPolicies query.

     */
    inline bool MaxResultsHasBeenSet() const { return m_maxResultsHasBeenSet; }

    /**
     *
Specifies the number of security policies to return as a response to the
     * ListSecurityPolicies query.

     */
    inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; }

    /**
     *
Specifies the number of security policies to return as a response to the
     * ListSecurityPolicies query.

     */
    inline ListSecurityPoliciesRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;}

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline bool NextTokenHasBeenSet() const { return m_nextTokenHasBeenSet; }

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; }

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = std::move(value); }

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); }

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline ListSecurityPoliciesRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline ListSecurityPoliciesRequest& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
When additional results are obtained from the
     * ListSecurityPolicies command, a NextToken parameter is
     * returned in the output. You can then pass the NextToken parameter
     * in a subsequent command to continue listing additional security policies.

     */
    inline ListSecurityPoliciesRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;}

  private:

    int m_maxResults;
    bool m_maxResultsHasBeenSet;

    Aws::String m_nextToken;
    bool m_nextTokenHasBeenSet;
  };

} // namespace Model
} // namespace Transfer
} // namespace Aws


text:
using System;
using System.Collections.Generic;
using System.IO;
using QuantConnect.Configuration;
using QuantConnect.Data.Auxiliary;
using QuantConnect.Interfaces;
using QuantConnect.Logging;
using QuantConnect.Util;

namespace QuantConnect.Lean.Engine.DataFeeds
{
    /// <summary>
    /// An implementation of <see cref="IOptionChainProvider"/> that reads the list of contracts from open interest zip data files
    /// </summary>
    public class BacktestingOptionChainProvider : IOptionChainProvider
    {
        private IDataProvider _dataProvider;
        private IMapFileProvider _mapFileProvider;

        /// <summary>
        /// Creates a new instance
        /// </summary>
        /// <param name="dataProvider">The data provider instance to use</param>
        public BacktestingOptionChainProvider(IDataProvider dataProvider)
        {
            _dataProvider = dataProvider;
            _mapFileProvider =
                Composer.Instance.GetExportedValueByTypeName<IMapFileProvider>(Config.Get("map-file-provider",
                    "LocalDiskMapFileProvider"));
        }

        /// <summary>
        /// Gets the list of option contracts for a given underlying symbol
        /// </summary>
        /// <param name="underlyingSymbol">The underlying symbol</param>
        /// <param name="date">The date for which to request the option chain (only used in backtesting)</param>
        /// <returns>The list of option contracts</returns>
        public IEnumerable<Symbol> GetOptionContractList(Symbol underlyingSymbol, DateTime date)
        {
            if (!underlyingSymbol.SecurityType.HasOptions())
            {
                throw new NotSupportedException($"BacktestingOptionChainProvider.GetOptionContractList(): SecurityType.Equity, SecurityType.Future, or SecurityType.Index is expected but was {underlyingSymbol.SecurityType}");
            }

            // Resolve any mapping before requesting option contract list for equities
            // Needs to be done in order for the data file key to be accurate
            Symbol mappedSymbol;
            if (underlyingSymbol.RequiresMapping())
            {
                var mapFileResolver = _mapFileProvider.Get(AuxiliaryDataKey.Create(underlyingSymbol));
                var mapFile = mapFileResolver.ResolveMapFile(underlyingSymbol);
                var ticker = mapFile.GetMappedSymbol(date, underlyingSymbol.Value);
                mappedSymbol = underlyingSymbol.UpdateMappedSymbol(ticker);
            }
            else
            {
                mappedSymbol = underlyingSymbol;
            }

            // build the option contract list from the open interest zip file entry names

            // create a canonical option symbol for the given underlying
            var canonicalSymbol = Symbol.CreateOption(
                mappedSymbol,
                mappedSymbol.ID.Market,
                mappedSymbol.SecurityType.DefaultOptionStyle(),
                default(OptionRight),
                0,
                SecurityIdentifier.DefaultDate);

            var zipFileName = string.Empty;
            Stream stream = null;

            // In order of trust-worthiness of containing the complete option chain, OpenInterest is guaranteed
            // to have the complete option chain. Quotes come after open-interest
            // because it's also likely to contain the option chain. Trades may be
            // missing portions of the option chain, so we resort to it last.
            foreach (var tickType in new[] { TickType.OpenInterest, TickType.Quote, TickType.Trade })
            {
                // build the zip file name and fetch it with our provider
                zipFileName = LeanData.GenerateZipFilePath(Globals.DataFolder, canonicalSymbol, date, Resolution.Minute, tickType);
                stream = _dataProvider.Fetch(zipFileName);

                if (stream != null)
                {
                    break;
                }
            }

            if (stream == null)
            {
                Log.Trace($"BacktestingOptionChainProvider.GetOptionContractList(): File not found: {zipFileName}");
                yield break;
            }

            // generate and return the contract symbol for each zip entry
            var zipEntryNames = Compression.GetZipEntryFileNames(stream);
            foreach (var zipEntryName in zipEntryNames)
            {
                yield return LeanData.ReadSymbolFromZipEntry(canonicalSymbol, Resolution.Minute, zipEntryName);
            }

            stream.DisposeSafely();
        }
    }
}


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\country\CountrySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Countries';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

        <?= Html::a('Create Country', ['create'], ['class' => 'btn btn-success']) ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            'countryname',
            'acronym',
            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Projeto
{
	public partial class UCLivroDidatico1 : System.Web.UI.UserControl
	{
		protected void Page_Load(object sender, EventArgs e)
		{

		}
	}
}


text:
'use strict';

const test = require('tape');

const moduleName = 'lib/util/map-schema-keys-to-data-keys';
const self = require(`../../../${moduleName}`);

test(`${moduleName} > schema matches data w/o case insensitivity`, t => {
  const dataKeys = ['keyOne', 'keyTwo'];
  const schemaKeys = [...dataKeys];

  const { schemaKeysToDataKeys, restDataKeys } = self({ dataKeys, schemaKeys });

  t.deepEqual(Array.from(schemaKeysToDataKeys.keys()), [...schemaKeys],
    'the keys map should include all schema keys');
  t.deepEqual(Array.from(schemaKeysToDataKeys.values()), [...dataKeys],
    'schema keys should map to factual dataKeys');
  t.equal(restDataKeys.length, 0, 'should return empty collection of rest keys');
  t.end();
});

test(`${moduleName} > schema matches data with case insensitivity`, t => {
  const dataKeys = ['keyOne', 'keyTwo'];
  const schemaKeys = [...dataKeys];

  const { schemaKeysToDataKeys, restDataKeys } =
    self({ dataKeys, schemaKeys, isCaseInsensitive: true });

  t.deepEqual(Array.from(schemaKeysToDataKeys.keys()), [...schemaKeys],
    'the keys map should include all schema keys');
  t.deepEqual(Array.from(schemaKeysToDataKeys.values()), [...dataKeys],
    'schema keys should map to factual dataKeys');
  t.equal(restDataKeys.length, 0, 'should return empty collection of rest keys');
  t.end();
});

test(`${moduleName} > there are data keys not covered by schema`, t => {
  const schemaKeys = ['keyOne', 'keyTwo'];
  const restKeys = ['keyThree', 'keyFour'];
  const dataKeys = [...schemaKeys, ...restKeys];

  const { restDataKeys } = self({ dataKeys, schemaKeys });

  t.deepEqual(restDataKeys, restKeys,
    'should return correct collection of keys not covered by schema');
  t.end();
});

test(`${moduleName} > the target key is only descoverable with case insensitivity`, t => {
  const restKeys = ['keyThree', 'keyFour'];
  const mappableDataKeys = ['keyOne', 'KeyTWO'];
  const dataKeys = [...mappableDataKeys, ...restKeys];
  const schemaKeys = ['keyOne', 'keyTwo'];

  const { schemaKeysToDataKeys, restDataKeys } =
    self({ dataKeys, schemaKeys, isCaseInsensitive: true });

  t.deepEqual(Array.from(schemaKeysToDataKeys.keys()), [...schemaKeys],
    'the keys map should include all schema keys');
  t.deepEqual(Array.from(schemaKeysToDataKeys.values()), [...mappableDataKeys],
    'schema keys should map to factual dataKeys');
  t.deepEqual(restDataKeys, restKeys,
    'should return correct collection of keys not covered by schema');
  t.end();
});

test(`${moduleName} > there are two similar data keys and case insensitivity is applied`, t => {
  const dataKeys = ['KeyOne', 'keyONE'];
  const schemaKeys = ['keyOne'];

  const { schemaKeysToDataKeys, restDataKeys } =
    self({ dataKeys, schemaKeys, isCaseInsensitive: true });

  t.equal(schemaKeysToDataKeys.get('keyOne'), 'keyONE',
    'schema key should reference the last data key entry');
  t.equal(restDataKeys.length, 0,
    'should not include the first entry to the rest data keys collection');
  t.end();
});

test(`${moduleName} > there are two similar data keys and case insensitivity is not applied`, t => {
  const dataKeys = ['KeyOne', 'keyONE'];
  const schemaKeys = ['keyOne'];

  const { schemaKeysToDataKeys, restDataKeys } =
    self({ dataKeys, schemaKeys, isCaseInsensitive: false });

  t.equal(schemaKeysToDataKeys.get('keyOne'), null,
    'schema key should not reference any data key');
  t.deepEqual(restDataKeys, dataKeys,
    'should include all not matched keys to the rest data keys collection');
  t.end();
});

test(`${moduleName} > schema has a key that data does not have`, t => {
  const dataKeys = [];
  const schemaKeys = ['keyOne'];

  const { schemaKeysToDataKeys } =
    self({ dataKeys, schemaKeys, isCaseInsensitive: false });

  t.equal(schemaKeysToDataKeys.get('keyOne'), null,
    'schema key should not reference any data key');
  t.end();
});


text:
"use strict";

var WeakMap = require("../weak-map"),
    Map = require("../_map"),
    ChangeDescriptor = require("./change-descriptor"),
    ObjectChangeDescriptor = ChangeDescriptor.ObjectChangeDescriptor,
    ChangeListenersRecord = ChangeDescriptor.ChangeListenersRecord,
    ListenerGhost = ChangeDescriptor.ListenerGhost;

module.exports = MapChanges;
function MapChanges() {
    throw new Error("Can't construct. MapChanges is a mixin.");
}

var object_owns = Object.prototype.hasOwnProperty;

/*
    Object map change descriptors carry information necessary for adding,
    removing, dispatching, and shorting events to listeners for map changes
    for a particular key on a particular object.  These descriptors are used
    here for shallow map changes.

    {
        willChangeListeners:Array(Fgunction)
        changeListeners:Array(Function)
    }
*/

var mapChangeDescriptors = new WeakMap();

function MapChangeDescriptor(name) {
    this.name = name;
    this.isActive = false;
    this._willChangeListeners = null;
    this._changeListeners = null;
};

MapChangeDescriptor.prototype = new ObjectChangeDescriptor();
MapChangeDescriptor.prototype.constructor = MapChangeDescriptor;

MapChangeDescriptor.prototype.changeListenersRecordConstructor = MapChangeListenersRecord;
MapChangeDescriptor.prototype.willChangeListenersRecordConstructor = MapWillChangeListenersRecord;

var MapChangeListenersSpecificHandlerMethodName = new Map();

function MapChangeListenersRecord(name) {
    var specificHandlerMethodName = MapChangeListenersSpecificHandlerMethodName.get(name);
    if(!specificHandlerMethodName) {
        specificHandlerMethodName = "handle";
        specificHandlerMethodName += name.slice(0, 1).toUpperCase();
        specificHandlerMethodName += name.slice(1);
        specificHandlerMethodName += "MapChange";
        MapChangeListenersSpecificHandlerMethodName.set(name,specificHandlerMethodName);
    }
    this.specificHandlerMethodName = specificHandlerMethodName;
	return this;
}
MapChangeListenersRecord.prototype = new ChangeListenersRecord();
MapChangeListenersRecord.prototype.constructor = MapChangeListenersRecord;
MapChangeListenersRecord.prototype.genericHandlerMethodName = "handleMapChange";

var MapWillChangeListenersSpecificHandlerMethodName = new Map();

function MapWillChangeListenersRecord(name) {
    var specificHandlerMethodName = MapWillChangeListenersSpecificHandlerMethodName.get(name);
    if(!specificHandlerMethodName) {
        specificHandlerMethodName = "handle";
        specificHandlerMethodName += name.slice(0, 1).toUpperCase();
        specificHandlerMethodName += name.slice(1);
        specificHandlerMethodName += "MapWillChange";
        MapWillChangeListenersSpecificHandlerMethodName.set(name,specificHandlerMethodName);
    }
    this.specificHandlerMethodName = specificHandlerMethodName;
    return this;
}
MapWillChangeListenersRecord.prototype = new ChangeListenersRecord();
MapWillChangeListenersRecord.prototype.constructor = MapWillChangeListenersRecord;
MapWillChangeListenersRecord.prototype.genericHandlerMethodName = "handleMapWillChange";

MapChanges.prototype.getAllMapChangeDescriptors = function () {
    if (!mapChangeDescriptors.has(this)) {
        mapChangeDescriptors.set(this, new Map());
    }
    return mapChangeDescriptors.get(this);
};

MapChanges.prototype.getMapChangeDescriptor = function (token) {
    var tokenChangeDescriptors = this.getAllMapChangeDescriptors();
    token = token || "";
    if (!tokenChangeDescriptors.has(token)) {
        tokenChangeDescriptors.set(token, new MapChangeDescriptor(token));
    }
    return tokenChangeDescriptors.get(token);
};

var ObjectsDispatchesMapChanges = new WeakMap(),
    dispatchesMapChangesGetter = function() {
        return ObjectsDispatchesMapChanges.get(this);
    },
    dispatchesMapChangesSetter = function(value) {
        return ObjectsDispatchesMapChanges.set(this,value);
    },
    dispatchesChangesMethodName = "dispatchesMapChanges",
    dispatchesChangesPropertyDescriptor = {
        get: dispatchesMapChangesGetter,
        set: dispatchesMapChangesSetter,
        configurable: true,
        enumerable: false
    };

MapChanges.prototype.addMapChangeListener = function addMapChangeListener(listener, token, beforeChange) {
    //console.log("this:",this," addMapChangeListener(",listener,",",token,",",beforeChange);

    if (!this.isObservable && this.makeObservable) {
        // for Array
        this.makeObservable();
    }
    var descriptor = this.getMapChangeDescriptor(token);
    var listeners;
    if (beforeChange) {
        listeners = descriptor.willChangeListeners;
    } else {
        listeners = descriptor.changeListeners;
    }

    // console.log("addMapChangeListener()",listener, token);
    //console.log("this:",this," addMapChangeListener()  listeners._current is ",listeners._current);

    if(!listeners._current) {
        listeners._current = listener;
    }
    else if(!Array.isArray(listeners._current)) {
        listeners._current = [listeners._current,listener]
    }
    else {
        listeners._current.push(listener);
    }

    if(Object.getOwnPropertyDescriptor((this.__proto__||Object.getPrototypeOf(this)),dispatchesChangesMethodName) === void 0) {
        Object.defineProperty((this.__proto__||Object.getPrototypeOf(this)), dispatchesChangesMethodName, dispatchesChangesPropertyDescriptor);
    }
    this.dispatchesMapChanges = true;

    var self = this;
    return function cancelMapChangeListener() {
        if (!self) {
            // TODO throw new Error("Can't remove map change listener again");
            return;
        }
        self.removeMapChangeListener(listener, token, beforeChange);
        self = null;
    };
};

MapChanges.prototype.removeMapChangeListener = function (listener, token, beforeChange) {
    var descriptor = this.getMapChangeDescriptor(token);

    var listeners;
    if (beforeChange) {
        listeners = descriptor.willChangeListeners;
    } else {
        listeners = descriptor.changeListeners;
    }

    if(listeners._current) {
        if(listeners._current === listener) {
            listeners._current = null;
        }
        else {
            var index = listeners._current.lastIndexOf(listener);
            if (index === -1) {
                throw new Error("Can't remove map change listener: does not exist: token " + JSON.stringify(token));
            }
            else {
                if(descriptor.isActive) {
                    listeners.ghostCount = listeners.ghostCount+1
                    listeners._current[index]=ListenerGhost
                }
                else {
                    listeners._current.spliceOne(index);
                }
            }
        }
    }

};

MapChanges.prototype.dispatchMapChange = function (key, value, beforeChange) {
    var descriptors = this.getAllMapChangeDescriptors(),
        Ghost = ListenerGhost;

    descriptors.forEach(function (descriptor, token) {

        if (descriptor.isActive) {
            return;
        }

        var listeners = beforeChange ? descriptor.willChangeListeners : descriptor.changeListeners;
        if(listeners && listeners._current) {

            var tokenName = listeners.specificHandlerMethodName;
            if(Array.isArray(listeners._current) && listeners._current.length) {

                //removeGostListenersIfNeeded returns listeners.current or a new filtered one when conditions are met
                var currentListeners = listeners.removeCurrentGostListenersIfNeeded(),
                    i, countI, listener;
                descriptor.isActive = true;

                try {
                    for(i=0, countI = currentListeners.length;i<countI;i++) {
                        // dispatch to each listener
                        if ((listener = currentListeners[i]) !== Ghost) {
                            if (listener[tokenName]) {
                                listener[tokenName](value, key, this);
                            } else if (listener.call) {
                                listener.call(listener, value, key, this);
                            } else {
                                throw new Error("Handler " + listener + " has no method " + tokenName + " and is not callable");
                            }
                        }
                    }
                } finally {
                    descriptor.isActive = false;
                }
            }
            else {
                descriptor.isActive = true;
                // dispatch each listener

                try {
                    listener = listeners._current;
                    if (listener[tokenName]) {
                        listener[tokenName](value, key, this);
                    } else if (listener.call) {
                        listener.call(listener, value, key, this);
                    } else {
                        throw new Error("Handler " + listener + " has no method " + tokenName + " and is not callable");
                    }
                } finally {
                    descriptor.isActive = false;
                }

            }
        }

    }, this);
};

MapChanges.prototype.addBeforeMapChangeListener = function (listener, token) {
    return this.addMapChangeListener(listener, token, true);
};

MapChanges.prototype.removeBeforeMapChangeListener = function (listener, token) {
    return this.removeMapChangeListener(listener, token, true);
};

MapChanges.prototype.dispatchBeforeMapChange = function (key, value) {
    return this.dispatchMapChange(key, value, true);
};


text:
package com.jfixby.scarabei.aws.desktop.sns;

import com.amazonaws.services.sns.model.PublishResult;
import com.jfixby.scarabei.aws.api.sns.SNSPublishResult;

public class DesktopSNSPublishResult implements SNSPublishResult {

	private final PublishResult awspublishResponse;

	public DesktopSNSPublishResult (final PublishResult publishResponse) {
		this.awspublishResponse = publishResponse;
	}

	@Override
	public String toString () {
		return "RedSNSPublishResult [awspublishResponse=" + this.awspublishResponse + "]";
	}

}


text:
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Threading;
using System.Web.Mvc;
using WebMatrix.WebData;
using Ramesoft.Cms.Models;
using Ramesoft.Cms.Common.Logging;
using Ramesoft.Cms.Common.Entity;
using System.Text;
using System.Web.Security;
using Ramesoft.Cms.Common.DAL.Enums;
using Ramesoft.Cms.Common.Config;

namespace Ramesoft.Cms.Filters
{
    using System.Data.Entity.Core.EntityClient;

    using UserProfile = Ramesoft.Cms.Models.UserProfile;

    /// <summary>
    /// The initialize simple membership attribute.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public sealed class InitializeSimpleMembershipAttribute : ActionFilterAttribute
    {
        /// <summary>
        /// The _initializer.
        /// </summary>
        private static SimpleMembershipInitializer initializer;

        /// <summary>
        /// The initializer lock.
        /// </summary>
        private static object initializerLock = new object();

        /// <summary>
        /// The _is initialized.
        /// </summary>
        private static bool isInitialized;

        /// <summary>
        /// The on action executing.
        /// </summary>
        /// <param name="filterContext">
        /// The filter context.
        /// </param>
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext.ActionDescriptor.ControllerDescriptor.ControllerName == "Error")
            {
                return;
            }

            LazyInitializer.EnsureInitialized(ref initializer, ref isInitialized, ref initializerLock);
            Logger.LogInfo("Action:" + filterContext.ActionDescriptor.ActionName + " of Controller:" + filterContext.ActionDescriptor.ControllerDescriptor.ControllerName + " is called.");
        }

        /// <summary>
        /// The simple membership initializer.
        /// </summary>
        private class SimpleMembershipInitializer
        {
            /// <summary>
            /// Initializes a new instance of the <see cref="SimpleMembershipInitializer"/> class.
            /// </summary>
            /// <exception cref="InvalidOperationException">
            /// Throws Exception
            /// </exception>
            public SimpleMembershipInitializer()
            {
                try
                {
                    if (!Database.Exists("DefaultConnection"))
                    {
                        Database.SetInitializer(new CreateDatabaseIfNotExists<EntityContext>());
                    }

                    WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", true);

                    if (!WebSecurity.UserExists("razinmemon"))
                    {
                        WebSecurity.CreateUserAndAccount("razinmemon", "ABab@123");

                        if (!Roles.RoleExists(UserTypes.SuperAdmin.ToString()))
                        {
                            Roles.CreateRole(UserTypes.SuperAdmin.ToString());
                        }

                        Roles.AddUserToRole("razinmemon", UserTypes.SuperAdmin.ToString());
                    }
                    else if (!Roles.IsUserInRole("razinmemon", UserTypes.SuperAdmin.ToString()))
                    {
                        if (!Roles.RoleExists(UserTypes.SuperAdmin.ToString()))
                        {
                            Roles.CreateRole(UserTypes.SuperAdmin.ToString());
                        }

                        Roles.AddUserToRole("razinmemon", UserTypes.SuperAdmin.ToString());
                    }
                }
                catch (Exception ex)
                {
                    throw new InvalidOperationException("The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588", ex);
                }
            }
        }
    }
}