text:
package com.appdynamics.monitors.VMWare;

import com.appdynamics.extensions.ABaseMonitor;
import com.appdynamics.extensions.TasksExecutionServiceProvider;
import com.appdynamics.extensions.logging.ExtensionsLoggerFactory;
import com.appdynamics.extensions.util.AssertUtils;
import com.appdynamics.monitors.VMWare.metrics.VMWareMetrics;
import com.appdynamics.monitors.VMWare.util.Constants;
import org.slf4j.Logger;

import java.util.List;
import java.util.Map;

public class VMWareMonitor extends ABaseMonitor {

    private static final String DEFAULT_METRIC_PREFIX = Constants.DEFAULT_METRIC_PREFIX;

    private static final Logger logger = ExtensionsLoggerFactory.getLogger(VMWareMonitor.class);

    public VMWareMonitor() {
        String msg = "Using Monitor Version [" + getImplementationVersion() + "]";
        logger.info(msg);
    }

    protected String getDefaultMetricPrefix() {
        return DEFAULT_METRIC_PREFIX;
    }

    public String getMonitorName() {
        return Constants.MONITOR_NAME;
    }

    protected void doRun(TasksExecutionServiceProvider tasksExecutionServiceProvider) {

        List<Map<String, ?>> vmWareServers = (List<Map<String, ?>>)
                this.getContextConfiguration().getConfigYml().get(Constants.SERVERS);

        for (Map<String, ?> vmWareServer : vmWareServers) {

            VMWareMonitorTask task = new VMWareMonitorTask(tasksExecutionServiceProvider, this.getContextConfiguration(), vmWareServer);

            String displayName = (String) vmWareServer.get(Constants.DISPLAY_NAME);

            if (vmWareServers.size() > 1) {
                AssertUtils.assertNotNull(displayName,
                        "The displayName can not be null when multiple servers are configured");
            }

            String taskName = displayName == null ? "DEFAULT" : displayName;
            tasksExecutionServiceProvider.submit(taskName, task);
        }
    }

    @Override
    protected List<Map<String, ?>> getServers() {
        List<Map<String, ?>> servers = (List<Map<String, ?>>) this.getContextConfiguration().getConfigYml().get(Constants.SERVERS);
        AssertUtils.assertNotNull(servers, "The 'servers' section in config.yml is not initialised");
        return servers;
    }

    @Override
    protected void initializeMoreStuff(Map<String, String> args) {
        getContextConfiguration().setMetricXml(args.get(Constants.METRIC_FILE), VMWareMetrics.class);
    }
}


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

<assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

    <id>distribution</id>

    <formats>
        <!-- enable for debugging -->
        <!-- <format>dir</format> -->
        <format>zip</format>
        <format>tar.gz</format>
    </formats>

    <files>
        <file>
            <source>README.md</source>
        </file>

        <file>
            <source>CHANGELOG.md</source>
        </file>

        <file>
            <source>target/osiam-resource-server.war</source>
        </file>
    </files>

    <fileSets>
        <fileSet>
            <directory>src/main/deploy</directory>
            <outputDirectory>/configuration</outputDirectory>
        </fileSet>
    </fileSets>

</assembly>

redpajama_set_name: RedPajamaGithub


text:
class ApplicationController < ActionController::Base
  # Adds a few additional behaviors into the application controller
  include Blacklight::Controller

  # Please be sure to impelement current_user and user_session. Blacklight depends on
  # these methods in order to perform user specific actions.

  protect_from_forgery
  layout Proc.new{ |controller| (controller.request.xhr? || controller.request.format.json?) ? false : "findingaids" }

  # Alias new_session_path as login_path for default devise config
  def new_session_path(scope)
    login_path
  end

  # This makes sure you redirect to the correct location after passively
  # logging in or after getting sent back not logged in
  def after_sign_in_path_for(resource)
    request.env['omniauth.origin'] || stored_location_for(resource) || root_path
  end

  # After signing out from the local application,
  # redirect to the logout path for the Login app
  def after_sign_out_path_for(resource_or_scope)
    if logout_path.present?
      logout_path
    else
      super(resource_or_scope)
    end
  end

  # Imitate logged in user
  def current_user_dev
    @current_user ||= User.find_or_create_by(email: 'Methuselah969@library.edu', username: "Methuselah969", firstname: "Methuselah")
  end
  alias_method :current_user, :current_user_dev if Rails.env.development?

  private

  def logout_path
    if ENV['LOGIN_URL'].present? && ENV['SSO_LOGOUT_PATH'].present?
      "#{ENV['LOGIN_URL']}#{ENV['SSO_LOGOUT_PATH']}"
    end
  end

end


text:
/* Effective stylesheet produced by snapshot save */
A { text-decoration: none; color: rgb(0, 0, 0); }
A:active { text-decoration: none; color: rgb(0, 0, 0); }
A:hover { text-decoration: none; color: rgb(82, 102, 124); }
A.hlmenu { text-decoration: none; color: rgb(255, 255, 255); }
A.hlmenu:active { text-decoration: none; color: rgb(255, 255, 255); }
A.hlmenu:hover { text-decoration: none; color: rgb(245, 245, 245); }
a.whitee { text-decoration: none; color: rgb(255, 255, 255); }
A.whitee:active { text-decoration: none; color: rgb(255, 255, 255); }
A.whitee:hover { text-decoration: none; color: Silver; }
body { background-color: rgb(99, 99, 99); text-align: center; margin: 0px auto; background-image: url("ocbg.jpg"); background-repeat: repeat-y; background-position: center center; font-size: 12px; font-family: verdana; }
form { margin: 0px; }
#ocbg { width: 100%; background-image: url("pruhbg.jpg"); background-repeat: no-repeat; background-position: center top; }
#oc { width: 855px; text-align: center; margin: 0px auto; border-left: 1px solid rgb(153, 168, 173); border-right: 1px solid rgb(153, 168, 173); height: 100%; }
.okraj { margin: 0px auto; width: 853px; border-left: 1px solid rgb(72, 85, 91); border-right: 1px solid rgb(72, 85, 91); }
#menu { border-left: 1px solid rgb(241, 243, 242); border-right: 1px solid rgb(241, 243, 242); height: 24px; width: 851px; background-image: url("menubg.jpg"); }
#logo { background-color: rgb(241, 243, 242); height: 78px; border-left: 1px solid rgb(241, 243, 242); border-right: 1px solid rgb(241, 243, 242); width: 851px; background-image: url("lbg.jpg"); text-align: center; }
#menu2 { height: 30px; width: 853px; background-image: url("pbg.jpg"); }
.ok1 { float: left; }
.ok2 { float: right; }
.menu_text { float: left; margin-left: 1mm; }
#mainmenu { float: left; margin-left: 5mm; margin-top: 12.6mm; height: 30px; }
.mainmenu_text { float: left; background: url("mmbg.jpg") repeat scroll 0% 0% transparent; height: 30px; font-size: 12px; font-family: verdana; font-weight: bold; vertical-align: bottom; }
.logo_text { float: left; }
.vsk { margin-top: 3mm; }
#search { margin-top: 6mm; float: right; }
.hledejfont { font-size: 24px; font-family: verdana; background-image: url("hledejbg.jpg"); height: 36px; float: left; width: 280px; border: 0px none; }
.hledej1 { float: left; }
.hlsubmit { float: left; }
.menu2_text { width: 820px; text-align: center; color: rgb(255, 255, 255); font-size: 13px; font-family: verdana; font-weight: bold; float: left; padding: 1mm; }
#main { float: left; width: 505px; text-align: left; }
#jine { float: left; width: 345px; }
.jinepulka { float: left; width: 171px; height: 900px; }
#spodek { float: left; width: 853px; background-image: url("spodekbg.jpg"); background-repeat: repeat-x; height: 78px; }
.spodekl { float: left; }
.spodek_text { float: left; width: 99%; }
.spodekr { float: right; }
.odd { float: left; width: 100%; background-image: url("odd.jpg"); background-repeat: repeat-x; }
.modra { float: right; width: 171px; font-size: 12px; font-family: verdana; font-weight: bold; text-align: center; color: rgb(255, 255, 255); margin-top: 1mm; }
.oranzova { float: left; width: 246px; font-size: 12px; font-family: verdana; text-align: center; color: rgb(255, 255, 255); margin-top: 1mm; margin-bottom: 1mm; padding-left: 1mm; }
.cerna { float: left; width: 492px; font-size: 12px; font-family: verdana; text-align: center; color: rgb(255, 255, 255); margin-top: 1mm; padding-left: 1.5mm; }
.jine_oranzovaforum { float: left; background-image: url("oranzovaforum.jpg"); width: 246px; height: 22px; font-weight: bold; }
.jine_textforum { float: left; background-image: url("bgforum.jpg"); width: 246px; font-size: 11px; font-family: verdana; text-align: left; color: rgb(0, 0, 0); }
.jine_modra { float: left; background-image: url("modra.jpg"); width: 171px; height: 22px; }
.jine_cervena { float: left; background-image: url("cervena.jpg"); width: 171px; height: 22px; }
.jine_zelena { float: left; background-image: url("zelena.jpg"); width: 171px; height: 22px; }
.jine_cerna { float: left; background-image: url("cerna.jpg"); width: 492px; height: 26px; font-weight: bold; }
.jine_oranzova { float: left; background-image: url("oranzova.jpg"); width: 171px; height: 22px; font-weight: bold; }
.jine_text { float: left; background-image: url("jinebg.jpg"); width: 171px; font-size: 11px; font-family: verdana; text-align: left; color: rgb(0, 0, 0); }
.jine_textcerna { float: left; background-image: url("bgcerna.jpg"); width: 492px; font-size: 11px; font-family: verdana; text-align: left; color: rgb(0, 0, 0); background-repeat: repeat-y; }
.jinekonec { float: left; }
.zar { float: left; height: 10px; margin-left: 3.5mm; margin-top: 1mm; }
.zarcerna { float: left; margin-left: 5.5mm; margin-top: 1.5mm; }
.zar2 { text-align: center; float: left; margin-left: 1.5mm; margin-right: 1.5mm; width: 160px; }
.zar3 { text-align: center; float: left; margin-left: 1.5mm; margin-right: 1.5mm; width: 160px; }
.zar7 { text-align: left; float: left; margin-left: 1.5mm; margin-right: 1.5mm; width: 235px; }
.zar8 { text-align: left; float: left; margin-left: 1.5mm; margin-right: 1.5mm; width: 483px; }
.menu_v { float: left; margin-top: 1mm; }
#anketa { float: left; width: 160px; text-align: center; margin: 0px auto; }
.anotazka { font-size: 11px; font-family: verdana; font-weight: bold; }
.anodpoved { font-size: 11px; font-family: verdana; text-align: left; }
.angraf { font-size: 11px; font-family: verdana; text-align: left; float: left; }
.animggraf { float: left; width: 80px; }
.anproc { float: right; width: 80px; }
.anhlaska { font-size: 11px; font-family: verdana; font-weight: bold; width: 160px; text-align: left; }
.bliktop { margin-left: -0.5mm; display: block; float: left; width: 163px; cursor: pointer; border-top: 1px solid rgb(170, 170, 170); }
a.bliktop:hover { display: block; background-color: rgb(215, 215, 215); }
.blikforum { margin-left: -0.5mm; display: block; float: left; width: 238px; cursor: pointer; border-top: 1px solid rgb(170, 170, 170); }
a.blikforum:hover { display: block; background-color: rgb(215, 215, 215); }
.menuhl ul { padding: 0px; margin: 0px; list-style-type: none; }
.menuhl li { float: left; position: relative; font-size: 14px; font-family: verdana; padding-left: 4mm; cursor: default; }
.menuhl ul ul { visibility: hidden; position: absolute; height: 0px; top: 31px; left: 0px; }
.menuhl ul li:hover ul, .menuhl ul a:hover ul { visibility: visible; }
a.amenu { color: rgb(255, 255, 255); text-decoration: none; display: block; width: 100px; }
a.amenu:hover { color: rgb(255, 255, 255); text-decoration: none; display: block; width: 100px; }
a.amenu:active { color: rgb(255, 255, 255); text-decoration: none; display: block; width: 100px; }
.zar4 { padding-top: 1mm; float: left; width: 318px; height: 232px; background-repeat: no-repeat; background-position: center top; background-image: url("pacmenu.jpg"); margin-top: -4mm; position: relative; }
.zar6 { padding-top: 1mm; float: left; width: 318px; height: 232px; background-repeat: no-repeat; background-position: center top; background-image: url("mariomenu.jpg"); margin-top: -4mm; position: relative; }
.zar5 { float: right; padding-right: 9mm; padding-top: 7mm; text-align: left; }
.fontmenu { font-size: 13px; font-family: verdana; font-weight: bold; }
.menuhl :hover { display: block; }
.obrnov { float: left; }
.strankovani { padding-top: 2mm; padding-bottom: 2mm; width: 500px; margin: 0px auto; text-align: center; clear: both; font-size: 12px; font-family: verdana; }
.bold { font-weight: bold; }
.obrnov { float: left; }
.vice { font-weight: bold; font-style: italic; }
.leftspodek { float: left; text-align: left; margin-top: 1mm; margin-left: 0.5mm; }
.centerspodek { float: left; margin-top: 2.5mm; margin-left: 20mm; }
.snek { margin: 5px 0px 0px 7px; float: left; width: 152px; height: 60px; background: url("snek-banner.png") no-repeat scroll 0% 0% transparent; }
a.snek:hover { background: url("snek-banner.png") no-repeat scroll 0px -60px transparent; }


text:
package com.jetbrains.python.inspections;

import com.google.common.collect.ImmutableList;
import com.intellij.codeInspection.LocalInspectionToolSession;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel;
import com.intellij.psi.PsiElementVisitor;
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.PyTokenTypes;
import com.jetbrains.python.inspections.quickfix.SimplifyBooleanCheckQuickFix;
import com.jetbrains.python.psi.PyBinaryExpression;
import com.jetbrains.python.psi.PyConditionalStatementPart;
import com.jetbrains.python.psi.PyElementType;
import com.jetbrains.python.psi.PyExpression;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * @author Alexey.Ivanov
 */
public class PySimplifyBooleanCheckInspection extends PyInspection {
  private static final List<String> COMPARISON_LITERALS = ImmutableList.of("True", "False", "[]");

  public boolean ignoreComparisonToZero = true;

  @Nls
  @NotNull
  @Override
  public String getDisplayName() {
    return PyBundle.message("INSP.NAME.check.can.be.simplified");
  }

  @NotNull
  @Override
  public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder,
                                        boolean isOnTheFly,
                                        @NotNull LocalInspectionToolSession session) {
    return new Visitor(holder, session, ignoreComparisonToZero);
  }

  @Override
  public JComponent createOptionsPanel() {
    MultipleCheckboxOptionsPanel panel = new MultipleCheckboxOptionsPanel(this);
    panel.addCheckbox("Ignore comparison to zero", "ignoreComparisonToZero");
    return panel;
  }

  private static class Visitor extends PyInspectionVisitor {
    private final boolean myIgnoreComparisonToZero;

    Visitor(@Nullable ProblemsHolder holder, @NotNull LocalInspectionToolSession session, boolean ignoreComparisonToZero) {
      super(holder, session);
      myIgnoreComparisonToZero = ignoreComparisonToZero;
    }

    @Override
    public void visitPyConditionalStatementPart(PyConditionalStatementPart node) {
      super.visitPyConditionalStatementPart(node);
      final PyExpression condition = node.getCondition();
      if (condition != null) {
        condition.accept(new PyBinaryExpressionVisitor(getHolder(), getSession(), myIgnoreComparisonToZero));
      }
    }
  }

  private static class PyBinaryExpressionVisitor extends PyInspectionVisitor {
    private final boolean myIgnoreComparisonToZero;

    PyBinaryExpressionVisitor(@Nullable ProblemsHolder holder,
                                     @NotNull LocalInspectionToolSession session,
                                     boolean ignoreComparisonToZero) {
      super(holder, session);
      myIgnoreComparisonToZero = ignoreComparisonToZero;
    }

    @Override
    public void visitPyBinaryExpression(PyBinaryExpression node) {
      super.visitPyBinaryExpression(node);
      final PyElementType operator = node.getOperator();
      final PyExpression rightExpression = node.getRightExpression();
      if (rightExpression == null || rightExpression instanceof PyBinaryExpression ||
          node.getLeftExpression() instanceof PyBinaryExpression) {
        return;
      }
      if (PyTokenTypes.EQUALITY_OPERATIONS.contains(operator)) {
        if (operandsEqualTo(node, COMPARISON_LITERALS) ||
            (!myIgnoreComparisonToZero && operandsEqualTo(node, Collections.singleton("0")))) {
          registerProblem(node);
        }
      }
    }

    private static boolean operandsEqualTo(@NotNull PyBinaryExpression expr, @NotNull Collection<String> literals) {
      final String leftExpressionText = expr.getLeftExpression().getText();
      final PyExpression rightExpression = expr.getRightExpression();
      final String rightExpressionText = rightExpression != null ? rightExpression.getText() : null;
      for (String literal : literals) {
        if (literal.equals(leftExpressionText) || literal.equals(rightExpressionText)) {
          return true;
        }
      }
      return false;
    }

    private void registerProblem(PyBinaryExpression binaryExpression) {
      registerProblem(binaryExpression, PyBundle.message("INSP.expression.can.be.simplified"), new SimplifyBooleanCheckQuickFix(binaryExpression));
    }
  }
}


text:
package weixin.popular.bean.message.massmessage;

public class Filter {

    private boolean is_to_all;

    private String group_id;

    public Filter(boolean is_to_all, String group_id) {
        super();
        this.is_to_all = is_to_all;
        this.group_id = group_id;
    }

    public Filter(String group_id) {
        super();
        this.group_id = group_id;
    }

    public boolean isIs_to_all() {
        return is_to_all;
    }

    public void setIs_to_all(boolean is_to_all) {
        this.is_to_all = is_to_all;
    }

    public String getGroup_id() {
        return group_id;
    }

    public void setGroup_id(String group_id) {
        this.group_id = group_id;
    }

}


text:
using System;

using SineSignal.Ottoman.Commands;

namespace SineSignal.Ottoman
{
	public class CouchClient : ICouchClient
	{
		public string ServerVersion { get; private set; }

		public ICouchProxy CouchProxy { get; private set; }

		private CouchClient(ICouchProxy couchProxy, string serverVersion)
		{
			CouchProxy = couchProxy;
			ServerVersion = serverVersion;
		}

		public void CreateDatabase(string name)
		{
			var createDatabaseCommand = new CreateDatabaseCommand(name);
			CouchProxy.Execute<CommandDefaultResult>(createDatabaseCommand);
		}

		public ICouchDatabase GetDatabase(string name)
		{
			var getDatabaseCommand = new GetDatabaseCommand(name);
			GetDatabaseResult result = CouchProxy.Execute<GetDatabaseResult>(getDatabaseCommand);

			return new CouchDatabase(this, result.DatabaseName);
		}

		public void DeleteDatabase(string name)
		{
			var deleteDatabaseCommand = new DeleteDatabaseCommand(name);
			CouchProxy.Execute<CommandDefaultResult>(deleteDatabaseCommand);
		}

		public static ICouchClient ConnectTo(string address)
		{
			ICouchProxy couchProxy = new CouchProxy(new Uri(address));
			ICouchCommand couchCommand = new ConnectToServerCommand();
			ConnectToServerResult couchResult = couchProxy.Execute<ConnectToServerResult>(couchCommand);

			return new CouchClient(couchProxy, couchResult.Version);
		}
	}
}


text:
@interface PIDColor : NSObject {
  float red_;
  float green_;
  float blue_;
  float alpha_;
}

- initWithRed:(float)red green:(float)green blue:(float)blue;
- initWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha;

- (void)apply;
- (GLfloat *)asGlFloats;

- (void)setAlpha:(float)alpha;

@end


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _terser = require("terser");

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

const buildTerserOptions = ({
  ecma,
  warnings,
  parse = {},
  compress = {},
  mangle,
  module,
  output,
  toplevel,
  nameCache,
  ie8,

  /* eslint-disable camelcase */
  keep_classnames,
  keep_fnames,

  /* eslint-enable camelcase */
  safari10
} = {}) => ({
  ecma,
  warnings,
  parse: _objectSpread({}, parse),
  compress: typeof compress === 'boolean' ? compress : _objectSpread({}, compress),
  // eslint-disable-next-line no-nested-ternary
  mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : _objectSpread({}, mangle),
  output: _objectSpread({
    shebang: true,
    comments: false,
    beautify: false,
    semicolons: true
  }, output),
  module,
  // Ignoring sourceMap from options
  sourceMap: null,
  toplevel,
  nameCache,
  ie8,
  keep_classnames,
  keep_fnames,
  safari10
});

const buildComments = (options, terserOptions, extractedComments) => {
  const condition = {};
  const commentsOpts = terserOptions.output.comments; // Use /^\**!|@preserve|@license|@cc_on/i RegExp

  if (typeof options.extractComments === 'boolean') {
    condition.preserve = commentsOpts;
    condition.extract = /^\**!|@preserve|@license|@cc_on/i;
  } else if (typeof options.extractComments === 'string' || options.extractComments instanceof RegExp) {
    // extractComments specifies the extract condition and commentsOpts specifies the preserve condition
    condition.preserve = commentsOpts;
    condition.extract = options.extractComments;
  } else if (typeof options.extractComments === 'function') {
    condition.preserve = commentsOpts;
    condition.extract = options.extractComments;
  } else if (Object.prototype.hasOwnProperty.call(options.extractComments, 'condition')) {
    // Extract condition is given in extractComments.condition
    condition.preserve = commentsOpts;
    condition.extract = options.extractComments.condition;
  } else {
    // No extract condition is given. Extract comments that match commentsOpts instead of preserving them
    condition.preserve = false;
    condition.extract = commentsOpts;
  } // Ensure that both conditions are functions

  ['preserve', 'extract'].forEach(key => {
    let regexStr;
    let regex;

    switch (typeof condition[key]) {
      case 'boolean':
        condition[key] = condition[key] ? () => true : () => false;
        break;

      case 'function':
        break;

      case 'string':
        if (condition[key] === 'all') {
          condition[key] = () => true;

          break;
        }

        if (condition[key] === 'some') {
          condition[key] = (astNode, comment) => {
            return comment.type === 'comment2' && /^\**!|@preserve|@license|@cc_on/i.test(comment.value);
          };

          break;
        }

        regexStr = condition[key];

        condition[key] = (astNode, comment) => {
          return new RegExp(regexStr).test(comment.value);
        };

        break;

      default:
        regex = condition[key];

        condition[key] = (astNode, comment) => regex.test(comment.value);

    }
  }); // Redefine the comments function to extract and preserve
  // comments according to the two conditions

  return (astNode, comment) => {
    if (condition.extract(astNode, comment)) {
      const commentText = comment.type === 'comment2' ? `/*${comment.value}*/` : `//${comment.value}`; // Don't include duplicate comments

      if (!extractedComments.includes(commentText)) {
        extractedComments.push(commentText);
      }
    }

    return condition.preserve(astNode, comment);
  };
};

const minify = options => {
  const {
    file,
    input,
    inputSourceMap,
    extractComments,
    minify: minifyFn
  } = options;

  if (minifyFn) {
    return minifyFn({
      [file]: input
    }, inputSourceMap);
  } // Copy terser options

  const terserOptions = buildTerserOptions(options.terserOptions); // Add source map data

  if (inputSourceMap) {
    terserOptions.sourceMap = {
      content: inputSourceMap
    };
  }

  const extractedComments = [];

  if (extractComments) {
    terserOptions.output.comments = buildComments(options, terserOptions, extractedComments);
  }

  const {
    error,
    map,
    code,
    warnings
  } = (0, _terser.minify)({
    [file]: input
  }, terserOptions);
  return {
    error,
    map,
    code,
    warnings,
    extractedComments
  };
};

var _default = minify;
exports.default = _default;


text:
package info.meoblast001.seallyracing;

import com.jme3.app.SimpleApplication;
import com.jme3.network.Network;
import com.jme3.network.Server;
import info.meoblast001.seallyracing.network.MessageRegistry;
import info.meoblast001.seallyracing.network.ServerNetListener;
import info.meoblast001.seallyracing.states.PlayState;

import java.io.IOException;

/**
 * Game application for server.
 */
public class ServerApplication extends SimpleApplication {
  private int port;
  private int expectedClients;
  Server server;

  /**
   * Constructor.
   * @param port Port on which to run the server.
   */
  public ServerApplication(int port, int expectedClients) {
    this.port = port;
    this.expectedClients = expectedClients;
    MessageRegistry.registerMessages();
  }

  /**
   * Initialise the game.
   * @see SimpleApplication#simpleInitApp()
   */
  @Override
  public void simpleInitApp() {
    try {
      server = Network.createServer(port);
      server.start();
      new ServerNetListener(this, server, expectedClients);
    } catch (IOException e) {
      // TODO: Handle exception.
      System.err.println("Error creating server.");
    }

    this.flyCam.setEnabled(false);
    stateManager.attach(new PlayState(expectedClients));
  }

  /**
   * @see SimpleApplication#destroy()
   */
  @Override
  public void destroy() {
    server.close();
    super.destroy();
  }
}


text:
<?php

  /* ***** ----------------------------------------------- ***** **
  ** ***** Admin Display
  ** ***** ----------------------------------------------- ***** */

  // Add thumbnails column to admin post view
  function bml_posts_columns( $columns ){
    $columns[ 'my_post_thumbs' ] = __( 'Image', 'bymattlee' );
    return $columns;
  }
  add_filter( 'manage_posts_columns', 'bml_posts_columns', 5 );

  // Add thumbnails for each post to admin post view
  function bml_posts_custom_columns( $column_name, $id ){
    if ( $column_name === 'my_post_thumbs' ){
      echo the_post_thumbnail( 'admin_thumb' );
    }
  }
  add_action( 'manage_posts_custom_column', 'bml_posts_custom_columns', 5, 2 );

  // Remove widgets from dashboard
  function bml_remove_dashboard_widgets() {
    remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
    remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
  }
  add_action( 'wp_dashboard_setup', 'bml_remove_dashboard_widgets' );

  // Remove comment support from posts and pages
  function bml_remove_comments_support() {
    remove_post_type_support('post', 'comments');
    remove_post_type_support('page', 'comments');
  }
  add_action( 'init', 'bml_remove_comments_support' );

  // Remove comments tab from the admin
  function bml_remove_comments_menu_page() {
    remove_menu_page( 'edit-comments.php' );
  }
  add_action( 'admin_menu', 'bml_remove_comments_menu_page' );

  // Remove comments meta boxes on post and page edit screens
  function bml_remove_comment_meta_boxes() {
    remove_meta_box( 'commentsdiv', 'page', 'normal' );
    remove_meta_box( 'commentsdiv', 'post', 'normal' );
    remove_meta_box( 'commentstatusdiv', 'post', 'normal' );
  }
  add_action( 'do_meta_boxes', 'bml_remove_comment_meta_boxes' );

  // Remove comments activity on dashboard
  function bml_remove_dashboard_comment_activity() {
    echo '<style type="text/css">li.comment-count, li.comment-mod-count, #latest-comments, #wp-admin-bar-comments { display:none; }</style>';
  }
  add_action( 'admin_head', 'bml_remove_dashboard_comment_activity' );

  // Remove comments from admin bar
  function bml_remove_comments_from_admin_bar() {
    global $wp_admin_bar;
    $wp_admin_bar->remove_menu('comments');
  }
  add_action( 'wp_before_admin_bar_render', 'bml_remove_comments_from_admin_bar' );

  // Rename Posts label to News
  function bml_change_post_object() {
    global $wp_post_types;
    $labels = &$wp_post_types[ 'post' ]->labels;
    $labels->name = 'News';
    $labels->singular_name = 'News';
    $labels->add_new = 'Add New';
    $labels->add_new_item = 'Add New News';
    $labels->edit_item = 'Edit News';
    $labels->new_item = 'News';
    $labels->view_item = 'View News';
    $labels->search_items = 'Search News';
    $labels->not_found = 'No News found';
    $labels->not_found_in_trash = 'No News found in Trash';
    $labels->all_items = 'All News';
    $labels->menu_name = 'News';
    $labels->name_admin_bar = 'News';
  }
  add_action( 'init', 'bml_change_post_object' );

?>


text:
void AliTRDanadigits()
{
  gStyle->SetNdivisions(005,"X");

  Int_t iev1 = 1;
  Int_t iev2 = 20;
  //
  // Analyzes the digits
  //
  const Int_t kNdet = AliTRDgeometry::Ndet();

  //open run loader and load gAlice, kinematics and header
  AliRunLoader* rl = AliRunLoader::Open("galice.root");
  if (!rl)   return;
  rl->LoadgAlice();
  gAlice = rl->GetAliRun();
  if (!gAlice) return;

  // Import the Trees for the event nEvent in the file
  rl->LoadKinematics();
  rl->GetEvent(0);
  rl->GetHeader();

  AliLoader* loader = rl->GetLoader("TRDLoader");
  if (!loader) {
    cout << "<AliTRDanalyzeHits> No TRDLoader found" << endl;
    return;
  }

  //TH2D
  Int_t detA = 240;//AliTRDgeometry::GetDetector(0,4,1); //layer,stac,sm
  Int_t detB = 250;//AliTRDgeometry::GetDetector(5,4,1);
  printf("detA %d \t detB %d \n",detA,detB);
  TH2D *chA = new TH2D("chA", "chA", kNdet, 0, kNdet, 200, -50, 50);
  TH2D *chB = new TH2D("chB", "chB", kNdet, 0, kNdet, 200, -50, 50);

  AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();

  for (Int_t ievent = iev1; ievent < iev2; ievent++) {
    printf("Process event %d\n",ievent);
    rl->GetEvent(ievent);
    if (!loader->TreeD()){
      printf("loader Loading Digits ... \n");
      loader->LoadDigits();
    }

    // Read the digits from the file
    if (!(digitsManager->ReadDigits(loader->TreeD()))) {
      cout << "<AliTRDanalyzeDigits> Cannot read the digits" << endl;
      return;
    }
    else {
      printf("digitsManager Read Digits Done\n");
    }

    // loop over selected chambers
    for(Int_t det = detA; det < detB; det++) {

      printf("try in %d :\t",det);
      Int_t        plan = AliTRDgeometry::GetLayer( det );   // Plane
      Int_t        cham = AliTRDgeometry::GetStack( det ); // Chamber
      Int_t        sect = AliTRDgeometry::GetSector( det );  // Sector (=iDDL)
      Int_t        nRow = AliTRDgeometry::GetRowMax( plan, cham, sect );
      Int_t        nCol = AliTRDgeometry::GetColMax( plan );
      printf(" sm %d \t lay %d \t stac %d \n",sect,plan,cham);

      AliTRDarrayADC *digits = (AliTRDarrayADC *) digitsManager->GetDigits(det); //mod
      digits->Expand();
      if (digits->HasData()) { //array

	printf("data\n");

	Int_t nbtimebin  = digitsManager->GetDigitsParam()->GetNTimeBins(det);

	AliTRDfeeParam *feeParam = AliTRDfeeParam::Instance();
	// Signal for regular pads
	for (Int_t irow = 0; irow < nRow; irow++ ) {
	  for (Int_t icol = 0; icol < nCol; icol++ ) {

	    Int_t rob = feeParam->GetROBfromPad(irow,icol);

	    for(Int_t k = 0; k < nbtimebin; k++){
	      //	      printf(" row %d \t col %d \t timebin %d \t --> signal %d \n",irow,icol,k,signal);
	      Short_t signal = 999;
	      signal = (Short_t) digits->GetData(irow,icol,k);

	      if(signal==999) continue;
	      if(rob%2==0) { chB->Fill(det,signal); }
	      else {chA->Fill(det,signal); }
	    } // loop: ntimebin
	  } // loop: nCol
	} //loop: nRow
      } // if: hasdata
    } // loop: det
    loader->UnloadDigits();
  }// event

  // Display the detector matrix
  TCanvas *c = new TCanvas("c","",50,50,900,600);
  c->Divide(2,1);

  chA->SetAxisRange(detA,detB-1,"X");
  chA->SetTitle("HalfChamberSide A");
  chA->SetXTitle("Detector number");
  chA->SetYTitle("charge deposit [a.u]");
  chB->SetAxisRange(detA,detB-1,"X");
  chB->SetTitle("HalfChamberSide B");
  chB->SetXTitle("Detector number");
  chB->SetYTitle("charge deposit [a.u]");

  c->cd(1);
  chA->Draw("COLZ");

  c->cd(2);
  chB->Draw("COLZ");

  //c->SaveAs("ChargeDeposit.pdf");
}


text:
<!DOCTYPE html>

		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
		<meta name="author" content="www.frebsite.nl" />

		<title>dotdotdot, advanced cross-browser ellipsis for multiple line content.</title>

jQuery.dotdotdot

Advanced cross-browser ellipsis for multiple line content.

					Demo's and documentation: dotdotdot.frebsite.nl

Text only:

before:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

after:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Text with markup:

before:

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

It has survived not only five centuries, but also the leap into electronic typesetting.

after:

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

It has survived not only five centuries, but also the leap into electronic typesetting.

With an "after"-element:

before:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
						Read more »

after:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
						Read more »

Updating onWindowResize:

before:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

after:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.

Truncate readable pathnames

before:

www.website.com/file.html

www.website.com/with/a/long/pathname/file.html

after:

www.website.com/file.html

www.website.com/with/a/long/pathname/file.html


text:
const {expect} = require('chai');
const sinon = require('sinon');

describe('bmoor.flow.soon', function () {
	const service = require('./soon.js');

	let clock = null;
	function moveClock(increment) {
		clock.tick(increment);
	}

	let timerCallback = null;
	beforeEach(function () {
		timerCallback = sinon.spy();

		clock = sinon.useFakeTimers();
	});

	afterEach(function () {
		clock.restore();
	});

	it('should call a callback method within timeframe of first call', function () {
		var fn = service(function () {
			timerCallback();
		}, 10);

		fn();
		expect(timerCallback.called).to.be.false;

		fn();
		moveClock(9);
		expect(timerCallback.called).to.be.false;

		moveClock(1);
		expect(timerCallback.called).to.be.true;
		expect(timerCallback.callCount).to.equal(1);

		fn();
		moveClock(5);
		expect(timerCallback.callCount).to.equal(1);

		moveClock(5);
		expect(timerCallback.callCount).to.equal(2);
	});
});


text:
package me.ingeni.lottie_for_designer;

/**
 * Created by sungho on 2017. 4. 4..
 */

public class JsonData {
    private final String fileName;
    private final String fileType;

    public JsonData(String fileName, String fileType) {
        this.fileName = fileName;
        this.fileType = fileType;
    }

    public String getFileName() {
        return this.fileName;
    }

    public String getFileType() {
        return this.fileType;
    }
}


text:
<?php

namespace Jazz\Filter;

require_once ('Jazz/IFilter.php');

/**
 * Chop Filter Class
 *
 * Chops a string to the number of characters (NUM) to the nearest space.  It will
 * preserve words in sentences.  If the string is chopped, the string will be appended
 * by the APPEND CHARS setting.
 *
 * @package Jazz
 * @subpackage Filter
 * @author Michael Luster <phpjazz@nyclagniappe.com>
 * @copyright Copyright (c) NYCLagniappe.com - All Rights Reserved
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @link https://github.com/nyclagniappe/phpjazz
 */

class Chop implements \Jazz\IFilter {

    /**
     * Number of characters allowed.
     * @var int $_num
     */
    private $_num = 0;
    /**
     * Appended characters.
     * @var string $_appendChars
     */
    private $_appendChars;

    /**
     * Constructor.
     * @param null|int $num number of characters allowed
     * @param null|string $appendChars append characters if chopped
     */
    public function __construct($num=null, $appendChars=null) {
        if ($num !== null) {
            $this->setNum($num);
        }
        $this->setAppendChars($appendChars);
    }

    /** ACTION METHODS **/
    /**
     * Filters data against algorithm.
     * @param mixed &$data
     * @param null|int $num of characters allowed
     * @param null|string $appendChars if chopped
     * @return string
     */
    public function filter($data, $num=null, $appendChars=null) {
        if (is_string($data)) {
            $num = (is_int($num) ? $num : $this->getNum());
            $appendChars = (is_string($appendChars) ? $appendChars : $this->getAppendChars());

            if ($num > 0 && strlen($data) > $num) {
                $data = substr($data, 0, $num);
                $data = substr($data, 0, strrpos($data, ' '));
                $data .= $appendChars;
            }
        }
        return $data;
    }

    /** MUTATOR METHODS **/
    /**
     * Sets the number of characters allowed (chopping the rest)
     * @param int $num
     * @precondition $num >= 0
     * @return \Jazz\Filter\Chop
     * @throws \InvalidArgumentException
     * @throws \OutOfRangeException
     */
    public function setNum($num) {
        // verify precondition
        if (!is_int($num)) {
            throw new \InvalidArgumentException('num');
        }
        if ($num < 0) {
            throw new \OutOfRangeException();
        }

        $this->_num = $num;
        return $this;
    }

    /**
     * Sets the append characters used if data is chopped
     * @param string|null $chars
     * @return \Jazz\Filter\Chop
     * @throws \InvalidArgumentException
     */
    public function setAppendChars($chars) {
        // verify precondition
        if ($chars !== null && !is_string($chars)) {
            throw new \InvalidArgumentException('chars');
        }

        $this->_appendChars = $chars;
        return $this;
    }

    /** ACCESSOR METHODS **/
    /**
     * Returns the number of characters allowed
     * @return int
     */
    public function getNum() {
        return $this->_num;
    }

    /**
     * Returns the append characters
     * @return string
     */
    public function getAppendChars() {
        return $this->_appendChars;
    }

}


text:
from setuptools.command.test import test as TestCommand
import sys
from setuptools import setup

__version__ = "0.0.1"

class Tox(TestCommand):
    user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
    tox_args = None
    test_args = None
    test_suite = None

    def initialize_options(self):
        TestCommand.initialize_options(self)
        self.tox_args = None

    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = []
        self.test_suite = True

    def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import tox
        import shlex
        args = self.tox_args
        if args:
            args = shlex.split(self.tox_args)
        errno = tox.cmdline(args=args)
        sys.exit(errno)

setup(
    name='drf-swagger-yaml',
    version=__version__,
    packages=['drf_swagger_yaml'],
    include_package_data=True,
    url='https://github.com/TriplePoint-Software/drf-swagger-yaml',
    license='Apache License, Version 2.0',
    author='Konstantin Liuterovich',
    author_email='konstantinliuterovich@gmail.com',
    description='Django\'s Drf swagger yaml',
    install_requires=["django>=1.8,<1.11", 'djangorestframework', 'pyyaml'],
    tests_require=["tox", "pyyaml"],
    cmdclass={'test': Tox},
)


text:
const gulp = require('gulp');
const tsc = require('gulp-typescript');
const tsProject = tsc.createProject('./tsconfig.json');
const sourcemaps = require('gulp-sourcemaps');
const source = require('vinyl-source-stream');
const browserify = require('browserify');
const watchify = require("watchify");
const browserSync = require("browser-sync");
const watch = require('gulp-watch');
const runSequence = require('run-sequence');
const rimraf = require('gulp-rimraf');

/** Compile TypeScript sources */
gulp.task('script:compile', () => {
    return gulp.src('src/scripts/**/*.ts')
        .pipe(sourcemaps.init())
        .pipe(tsProject())
        .js
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('build'));
});

/** Bundle JavaScript sources by Browserify */
gulp.task('script:bundle', () => {
    const b = browserify({
        cache: {},
        packageCache: {},
        debug: true
    });
    const w = watchify(b);
    w.add('build/main.js');
    const bundle = () => {
        return w.bundle()
            .pipe(source('app.js'))
            .pipe(gulp.dest('public/assets/scripts'))
            .pipe(browserSync.reload({
                stram: true
            }));
    };
    w.on("update", bundle);
    return bundle();
});

/** Run Web server **/
gulp.task("serve", () => {
    return browserSync.init(null, {
        server: {
            baseDir: "public/"
        },
        reloadDelay: 1000
    })
});

gulp.task('template', () => {
    return gulp.src('src/templates/**/*.html')
        .pipe(gulp.dest('public/'))
        .pipe(browserSync.reload({
            stream: true
        }));
});

gulp.task('watch', () => {
    watch('src/scripts/**/*.ts', () => gulp.start('script:compile'));
    return watch('src/templates/**/*.html', () => gulp.start('template'));
});

gulp.task('clean', () => {
    return gulp.src(['public/', 'build/'])
        .pipe(rimraf());
});

gulp.task('default', () => runSequence('clean', ['template', 'script:compile'], 'script:bundle', ['serve', 'watch']));


text:
package org.projectnyx.network.mcpe.mcpe;

import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;
import lombok.NonNull;

public class McpeDataPacketManager {
    @Getter private static McpeDataPacketManager instance = new McpeDataPacketManager();

    @Getter private Map<Byte, DataPacket> packets = new HashMap<>();

    public McpeDataPacketManager(){
        registerPackets();
    }

    private void registerPackets() {
        registerPacket(new LoginPacket());
    }

    public void registerPacket(@NonNull DataPacket instance) {
        packets.put(instance.getPacketId(), instance);
    }

    public DataPacket get(ByteBuffer buffer) {
        return get(buffer.get(), buffer);
    }

    public DataPacket get(byte pid, ByteBuffer rest){
        if(packets.containsKey(pid)) {
            return packets.get(pid).clone().setBuffer(rest).parse();
        }
        return null;
    }
}


text:
import psutil
import time
from datetime import datetime
import pytz
import logging
from hvmonitor.exceptions import NoHVInstanceFound
from hvmonitor.outputs.stdout import PrintHandler
import hvmonitor.proc as proc
import hvmonitor.sys as sys

log = logging.getLogger(__name__)

def hv_pid():

    for proc in psutil.process_iter():
        try:
            pinfo = proc.as_dict(['name', 'pid', 'cmdline'])
        except psutil.NoSuchProcess:
            pass
        else:
            if any(["flowvisor" in c for c in pinfo['cmdline']]) and any(["java" in c for c in pinfo['cmdline']]):
                print("Found FlowVisor instance! (PID: %d)" % pinfo['pid'])
                return "fv", pinfo['pid']
            elif any(["OpenVirteX.jar" in c for c in pinfo['cmdline']]):
                print("Found OVX instance! (PID: %d)" % pinfo['pid'])
                return "ovx", pinfo['pid']
            elif "ovs-vswitchd" in pinfo['name']:
                print("Found OVS instance! (PID: %d)" % pinfo['pid'])
                return "ovs", pinfo['pid']

    raise NoHVInstanceFound()

class Monitor(object):

    def __init__(self, pid, hv_type, study_id, outputs=[PrintHandler()]):

        self._outputs = outputs
        self._pid = pid
        self._hv_type = hv_type
        self._study_id = study_id
        self._pproc = proc.Process(pid)

    def run(self, frequency=1):

        reference_time = datetime(2015, 1, 1, 0, 0, 0, tzinfo=pytz.utc)

        while True:

            stats = {}

            start = time.perf_counter()
            stats.update({"proc_%s" % k: v for k, v in self._pproc.statistics().items()})
            log.debug("Total proc time: %fms" % ((time.perf_counter() - start)*1000))

            start = time.perf_counter()
            stats.update({"sys_%s" % k: v for k, v in sys.statistics().items()})
            log.debug("Total sys time: %fms" % ((time.perf_counter() - start)*1000))

            stats['timestamp'] = int((datetime.now(pytz.utc) - reference_time).total_seconds()*1000)
            stats['hv'] = self._hv_type

            for o in self._outputs:
                o.out(self._study_id.get(), stats)

            start = time.perf_counter()

            time.sleep(1/frequency)

            log.debug("Sleep duration: %fms" % ((time.perf_counter() - start)*1000))


text:
package com.tdp2.androidclient.server.model;

import com.google.gson.annotations.SerializedName;

public class Notification {

    public int id;
    public String message;

    @SerializedName("feed_kind")
    public String feedKind;

    @Override
    public String toString() {
        return message;
    }

}


text:
<?php

namespace Magento\Payment\Gateway\Http;

use Magento\Framework\Exception\LocalizedException;

class ClientException extends LocalizedException
{
}


text:
namespace Problem_2_BankAccounts.Accounts
{
    using Base;
    using Contract;
    using Owner;
    using System;
    using System.Text;
    using Utilities;

    class LoanAccount : Account, IDeposit
    {

        public LoanAccount(Customer owner, decimal debt) : base(owner, debt)
        {
            this.Amount = debt;
            this.Owner = owner;
        }

        public void Deposit(decimal money)
        {
            this.Amount -= money;
            Console.WriteLine($"Deposited ${money:F2}");
        }

        public override decimal CalculateInterest(int months, decimal interest)
        {
            decimal result = 0;
            if (this.Owner is Individual && months > Constants.LoanIndividualMonths)
            {
                months -= Constants.LoanIndividualMonths;
                result = base.CalculateInterest(months, interest);
            }
            else if (this.Owner is Company && months > Constants.LoanCompanyMonths)
            {
                months -= Constants.LoanCompanyMonths;
                result = base.CalculateInterest(months, interest);
            }
            return result;
        }

        public override string ToString()
        {
            var info = new StringBuilder();
            info.AppendLine(new string('=', Constants.Delimiter));
            info.AppendLine("Loan Account");
            info.AppendLine($"Number: {this.Number}");
            info.AppendLine($"Amount left to return: ${this.Amount:F2}");
            info.AppendLine(new string('=', Constants.Delimiter));
            return info.ToString();
        }
    }
}


text:
extern void rsp_log(char* format, ...);

extern void rsp_log_error(char* message);


text:
namespace ExRam.Gremlinq.Core.Steps
{
    public sealed class AddVStep : Step
    {
        public AddVStep(string label) : base(SideEffectSemanticsChange.Write)
        {
            Label = label;
        }

        public string Label { get; }
    }
}


text:
namespace content {

void ViewStructureBuilder_populateViewStructureNode(
    JNIEnv* env,
    const base::android::JavaRef<jobject>& obj,
    const base::android::JavaRef<jobject>& node,
    const base::android::JavaRef<jstring>& text,
    jboolean has_selection,
    JniIntWrapper sel_start,
    JniIntWrapper sel_end,
    JniIntWrapper color,
    JniIntWrapper bgcolor,
    jfloat size,
    jboolean bold,
    jboolean italic,
    jboolean underline,
    jboolean line_through,
    const base::android::JavaRef<jstring>& class_name,
    JniIntWrapper child_count) {
  Java_ViewStructureBuilder_populateViewStructureNode(
      env, obj, node, text, has_selection, sel_start, sel_end, color, bgcolor,
      size, bold, italic, underline, line_through, class_name, child_count);
}

void ViewStructureBuilder_setViewStructureNodeBounds(
    JNIEnv* env,
    const base::android::JavaRef<jobject>& obj,
    const base::android::JavaRef<jobject>& node,
    jboolean is_root_node,
    JniIntWrapper parent_relative_left,
    JniIntWrapper parent_relative_top,
    JniIntWrapper width,
    JniIntWrapper height) {
  Java_ViewStructureBuilder_setViewStructureNodeBounds(
      env, obj, node, is_root_node, parent_relative_left, parent_relative_top,
      width, height);
}

void ViewStructureBuilder_setViewStructureNodeHtmlInfo(
    JNIEnv* env,
    const base::android::JavaRef<jobject>& obj,
    const base::android::JavaRef<jobject>& node,
    const base::android::JavaRef<jstring>& html_tag,
    const base::android::JavaRef<jstring>& css_display,
    const base::android::JavaRef<jobjectArray>& html_attributes) {
  Java_ViewStructureBuilder_setViewStructureNodeHtmlInfo(
      env, obj, node, html_tag, css_display, html_attributes);
}

void ViewStructureBuilder_setViewStructureNodeHtmlMetadata(
    JNIEnv* env,
    const base::android::JavaRef<jobject>& obj,
    const base::android::JavaRef<jobject>& node,
    const base::android::JavaRef<jobjectArray>& metadata_strings) {
  Java_ViewStructureBuilder_setViewStructureNodeHtmlMetadata(env, obj, node,
                                                             metadata_strings);
}

void ViewStructureBuilder_commitViewStructureNode(
    JNIEnv* env,
    const base::android::JavaRef<jobject>& obj,
    const base::android::JavaRef<jobject>& node) {
  Java_ViewStructureBuilder_commitViewStructureNode(env, obj, node);
}

base::android::ScopedJavaLocalRef<jobject>
ViewStructureBuilder_addViewStructureNodeChild(
    JNIEnv* env,
    const base::android::JavaRef<jobject>& obj,
    const base::android::JavaRef<jobject>& node,
    JniIntWrapper index) {
  return Java_ViewStructureBuilder_addViewStructureNodeChild(env, obj, node,
                                                             index);
}

}  // namespace content

#endif  // CONTENT_BROWSER_WEB_CONTENTS_VIEW_STRUCTURE_BUILDER_ANDROID_H_


text:
package edu.msudenver.cs3250.group6.msubanner.entities;

import java.time.LocalDate;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * Persistent Semester class.
 */
public class Semester {
    /** Number representation of August. */
    private static final int AUGUST = 8;

    /** Number representation of December / months in a year. */
    private static final int DECEMBER = 12;

    /** Number of months in a typical semester. */
    private static final int SEMESTER_LENGTH = 4;

    /**
     * Semester id number.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private String id;

    /**
     * LocalDate object containing the start date of the Semester.
     * https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html
     */
    private LocalDate semesterStartDate = LocalDate.now();

    /**
     * LocalDate object containing the end date of the Semester. auto
     * initializes to roughly 3 months after semesterStartDate with some
     * constraints and day default to 20
     */
    private LocalDate semesterEndDate = generateSemesterEndDate();

    /**
     * String representing the Semester season.
     */
    private String season = autoSetSeason();

    // TODO: create default and parameterized constructors

    /**
     * Initialize or set season field automatically based on semesterStartDate.
     *
     * @return String of the season, for purpose of initializing this.season
     */
    private String autoSetSeason() {
        if (this.semesterStartDate.getMonth().toString().equals("JANUARY")
                || this.semesterStartDate.getMonth().toString()
                .equals("FEBRUARY")
                || this.semesterStartDate.getMonth().toString()
                .equals("MARCH")) {

            this.setSeason("Spring");
            return "Spring";
        } else if (this.semesterStartDate.getMonth().toString().equals("APRIL")
                || this.semesterStartDate.getMonth().toString().equals("MAY")
                || this.semesterStartDate.getMonth().toString().equals("JUNE")
                || this.semesterStartDate.getMonth().toString()
                .equals("JULY")) {
            this.setSeason("Summer");
            return "Summer";
        } else {

            this.setSeason("Fall");
        }
        return "Fall";
    }

    /**
     * Generates a rough end date for a semester 4 months later.
     *
     * @return the estimated semester end date
     */
    private LocalDate generateSemesterEndDate() {
        int endMonth;
        int endYear;
        if (semesterStartDate.getMonthValue() > AUGUST) {
            endYear = semesterStartDate.getYear() + 1;
        } else {
            endYear = semesterStartDate.getYear();
        }
        endMonth = (semesterStartDate.getMonthValue() + SEMESTER_LENGTH)
                % DECEMBER;
        if (endMonth == 0) {
            endMonth = DECEMBER;
        }
        return LocalDate.of(endYear, endMonth,
                semesterStartDate.getDayOfMonth());
    }

    /**
     * @return LocalDate obj of the Semester Start Date obj
     */
    public LocalDate getSemesterStartDate() {
        return this.semesterStartDate;
    }

    /**
     * Sets the semesterStartDate as a LocalDate obj.
     *
     * @param year the year the semester is in
     * @param month the month the semester starts
     * @param date the start day of the semester
     */
    public void setSemesterStartDate(final int year, final int month,
            final int date) {
        LocalDate localDate = LocalDate.of(year, month, date);
        this.semesterStartDate = localDate;
        this.autoSetSeason();

        if (semesterStartDate.getYear() > semesterEndDate.getYear()
                || (semesterStartDate.getYear() == semesterEndDate.getYear()
                && semesterStartDate.getMonthValue() > semesterEndDate
                .getMonthValue())) {
            LocalDate endDate = generateSemesterEndDate();
            setSemesterEndDate(endDate.getYear(), endDate.getMonthValue(),
                    endDate.getDayOfMonth());
        }
    }

    /**
     * @return LocalDate obj of the Semester End Date obj
     */
    public LocalDate getSemesterEndDate() {
        return this.semesterEndDate;
    }

    /**
     * Sets the semesterEndDate as a LocalDate obj if the semesterStartDate is
     * in an earlier month than the semesterEndDate, else autosets a value in
     * the future.
     *
     * @param endYear the year the semester ends
     * @param endMonth the month the semester ends
     * @param endDate the end day of the semester
     */
    public void setSemesterEndDate(final int endYear, final int endMonth,
            final int endDate) {
        LocalDate localDate;
        if (semesterStartDate.getYear() < endYear
                || (semesterStartDate.getYear() <= endYear
                && semesterStartDate.getMonthValue() < endMonth)) {
            localDate = LocalDate.of(endYear, endMonth, endDate);
        } else {
            localDate = generateSemesterEndDate();
            System.out.println("warning: semesterEndDate automatically set,"
                    + " semesterEndDate must occur after semesterStartDate");
        }
        this.semesterEndDate = localDate;
    }

    /**
     * Valid enum to put in season field.
     */
    public enum Season {
        /** Fall. */
        FALL("Fall"),
        /** Spring. */
        SPRING("Spring"),
        /** Summer. */
        SUMMER("Summer");

        /**
         * String value of enum association for season.
         */
        private String seasonName;

        /**
         * Constructor for Season.
         *
         * @param newSeasonName the first letter uppercase name of the season
         */
        Season(final String newSeasonName) {
            this.seasonName = newSeasonName;
        }
    }

    /**
     * Sets the id of a Semester instance.
     *
     * @param newId New id for the Semester
     */
    public void setId(final String newId) {
        this.id = newId;
    }

    /**
     * Returns the id number of the Semester instance.
     *
     * @return id number of the Semester
     */
    public String getId() {
        return this.id;
    }

    /**
     * Sets the season with a valid string of the season name, otherwise
     * permissively runs autoSetSeason().
     *
     * @param newSeason the season to update to
     */
    public void setSeason(final String newSeason) {
        if (newSeason.equals(Season.FALL.seasonName)
                || newSeason.equals(Season.SPRING.seasonName)
                || newSeason.equals(Season.SUMMER.seasonName)) {
            this.season = newSeason;
        } else {
            System.out.println("warning: Season must be entered as"
                    + " 'Fall', 'Spring' or 'Summer'");
            this.autoSetSeason();
        }
    }

    /**
     * @return String representing the season the Semester is in
     */
    public String getSeason() {
        return season;
    }

    /**
     * @return int representing the year the semester falls in
     */
    public int getSemesterYear() {
        return this.semesterStartDate.getYear();
    }

    /**
     * Sets a new year on the Semester.
     *
     * @param semesterYear the year to be updated in the Semester
     */
    public void setSemesterYear(final int semesterYear) {
        LocalDate localDate = LocalDate.of(semesterYear,
                this.semesterStartDate.getMonth(),
                this.semesterStartDate.getDayOfMonth());
        this.semesterStartDate = localDate;
    }

    /**
     * hasConflict() checks only if there is a conflict of the year and season
     * and does not check for conflict with the specific LocalDate object's
     * month or day. - can be used to verify that there is only one semester
     * with a given year and season - can be used to check if a section has a
     * scheduling conflict
     *
     * @param semesterToCheck the semester to check against the current instance
     * @return boolean true if conflict exists, false if conflict does not exist
     */
    public boolean hasConflict(final Semester semesterToCheck) {
        if (semesterToCheck.getSemesterYear() == this.semesterStartDate
                .getYear() && semesterToCheck.season.equals(this.season)) {
            return true;
        }
        return false;
    }

    /**
     * toString for Semester.
     */
    @Override
    public String toString() {
        return season + ", " + getSemesterYear();
    }
}


text:
SYNONYM

#### According to
IRMNG Homonym List

#### Published in
Syll. fung. (Abellini) 2: 727 (1883)

#### Original name
Farlowia Saccardo, 1883

### Remarks
null


text:
import 'babel-polyfill';
import React from 'react';
import expect from 'expect';
import sinon from 'sinon';
import { mount } from 'enzyme';
import { ResetPasswordPage } from '../../../src/components/auth/ResetPasswordPage';
import componentsSeeder from '../../seeds/componentsSeeder';

describe('<ResetPasswordPage/>', () => {
  // create a spy function for signupAction
  const resetPasswordAction = sinon.spy();
  // spy on handleSubmit of SIgnup Page
  sinon.spy(ResetPasswordPage.prototype, 'handleSubmit');
  // spy on handleChange of SIgnup Page
  sinon.spy(ResetPasswordPage.prototype, 'handleChange');
  const { token } = componentsSeeder;
  const props = {
    resetState: {},
    location: {
      query: { token }
    },
    resetPasswordAction
  };
  const wrapper = mount(<ResetPasswordPage {...props}/>);

  it('should check that password field is defined', () => {
    expect(wrapper.find('FormField').at(0).props().name).toBe('password');
  });

  it('should check that confirmPassword field is defined', () => {
    expect(wrapper.find('FormField').at(1).props().name).toBe('confirmPassword');
  });

  it('Should check that number of form fields is equal to 2',
    () => {
      expect(wrapper.find('FormField').length).toBe(2);
    });

  it('Should check that IndexHeader is defined',
    () => {
      expect(wrapper.find('IndexHeader').length).toBe(1);
    });

  it('Should check that IndexFooter is defined',
    () => {
      expect(wrapper.find('IndexFooter').length).toBe(1);
    });

  it('Should check that handleSubmit is called', () => {
    // trigger an event by Reset form
    wrapper.find('form').simulate('submit');
    // handleSubmit is called
    expect(ResetPasswordPage.prototype.handleSubmit.calledOnce).toBe(true);
  });

  it('Should check that there is reset password submit button ', () => {
    const button = wrapper.find('button');
    expect(button.props().type).toEqual('submit');
    expect(button.text()).toEqual('Reset my password');
  });

  it('Should check that recoverPasswordAction is called', () => {
    // trigger an event by Signup form
    wrapper.find('form button').simulate('click');
    // recoverPasswordAction inside handleSubmit is called
    expect(resetPasswordAction.called).toBe(true);
  });

  it('Should check that ErrorComponent exists when error is thrown', () => {
    const resetState = {
      resetFails: 'passwords field can\'t be empty'
    };
    wrapper.setProps({ resetState });
    expect(wrapper.find('ErrorComponent').length).toBe(1);
  });
});


text:
package db

import (
	"log"

	"github.com/ponzu-cms/ponzu/system/item"
	"github.com/ponzu-cms/ponzu/system/search"

	"github.com/boltdb/bolt"
	"github.com/nilslice/jwt"
)

var (
	store *bolt.DB

	buckets = []string{
		"__config", "__users",
		"__addons", "__uploads",
		"__contentIndex",
	}

	bucketsToAdd []string
)

// Store provides access to the underlying *bolt.DB store
func Store() *bolt.DB {
	return store
}

// Close exports the abillity to close our db file. Should be called with defer
// after call to Init() from the same place.
func Close() {
	err := store.Close()
	if err != nil {
		log.Println(err)
	}
}

// Init creates a db connection, initializes db with required info, sets secrets
func Init() {
	if store != nil {
		return
	}

	var err error
	store, err = bolt.Open("system.db", 0666, nil)
	if err != nil {
		log.Fatalln(err)
	}

	err = store.Update(func(tx *bolt.Tx) error {
		// initialize db with all content type buckets & sorted bucket for type
		for t := range item.Types {
			_, err := tx.CreateBucketIfNotExists([]byte(t))
			if err != nil {
				return err
			}

			_, err = tx.CreateBucketIfNotExists([]byte(t + "__sorted"))
			if err != nil {
				return err
			}
		}

		// init db with other buckets as needed
		buckets = append(buckets, bucketsToAdd...)

		for _, name := range buckets {
			_, err := tx.CreateBucketIfNotExists([]byte(name))
			if err != nil {
				return err
			}
		}

		return nil
	})
	if err != nil {
		log.Fatalln("Coudn't initialize db with buckets.", err)
	}

	err = LoadCacheConfig()
	if err != nil {
		log.Fatalln("Failed to load config cache.", err)
	}

	clientSecret := ConfigCache("client_secret").(string)

	if clientSecret != "" {
		jwt.Secret([]byte(clientSecret))
	}

	// invalidate cache on system start
	err = InvalidateCache()
	if err != nil {
		log.Fatalln("Failed to invalidate cache.", err)
	}
}

// AddBucket adds a bucket to be created if it doesn't already exist
func AddBucket(name string) {
	bucketsToAdd = append(bucketsToAdd, name)
}

// InitSearchIndex initializes Search Index for search to be functional
// This was moved out of db.Init and put to main(), because addon checker was initializing db together with
// search indexing initialisation in time when there were no item.Types defined so search index was always
// empty when using addons. We still have no guarentee whatsoever that item.Types is defined
// Should be called from a goroutine after SetContent is successful (SortContent requirement)
func InitSearchIndex() {
	for t := range item.Types {
		err := search.MapIndex(t)
		if err != nil {
			log.Fatalln(err)
			return
		}
		SortContent(t)
	}
}

// SystemInitComplete checks if there is at least 1 admin user in the db which
// would indicate that the system has been configured to the minimum required.
func SystemInitComplete() bool {
	complete := false

	err := store.View(func(tx *bolt.Tx) error {
		users := tx.Bucket([]byte("__users"))
		if users == nil {
			return bolt.ErrBucketNotFound
		}

		err := users.ForEach(func(k, v []byte) error {
			complete = true
			return nil
		})
		if err != nil {
			return err
		}

		return nil
	})
	if err != nil {
		complete = false
		log.Fatalln(err)
	}

	return complete
}


text:
using Shouldly;
using Xunit;

namespace AutoMapper.UnitTests.Bug
{
    public class ReadOnlyFieldMappingBug : AutoMapperSpecBase
    {
        public class Source
        {
            public string Value { get; set; }
        }

        public class Destination
        {
            public readonly string Value;

            public Destination(string value)
            {
                Value = value;
            }
        }

        protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
        {
            // BUG. ArgumentException : Expression must be writeable
            cfg.CreateMap<Source, Destination>();
        });

        [Fact]
        public void Should_map_over_constructor()
        {
            var source = new Source { Value = "value" };

            var dest = Mapper.Map<Destination>(source);

            dest.Value.ShouldBe(source.Value);
        }
    }
}


text:
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Cliente;

class ClienteController extends Controller
{
    public function index()
    {
        $clientes = Cliente::all();

        return view('cliente.index',[
            'clientes' => $clientes
        ]);
    }

    public function create(Request $request)
    {
        $cliente = new Cliente();

        if($request->isMethod('get')){

            return view('cliente.form', [
                'cliente' => $cliente
            ]);
        }

        $this->handleRequest($cliente);

        return redirect()->route('cliente_index');
    }

    public function update(Request $request, $id)
    {
        $cliente = Cliente::find($id);

        if($request->isMethod('get')){
            return view('cliente.form', [
                'cliente' => $cliente
            ]);
        }

        $this->handleRequest($cliente);

        return redirect()->route('cliente_index');
    }

    private function handleRequest(Cliente &$cliente)
    {
        $request = request();

        $cliente->nome = $request->nome;
        $cliente->telefone = $request->telefone;
        $cliente->documento = $request->documento;

        $cliente->save();
    }

    public function delete($id)
    {
    }
}


text:
class PE_Smoke : public ParticleEffect
{
	void update_single_particle(Particle& p,float delta_t,float p_time);
	void emit_single_particle(Particle& p);

public:
	PE_Smoke(vec2 const& pos);

};


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Resource.Layout
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Resource.Layout
   ">
    <meta name="generator" content="docfx 2.10.2.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

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

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Class Resource.Layout

Inheritance

System.Object

Resource.Layout

Namespace:xAPIWrapper.Tests.Droid

Assembly:xAPIWrapper.Tests.Droid.dll

Syntax

public class Layout : object

Fields

                View Source

abc_action_bar_title_item

Declaration

public const int abc_action_bar_title_item = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_action_bar_up_container

Declaration

public const int abc_action_bar_up_container = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_action_bar_view_list_nav_layout

Declaration

public const int abc_action_bar_view_list_nav_layout = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_action_menu_item_layout

Declaration

public const int abc_action_menu_item_layout = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_action_menu_layout

Declaration

public const int abc_action_menu_layout = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_action_mode_bar

Declaration

public const int abc_action_mode_bar = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_action_mode_close_item_material

Declaration

public const int abc_action_mode_close_item_material = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_activity_chooser_view

Declaration

public const int abc_activity_chooser_view = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_activity_chooser_view_list_item

Declaration

public const int abc_activity_chooser_view_list_item = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_alert_dialog_material

Declaration

public const int abc_alert_dialog_material = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_dialog_title_material

Declaration

public const int abc_dialog_title_material = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_expanded_menu_layout

Declaration

public const int abc_expanded_menu_layout = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_list_menu_item_checkbox

Declaration

public const int abc_list_menu_item_checkbox = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_list_menu_item_icon

Declaration

public const int abc_list_menu_item_icon = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_list_menu_item_layout

Declaration

public const int abc_list_menu_item_layout = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_list_menu_item_radio

Declaration

public const int abc_list_menu_item_radio = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_popup_menu_item_layout

Declaration

public const int abc_popup_menu_item_layout = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_screen_content_include

Declaration

public const int abc_screen_content_include = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_screen_simple

Declaration

public const int abc_screen_simple = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_screen_simple_overlay_action_mode

Declaration

public const int abc_screen_simple_overlay_action_mode = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_screen_toolbar

Declaration

public const int abc_screen_toolbar = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_search_dropdown_item_icons_2line

Declaration

public const int abc_search_dropdown_item_icons_2line = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_search_view

Declaration

public const int abc_search_view = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

abc_select_dialog_material

Declaration

public const int abc_select_dialog_material = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_layout_snackbar

Declaration

public const int design_layout_snackbar = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_layout_snackbar_include

Declaration

public const int design_layout_snackbar_include = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_layout_tab_icon

Declaration

public const int design_layout_tab_icon = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_layout_tab_text

Declaration

public const int design_layout_tab_text = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_navigation_item

Declaration

public const int design_navigation_item = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_navigation_item_header

Declaration

public const int design_navigation_item_header = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_navigation_item_separator

Declaration

public const int design_navigation_item_separator = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_navigation_item_subheader

Declaration

public const int design_navigation_item_subheader = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

design_navigation_menu

Declaration

public const int design_navigation_menu = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

mr_media_route_chooser_dialog

Declaration

public const int mr_media_route_chooser_dialog = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

mr_media_route_controller_material_dialog_b

Declaration

public const int mr_media_route_controller_material_dialog_b = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

mr_media_route_list_item

Declaration

public const int mr_media_route_list_item = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_media_action

Declaration

public const int notification_media_action = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_media_cancel_action

Declaration

public const int notification_media_cancel_action = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_template_big_media

Declaration

public const int notification_template_big_media = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_template_big_media_narrow

Declaration

public const int notification_template_big_media_narrow = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_template_lines

Declaration

public const int notification_template_lines = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_template_media

Declaration

public const int notification_template_media = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_template_part_chronometer

Declaration

public const int notification_template_part_chronometer = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

notification_template_part_time

Declaration

public const int notification_template_part_time = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

select_dialog_item_material

Declaration

public const int select_dialog_item_material = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

select_dialog_multichoice_material

Declaration

public const int select_dialog_multichoice_material = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

select_dialog_singlechoice_material

Declaration

public const int select_dialog_singlechoice_material = null

Field Value

                    Type
                    Description

                    System.Int32

                View Source

support_simple_spinner_dropdown_item

Declaration

public const int support_simple_spinner_dropdown_item = null

Field Value

                    Type
                    Description

                    System.Int32

                    View Source

              Back to top

            Copyright © 2015-2016 Microsoft
Generated by DocFX


text:
const http = require('http'),
  httpError = require('http-errors'),
  koa = require('koa'),
  route = require('koa-route'),
  error = require('koa-error'),
  terminator = require('./terminator');

function example() {
  const app = koa();

  app.use(error());
  app.use(terminator());
  app.use(route.get('/fast', function* () {
    this.status = 200;
  }));
  app.use(route.get('/client-error', function* () {
    throw new httpError.BadRequest();
  }));
  app.use(route.get('/slow', function* () {
    yield new Promise(function(resolve) {
      setTimeout(function() {
        resolve();
      }, 2000);
    });
    this.status = 200;
  }));
  app.use(route.get('/never', function* () {
    throw new Error('should not be caled');
  }));
  app.use(route.get('/error', function* () {
    throw new Error();
  }));
  app.use(route.get('/error-nothrow', function* () {
    this.status = 503;
  }));

  return http.createServer(app.callback());
}

module.exports = example;

if (require.main === module) {
  const server = example();
  server.listen(8888);
}