text:
package q3m.q3.ani;

import java.io.IOException;
import java.io.InputStream;

import q3m.Q3M;
import q3m.ani.AniCfgAbstr;

/**
 * Quake III abstract player animation configuration.
 *
 * @author nlotz
 */
public abstract class AniCfgQ3Both extends AniCfgAbstr {

    /**
     * Sequence index (death 1).
     */
    public static final int DEATH_1 = 1;

    /**
     * Sequence index (dead 1).
     */
    public static final int DEAD_1 = 2;

    /**
     * Sequence index (death 2).
     */
    public static final int DEATH_2 = 3;

    /**
     * Sequence index (dead 2).
     */
    public static final int DEAD_2 = 4;

    /**
     * Sequence index (death 3).
     */
    public static final int DEATH_3 = 5;

    /**
     * Sequence index (dead 3).
     */
    public static final int DEAD_3 = 6;

    /**
     * Reads a Quake III player animation configuration from a resource path.
     *
     * @param path the resource path
     * @param rows the number of sequences to read
     * @param sequences the sequence names
     * @throws IOException
     */
    protected AniCfgQ3Both(String path, int rows, String[] sequences) throws IOException {
        super(Q3M.getResStream(path), rows, sequences);
    }

    /**
     * Reads a Quake III player animation configuration from a stream.
     *
     * @param in the stream to read from
     * @param rows the number of sequences to read
     * @param sequences the sequence names
     * @throws IOException
     */
    protected AniCfgQ3Both(InputStream in, int rows, String[] sequences) throws IOException {
        super(in, rows, sequences);
    }

    /* (non-Javadoc)
     * @see q3m.ani.AniCfg#getFirstIndex()
     */
    public int getFirstIndex() {
        return 0;
    }

    /* (non-Javadoc)
     * @see q3m.ani.AniCfg#getFpsIndex()
     */
    public int getFpsIndex() {
        return 3;
    }

    /* (non-Javadoc)
     * @see q3m.ani.AniCfg#getLengthIndex()
     */
    public int getLengthIndex() {
        return 1;
    }

    /* (non-Javadoc)
     * @see q3m.ani.AniCfg#getLoopingIndex()
     */
    public int getLoopingIndex() {
        return 2;
    }

}


text:
package no.stelar7.api.r4j.pojo.lol.liveclient.events;

import java.util.Objects;

public class InhibRespawningSoonEvent extends GameEvent
{
    private String InhibRespawningSoon;

    public String getInhibRespawningSoon()
    {
        return InhibRespawningSoon;
    }

    @Override
    public boolean equals(Object o)
    {
        if (this == o)
        {
            return true;
        }
        if (o == null || getClass() != o.getClass())
        {
            return false;
        }
        if (!super.equals(o))
        {
            return false;
        }
        InhibRespawningSoonEvent that = (InhibRespawningSoonEvent) o;
        return Objects.equals(InhibRespawningSoon, that.InhibRespawningSoon);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(super.hashCode(), InhibRespawningSoon);
    }

    @Override
    public String toString()
    {
        return "InhibRespawningSoonEvent{" +
               "InhibRespawningSoon='" + InhibRespawningSoon + '\'' +
               ", EventID=" + EventID +
               ", EventName='" + EventName + '\'' +
               ", EventTime=" + EventTime +
               '}';
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
class MR_Social_Sharing_Toolkit_Facebook extends MR_Social_Sharing_Toolkit_Button {
	function __construct() {
		$this->share_buttons[] = array('name' => 'fb_like', 'title' => 'Facebook Like', 'types' => array('none', 'none_text', 'horizontal', 'vertical'));
		$this->share_buttons[] = array('name' => 'fb_share', 'title' => 'Facebook Share', 'types' => array('none', 'horizontal', 'vertical', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
		$this->share_buttons[] = array('name' => 'fb_send', 'title' => 'Facebook Send', 'types' => array('none'));
		$this->follow_buttons[] = array('name' => 'follow_facebook', 'title' => 'Facebook', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
		$this->title = 'Facebook';
		$this->icon = 'facebook';
	}

	function fb_like($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
		//$retval = '<iframe src="https://www.facebook.com/plugins/like.php?locale='.__('en_US','mr_social_sharing_toolkit').'&href='.urlencode($url).'&layout=';
		$retval = '<div class="fb-like" data-href="'.$url.'" data-send="false" ';
		switch ($type) {
			case 'horizontal':
				//$retval .= 'button_count';
				if ($id == 'recommend') {
					$width = __('fb_horizontal_recommend_width','mr_social_sharing_toolkit');
					$width = ($width == 'fb_horizontal_recommend_width') ? '120' : $width;
					$retval .= 'data-layout="button_count" data-width="'.$width.'" data-action="recommend"';
				} else {
					$width = __('fb_horizontal_width','mr_social_sharing_toolkit');
					$width = ($width == 'fb_horizontal_width') ? '90' : $width;
					$retval .= 'data-layout="button_count" data-width="'.$width.'"';
				}
				$height = '21';
				break;
			case 'vertical':
				//$retval .= 'box_count';
				if ($id == 'recommend') {
					$width = __('fb_vertical_recommend_width','mr_social_sharing_toolkit');
					$width = ($width == 'fb_vertical_recommend_width') ? '92' : $width;
					$retval .= 'data-layout="box_count" data-width="'.$width.'" data-action="recommend"';
				} else {
					$width = __('fb_vertical_width','mr_social_sharing_toolkit');
					$width = ($width == 'fb_vertical_width') ? '55' : $width;
					$retval .= 'data-layout="box_count" data-width="'.$width.'"';
				}
				$height = '62';
				break;
			case 'none_text':
				//$retval .= 'standard';
				if ($id == 'recommend') {
					$width = 'auto';
					$retval .= 'data-width="'.$width.'" data-action="recommend"';
				} else {
					$width = 'auto';
					$retval .= 'data-width="'.$width.'"';
				}
				$height = '25';
				break;
			default:
				//$retval .= 'standard';
				if ($id == 'recommend') {
					$width = __('fb_standard_recommend_width','mr_social_sharing_toolkit');
					$width = ($width == 'fb_standard_standard_recommend_width') ? '91' : $width;
					$retval .= 'data-width="'.$width.'" data-action="recommend"';
				} else {
					$width = __('fb_standard_width','mr_social_sharing_toolkit');
					$width = ($width == 'fb_standard_width') ? '51' : $width;
					$retval .= 'data-width="'.$width.'"';
				}
				$height = '24';
				break;
		}
		//$retval .= '&show_faces=false&width='.$width.'&height='.$height.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$width.'px; height:'.$height.'px;" allowTransparency="true">';*/
		$retval .= ' data-show-faces="false">
';
		$lang = __('en_US','mr_social_sharing_toolkit');
		$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
		$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__), $footer);
		$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/'.$lang.'/all.js#xfbml=1', $footer);
		return ''.$retval.'';
	}

	function fb_share($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
		switch ($type) {
			case 'vertical':
				$retval = '<fb:share-button type="box_count" href="'.$url.'"></fb:share-button>';
				//$retval = 'Share';
				$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
				$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
				$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/en_US/all.js#xfbml=1', $footer);
				//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
				break;
			case 'horizontal':
				$retval = '<fb:share-button type="button_count" href="'.$url.'"></fb:share-button>';
				//$retval = 'Share';
				$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
				$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
				$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/en_US/all.js#xfbml=1', $footer);
				//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
				break;
			case 'none':
				$retval = '<fb:share-button type="button" href="'.$url.'"></fb:share-button>';
				//$retval = 'Share';
				$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
				$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
				$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/en_US/all.js#xfbml=1', $footer);
				//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
				break;
			default:
				$url = 'https://www.facebook.com/sharer/sharer.php?u='.urlencode($url).'&t='.urlencode($title);
				$text = ($text == '') ? __('Share on','mr_social_sharing_toolkit').' Facebook' : $text;
				$retval = $this->get_icon($type, $url, $text, $icon, true);
				break;
		}
		return $retval;
	}

	function fb_send($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
		//$retval = '

<fb:send href="'.$url.'" font=""></fb:send>';
		$retval = '

';
		$lang = __('en_US','mr_social_sharing_toolkit');
		$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
		$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
		$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/'.$lang.'/all.js#xfbml=1', $footer);
		return $retval;
	}

	function follow_facebook($type, $id, $text = '', $icon = '') {
		$url = 'http://www.facebook.com/'.$id;
		$text = ($text == '') ? __('Friend me on','mr_social_sharing_toolkit').' Facebook' : $text;
		$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
		return $this->get_icon($type, $url, $text, $icon, false, $blank);
	}
}
?>


text:
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _three = require('three');

var _three2 = _interopRequireDefault(_three);

var _ShapeAction2 = require('./ShapeAction');

var _ShapeAction3 = _interopRequireDefault(_ShapeAction2);

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var AbsArcAction = function (_ShapeAction) {
  _inherits(AbsArcAction, _ShapeAction);

  function AbsArcAction(x, y, radius, startAngle, endAngle, clockwise) {
    _classCallCheck(this, AbsArcAction);

    var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AbsArcAction).call(this));

    _this.x = x;
    _this.y = y;
    _this.radius = radius;
    _this.startAngle = startAngle;
    _this.endAngle = endAngle;
    _this.clockwise = clockwise;
    return _this;
  }

  _createClass(AbsArcAction, [{
    key: 'performAction',
    value: function performAction(shape) {
      shape.absarc(this.x, this.y, this.radius, this.startAngle, this.endAngle, this.clockwise);
    }
  }]);

  return AbsArcAction;
}(_ShapeAction3.default);

module.exports = AbsArcAction;


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Geo Pattern Generator</title>
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">

			    Geo Pattern Generator

				{{if .Name }}

 {{ .Name }}

Log Out

				{{else}}

Log In

				{{end}}

Geo Pattern Generator

					<form class="form-horizontal" role="form" id="form">

							Text:

								<input type="text" name="Phrase" class="form-control" placeholder="Type text to create a pattern, leave blank for random patterns!">

							Color:

								<input type="color" name="Color" class="form-control">

							Type:

								<select class="form-control" name="Generator">
									<option value="">Random</option>
									<option value="chevrons">Chevrons</option>
									<option value="concentric-circles">Concentric Circles</option>
									<option value="diamonds">Diamonds</option>
									<option value="hexagons">Hexagons</option>
									<option value="mosaic-squares">Mosaic Squares</option>
									<option value="nested-squares">Nested Squares</option>
									<option value="octagons">Octagons</option>
									<option value="overlapping-circles">Overlapping Circles</option>
									<option value="overlapping-rings">Overlapping Rings</option>
									<option value="plaid">Plaid</option>
									<option value="plus-signs">Plus Signs</option>
									<option value="sine-waves">Sine Waves</option>
									<option value="squares">Squares</option>
									<option value="tessellation">Tessellation</option>
									<option value="triangles">Triangles</option>
									<option value="xes">X's</option>
								</select>

								<button type="submit" name="Type" value="Render" class="btn btn-default">Submit</button>

							{{ if .Name }}

								<button type="submit" name="Type" value="Save" class="btn btn-default">Submit & Save</button>

							{{ end }}

					</form>

					{{ if .Name }}

← Prev

My Saved Patterns

Next →

					{{ else }}

To Save Patterns, Please Log In

					{{ end }}

← Prev

All Saved Patterns

Next →


text:
package jais.messages.enums;

/**
 *
 * @author Jonathan Machen
 */
public enum ManeuverType {

    NOT_AVAILABLE( 0, "Not available (default)" ),
    NO_SPECIAL_MANEUVER( 1, "No special maneuver" ),
    SPECIAL_MANEUVER( 2, "Special maneuver" );  // ie, regional passing arrangement

    private final int _code;
    private final String _description;

    /**
     *
     * @param code
     * @param description
     */
    ManeuverType( int code, String description ) {
        _code = code;
        _description = description;
    }

    /**
     *
     * @return
     */
    public int getCode() {
        return _code;
    }

    /**
     *
     * @return
     */
    public String getdescription() {
        return _description;
    }

    /**
     *
     * @param code
     * @return
     */
    public static ManeuverType getForCode( int code ) {
        ManeuverType mType = null;

        for( ManeuverType type : ManeuverType.values() ) {
            if( type.getCode() == code ) {
                mType = type;
                break;
            }
        }

        return mType;
    }

}


text:
module LongHardLook
	class JavaApplication
		attr_reader :name

		def initialize(filesystem_adapter, name)
			@name = name
			@filesystem_adapter = filesystem_adapter
		end

		def packages
			packages = []
			@filesystem_adapter.find(:java).each do |java_file|
				extracted_package = extract_package(java_file)
				packages << extracted_package if extracted_package
			end
			packages.uniq
		end

		private

		def extract_package(java_file)
			match_data = /\s*package (.+);/.match(java_file.content)
			return nil if !match_data
			match_data[1]
		end
	end
end


text:
package com.vaadin.elements.common.js;

import com.google.gwt.dom.client.Element;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.js.JsUtils;
import com.google.gwt.regexp.shared.MatchResult;
import com.google.gwt.regexp.shared.RegExp;

/**
 * A collection of validations for JS values.
 */
public enum JSValidate {
    //@formatter:off
    String("string value", "(.+)", String.class, "", ""),
    Pixel("pixel value", "([\\d\\.]+)(px)?$", Double.class, null, null),
    Integer("int value", "([+-]?\\d+)", Integer.class, 0, 0),
    Double("double value", "([+-]?[\\d\\.]+)", Double.class, 0.0, 0.0),
    Boolean("boolean value", "(|true|false)", Boolean.class, true, false);
    //@formatter:on

    private final String message;
    private final RegExp regex;
    private final Class<?> type;
    private final Object defaultIfEmpty;
    private final Object defaultIfNull;

    private JSValidate(String message, String regex, Class<?> type,
            Object defaultIfEmpty, Object defaultIfNull) {
        this.message = message;
        this.regex = RegExp.compile("^" + regex + "$", "i");
        this.type = type;
        this.defaultIfEmpty = defaultIfEmpty;
        this.defaultIfNull = defaultIfNull;
    }

    public <T> T attr(GQuery g, String s) {
        return attr(g.get(0), s, defaultIfEmpty, defaultIfNull);
    }

    public <T> T attr(GQuery g, String s, Object defaultIfEmpty,
            Object defaultIfNull) {
        return attr(g.get(0), s, defaultIfEmpty, defaultIfNull);
    }

    public <T> T attr(Element el, String s) {
        return val(
                el != null && JsUtils.hasAttribute(el, s) ? el.getAttribute(s)
                        : null, defaultIfEmpty, defaultIfNull);
    }

    public <T> T attr(Element el, String s, Object defaultIfEmpty,
            Object defaultIfNull) {
        return val(
                el != null && el.hasAttribute(s) ? el.getAttribute(s) : null,
                defaultIfEmpty, defaultIfNull);
    }

    public <T> T val(String s) {
        return val(s, defaultIfEmpty, defaultIfNull);
    }

    public <T> T val(Object o, Object defaultIfEmpty, Object defaultIfNull) {
        java.lang.String string = JS.isUndefinedOrNull(o) ? null
                : java.lang.String.valueOf(o);
        return val(string, defaultIfEmpty, defaultIfNull);
    }

    @SuppressWarnings("unchecked")
    public <T> T val(String s, Object defaultIfEmpty, Object defaultIfNull) {
        if (s == null || JS.isUndefinedOrNull(s)) {
            return (T) defaultIfNull;
        }
        if (s.trim().isEmpty()) {
            return (T) defaultIfEmpty;
        }
        MatchResult r = regex.exec(s);
        String v;
        if (r == null || (v = r.getGroup(1)) == null) {
            throw new RuntimeException("Invalid " + message + "(" + s
                    + "), valid format is " + regex.toString());
        }
        try {
            if (type == String.class) {
                return (T) v;
            }
            if (type == Integer.class) {
                return (T) java.lang.Integer.valueOf(v);
            }
            if (type == Double.class) {
                return (T) java.lang.Double.valueOf(v);
            }
            if (type == Boolean.class) {
                return (T) java.lang.Boolean.valueOf(v);
            }
            return (T) v;
        } catch (Exception e) {
            throw new RuntimeException("Invalid " + message
                    + ", valid format is " + regex.toString());
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest identifier="_5nSGNoR5wc9_course_id" version="1.0" xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsproject.org/xsd/imscp_rootv1p1p2 imscp_rootv1p1p2.xsd http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd http://www.adlnet.org/xsd/adlcp_rootv1p2 adlcp_rootv1p2.xsd">
  <metadata>
    <lom xmlns="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd">
      <general>
        <title>
          <langstring xml:lang="x-none">Noodle Box - Point of Sale & Kiosk Assessment</langstring>
        </title>
      </general>
      <lifecycle>
        <version>
          <langstring xml:lang="x-none">1</langstring>
        </version>
        <status>
          <source>
            <langstring xml:lang="x-none">LOMv1.0</langstring>
          </source>
          <value>
            <langstring xml:lang="x-none">Final</langstring>
          </value>
        </status>
      </lifecycle>
      <metametadata>
      </metametadata>
      <educational>
        <typicallearningtime>
          <datetime>PT0H0M0S</datetime>
        </typicallearningtime>
      </educational>
      <rights>
        <cost>
          <source>
            <langstring xml:lang="x-none">LOMv1.0</langstring>
          </source>
          <value>
            <langstring xml:lang="x-none">yes</langstring>
          </value>
        </cost>
        <copyrightandotherrestrictions>
          <source>
            <langstring xml:lang="x-none">LOMv1.0</langstring>
          </source>
          <value>
            <langstring xml:lang="x-none">yes</langstring>
          </value>
        </copyrightandotherrestrictions>
      </rights>
    </lom>
  </metadata>
  <organizations default="Noodle_Box_-_Point_of_Sale_&_Kiosk_Assessment_ORG">
    <organization identifier="Noodle_Box_-_Point_of_Sale_&_Kiosk_Assessment_ORG">
      <title>Noodle Box - Point of Sale & Kiosk Assessment</title>
      <item identifier="Noodle_Box_SCO" isvisible="true" identifierref="__5nSGNoR5wc9_course_id_RES">
        <title>Noodle Box</title>
        <adlcp:masteryscore>99</adlcp:masteryscore>
      </item>
    </organization>
  </organizations>
  <resources>
    <resource identifier="__5nSGNoR5wc9_course_id_RES" type="webcontent" href="meow1.html" adlcp:scormtype="scoa">
      <file href="story_content/thumbnail.jpg" />
    </resource>
    <resource identifier="__5nSGNoR5wc9_course_id_RES" type="webcontent" href="meow2.html" adlcp:scormtype="sco">
      <file href="story_content/thumbnail.jpg" />
    </resource>
  </resources>
</manifest>


text:
package org.tuxdevelop.spring.batch.lightmin.api.resource.batch;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author Marcel Becker
 * @Since 0.3
 */
@Data
public class JobExecutionPage implements Serializable {

    private static final long serialVersionUID = 1L;

    private int startIndex;
    private int pageSize;
    private String jobName;
    private Integer totalJobExecutionCount;
    private Long jobInstanceId;
    private List<JobExecution> jobExecutions;
}


text:
<?php

namespace backend\controllers;

use Yii;
use common\models\VidmageTag;
use common\models\VidmageTagSearch;
use yii\web\Controller;
use common\models\User;
use yii\web\HttpException;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use yii\helpers\Url;
use dmstr\bootstrap\Tabs;

/**
 * VidmageTagController implements the CRUD actions for VidmageTag model.
 */
class VidmageTagController extends Controller
{
    /**
     * @var boolean whether to enable CSRF validation for the actions in this controller.
     * CSRF validation is enabled only when both this property and [[Request::enableCsrfValidation]] are true.
     */
    public $enableCsrfValidation = false;

	/**
     * Restrict access permissions to admin user and users with auth-item 'module-controller'
	 * @inheritdoc
	 */
	public function behaviors()
	{
		return [
			'access' => [
				'class' => AccessControl::className(),
					'rules' => [
					[
                       'actions' => ['index', 'view', 'create', 'update', 'delete'],
                       'allow' => true,
                       'roles' => ['@'],
                       'matchCallback' => function ($rule, $action) {
                           return User::isUserAdmin(Yii::$app->user->identity->username);
                       }
                   ]
				]
			]
		];
	}

	/**
	 * Lists all VidmageTag models.
	 * @return mixed
	 */
	public function actionIndex()
	{
		$searchModel  = new VidmageTagSearch;
		$dataProvider = $searchModel->search($_GET);

		Tabs::clearLocalStorage();

        Url::remember();
        \Yii::$app->session['__crudReturnUrl'] = null;

		return $this->render('index', [
			'dataProvider' => $dataProvider,
			'searchModel' => $searchModel,
		]);
	}

	/**
	 * Displays a single VidmageTag model.
	 * @param integer $id
     *
	 * @return mixed
	 */
	public function actionView($id)
	{
        \Yii::$app->session['__crudReturnUrl'] = Url::previous();
        Url::remember();
        Tabs::rememberActiveState();

        return $this->render('view', [
			'model' => $this->findModel($id),
		]);
	}

	/**
	 * Creates a new VidmageTag model.
	 * If creation is successful, the browser will be redirected to the 'view' page.
	 * @return mixed
	 */
	public function actionCreate()
	{
		$model = new VidmageTag;

		try {
            if ($model->load($_POST) && $model->save()) {
                return $this->redirect(Url::previous());
            } elseif (!\Yii::$app->request->isPost) {
                $model->load($_GET);
            }
        } catch (\Exception $e) {
            $msg = (isset($e->errorInfo[2]))?$e->errorInfo[2]:$e->getMessage();
            $model->addError('_exception', $msg);
		}
        return $this->render('create', ['model' => $model]);
	}

	/**
	 * Updates an existing VidmageTag model.
	 * If update is successful, the browser will be redirected to the 'view' page.
	 * @param integer $id
	 * @return mixed
	 */
	public function actionUpdate($id)
	{
		$model = $this->findModel($id);

		if ($model->load($_POST) && $model->save()) {
            return $this->redirect(Url::previous());
		} else {
			return $this->render('update', [
				'model' => $model,
			]);
		}
	}

	/**
	 * Deletes an existing VidmageTag model.
	 * If deletion is successful, the browser will be redirected to the 'index' page.
	 * @param integer $id
	 * @return mixed
	 */
	public function actionDelete($id)
	{
        try {
            $this->findModel($id)->delete();
        } catch (\Exception $e) {
            $msg = (isset($e->errorInfo[2]))?$e->errorInfo[2]:$e->getMessage();
            \Yii::$app->getSession()->setFlash('error', $msg);
            return $this->redirect(Url::previous());
        }

        // TODO: improve detection
        $isPivot = strstr('$id',',');
        if ($isPivot == true) {
            return $this->redirect(Url::previous());
        } elseif (isset(\Yii::$app->session['__crudReturnUrl']) && \Yii::$app->session['__crudReturnUrl'] != '/') {
			Url::remember(null);
			$url = \Yii::$app->session['__crudReturnUrl'];
			\Yii::$app->session['__crudReturnUrl'] = null;

			return $this->redirect($url);
        } else {
            return $this->redirect(['index']);
        }
	}

	/**
	 * Finds the VidmageTag model based on its primary key value.
	 * If the model is not found, a 404 HTTP exception will be thrown.
	 * @param integer $id
	 * @return VidmageTag the loaded model
	 * @throws HttpException if the model cannot be found
	 */
	protected function findModel($id)
	{
		if (($model = VidmageTag::findOne($id)) !== null) {
			return $model;
		} else {
			throw new HttpException(404, 'The requested page does not exist.');
		}
	}
}


text:
package org.apache.camel.component.stub;

import org.apache.camel.Processor;
import org.apache.camel.component.vm.VmConsumer;
import org.apache.camel.component.vm.VmEndpoint;

public class StubConsumer extends VmConsumer {

    public StubConsumer(VmEndpoint endpoint, Processor processor) {
        super(endpoint, processor);
    }

}


text:
/* global describe, it, beforeEach, afterEach */
/*!
 * The MIT License (MIT)
 *
 * Copyright (c) 2019 Mark van Seventer
 *
 * 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.
 */

// @see https://sharp.dimens.io/api-operation#recomb

// Strict mode.
'use strict'

// Package modules.
const expect = require('must')
const sinon = require('sinon')
const Yargs = require('yargs')

// Local modules.
const recomb = require('../../../cmd/operations/recomb')
const queue = require('../../../lib/queue')
const sharp = require('../../mocks/sharp')

// Test suite.
describe('recomb', () => {
  const cli = (new Yargs()).command(recomb)

  // Default matrix.
  const matrix = '0.3588 0.7044 0.1368 0.2990 0.5870 0.1140 0.2392 0.4696 0.0912'

  // Reset.
  afterEach('queue', () => queue.splice(0))
  afterEach('sharp', sharp.prototype.reset)

  describe('<matrix>', () => {
    // Run.
    beforeEach((done) => cli.parse(['recomb', matrix], done))

    // Tests.
    it('must set the matrix flag', () => {
      expect(cli.parsed.argv).to.have.property('matrix', matrix)
    })
    it('must update the pipeline', () => {
      expect(queue.pipeline).to.have.length(1)
      expect(queue.pipeline).to.include('recomb')
    })
    it('must execute the pipeline', () => {
      const arg = matrix.split(' ').map((el) => parseFloat(el))
      const pipeline = queue.drain(sharp())
      sinon.assert.calledWithMatch(pipeline.recomb, [
        arg.slice(0, 3),
        arg.slice(3, 6),
        arg.slice(6, 9)
      ])
    })
  })
})


text:
<!doctype html>

  <link rel="stylesheet" href="/materialize.min.css"  media="screen,projection"/>

      Ristorante

Gestione Categorie

Gestione Piatti

Gestione Comande

Comande

Scegli tavolo: <select id="n-tavolo"></select>


text:
/**
 * @author Selivanov Max <max@evildevel.com>
 *
 * Dependencies:
 * jquery.json (https://github.com/krinkle/jquery-json)
 *
 */

(function($) {
    var methods = {
        init: function(options) {
            $target_rules = $(this);

            var settings = $.extend( {
                'rules': $.evalJSON($(this).val()),
                'debug': false
            }, options);

            $('
', {
                'id': 'trigger_rules_editor',
            }).insertAfter(this);

            $('
', {
                'class': 'trigger_children',
            }).appendTo($('#trigger_rules_editor'));

            methods.render_rules(settings.rules, $('.trigger_children'));
            methods.checkblock();
            return this;
        },
        render_value: function(trigger_rule) { // .trigger_rule
            var value = {
                'logic': $('> table > tbody > tr > .trigger_logic_holder > .trigger_logic > select', trigger_rule).val()
            };

            var trigger_rule_item = $('> table > tbody > tr > .trigger_holder > .trigger_rules > .trigger_rule_item', trigger_rule);
            var trigger_children_rule = $('> table > tbody > tr > .trigger_holder > .trigger_children > .trigger_rule', trigger_rule);

            if (trigger_rule_item.length) {
                value.rules = [];

                trigger_rule_item.each(function() {
                    var method = $(this).data('method');
                    var settings = new Object();

                    $('.trigger_settings input, .trigger_settings select', this).each(function() {
                        id = $(this).data('id');
                        param_value = $(this).val();

                        if (param_value) {
                            switch(method) {
                                case 'name':
                                    switch(id) {
                                        case 'logic':
                                            if (settings.logic === undefined) settings.logic = new Object();
                                            settings.logic = param_value;
                                            break;
                                        case 'value':
                                            if (settings.value === undefined) settings.value = new Object();
                                            settings.value = param_value;
                                            break;
                                        default: settings[id] = param_value;
                                    }
                                    break;
                                default: settings[id] = param_value;
                            }
                        }
                    });

                    value.rules.push({
                        'method': method,
                        'settings': settings
                    });
                });
            }

            if (trigger_children_rule.length) {
                value.children = methods.render_value(trigger_children_rule);
            }

            return value;
        },
        add_trigger_rule: function() {
            var trigger_rule = $(this).closest('.trigger_rule');
            var trigger_logic = $(this).data('logic');
            var trigger_method = $(this).data('method');

            if (trigger_logic === $('> table > tbody > tr > .trigger_logic_holder > .trigger_logic > select', trigger_rule).val()) {
                methods.render_rule({
                    'method': trigger_method,
                    'settings': new Object()
                }, $('> table > tbody > tr > .trigger_holder > .trigger_rules', trigger_rule));
            } else {
                var trigger_children = $(trigger_rule).closest('.trigger_children');

                trigger_rule.remove();

                methods.render_rules({
                    'logic': trigger_logic,
                    'rules': [{
                        method: trigger_method,
                        'settings': new Object()
                    }],
                    'children': methods.render_value(trigger_rule)
                }, trigger_children);
            }

            $('select', trigger_rule).selectpicker();
            $target_rules.val($.toJSON(methods.render_value($('#trigger_rules_editor > .trigger_children > .trigger_rule'))));
            methods.checkblock();
            methods.check_editor();
        },
        remove_trigger_rule: function() {
            $(this).parent().parent().remove();
            $(this).siblings('.trigger_rule_item').remove();
            $target_rules.val($.toJSON(methods.render_value($('#trigger_rules_editor > .trigger_children > .trigger_rule'))));
            methods.checkblock();
            methods.check_editor();
        },
        checkblock: function() {
            var value = $target_rules.val();
            var obj = JSON.parse(value);

            if (obj.rules === undefined || obj.rules.length == 1) {
                $('.trigger_logic_holder').css('width', '0');
                $('.trigger_logic_holder', $trigger_rule).hide();
            } else if (obj.rules && obj.rules.length > 1) {
                $('.trigger_logic_holder').css('width', '100px');
                $('.trigger_logic_holder', $trigger_rule).show();
            }
        },
        getRulesListByLogic: function(logic) {
            return [
                '
Name
'
            ].join('');
        },
        render_rules: function(rules, holder) {
            var self = this;

            $trigger_rule = $('
', {
                'class': 'trigger_rule'
            }).appendTo(holder);

            $trigger_rule.append([
                '',
                '
',
                    '
',
                        '',
                            '
',
                                '<select class="selectpicker" data-width="85px">',
                                    '<option value="intersect">AND</option>',
                                    '<option value="merge">OR</option>',
                                '</select>',
                            '
',
                        '	',
                        '',
                            '

',
                            '

',
                            '
',
                                '
',
                                    '<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">AND</button>',
                                    '
',
                                        self.getRulesListByLogic('intersect'),
                                    '
',
                                '
',
                                '
',
                                    '<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">OR</button>',
                                    '
',
                                        self.getRulesListByLogic('merge'),
                                    '
',
                                '
',
                            '
',
                            '
',
                                '
',
                                    '<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">Add condition</button>',
                                    '
',
                                        self.getRulesListByLogic('intersect'),
                                    '
',
                                '
',
                            '
',
                        '	',
                    '
',
                '
'
            ].join(''));
            $('.trigger_holder .remove_trigger_rule').show();

            $('.add_trigger_rule', $trigger_rule).on('click', methods.add_trigger_rule);

            $('.trigger_logic select', $trigger_rule).val(rules.logic).on('change', function(){$target_rules.val($.toJSON(methods.render_value($('#trigger_rules_editor > .trigger_children > .trigger_rule'))))});
            $('.remove_trigger_rule').on('click', methods.remove_trigger_rule);

            if (rules.rules !== undefined) {
                $.each(rules.rules, function(index, rule) {
                    methods.render_rule(rule, $('.trigger_rules', $trigger_rule));
                });
            }

            if (rules.children !== undefined) {
                methods.render_rules(rules.children, $('.trigger_children', $trigger_rule));
            }

            $('.selectpicker').selectpicker();

            methods.check_editor();
        },
        check_editor: function() {
            $('.trigger_children').each(function (i, item) {
                var child_numbers = 0;
                $item = $(item);
                child_numbers += $item.find('.trigger_holder').first().find('.trigger_rules > div').length;
                child_numbers += $item.find('.trigger_holder').first().find('.trigger_children > div').length;
                if (child_numbers < 2) {
                    $(item).find('.trigger_logic').hide();
                    $(item).find('.trigger_logic_holder').hide();
                    $(item).find('.trigger_holder_controls_single').show();
                    $(item).find('.trigger_holder_controls_several').hide();
                } else {
                    $(item).find('.trigger_logic').show();
                    $(item).find('.trigger_logic_holder').show();
                    $(item).find('.trigger_holder_controls_single').hide();
                    $(item).find('.trigger_holder_controls_several').show();
                }
            })
        },
        render_rule: function(rule, holder) {
            var elid = Math.floor(Math.random( ) * (999999+1));

            $trigger_rule_item = $('
', {
                'class': 'trigger_rule_item',
                'data-method': rule.method
            }).appendTo(holder);

            $trigger_rule_item.append([
                '
',
                    '',
                '
'
            ].join(''));

            $('.remove_rule_item').on('click', methods.remove_trigger_rule);

            switch(rule.method) {

                case 'name':
                    $('.trigger_settings', $trigger_rule_item).append([
                        '
',
                            '
Name
',
                            '
',
                                '',
                                    '<select class="selectpicker" data-id="logic">',
                                        '<option value="=">equal</option>',
                                        '<option value="!=">not equal</option>',
                                        '<option value="IN">in</option>',
                                        '<optgroup label="mask">',
                                            '<option value="LIKE">equal</option>',
                                            '<option value="NOT LIKE">not equal</option>',
                                        '</optgroup>',
                                        '<optgroup label="regexp">',
                                            '<option value="REGEXP">equal</option>',
                                            '<option value="NOT REGEXP">not equal</option>',
                                        '</optgroup>',
                                    '</select>',
                                '	',
                                '',
                                    '<input data-id="value" class="form-control m-l-5" type="text">',
                                '	',
                            '
',
                        '
'
                    ].join(''));

                    if (rule.settings.logic !== undefined) $('.trigger_settings select[data-id="logic"]', $trigger_rule_item).val(rule.settings.logic);
                    $('.trigger_settings select[data-id="logic"]', $trigger_rule_item).on('change', function(){$target_rules.val($.toJSON(methods.render_value($('#trigger_rules_editor > .trigger_children > .trigger_rule'))))});

                    if (rule.settings.value !== undefined) $('.trigger_settings input[data-id="value"]', $trigger_rule_item).val(rule.settings.value);
                    $('.trigger_settings input[data-id="value"]', $trigger_rule_item).on('input propertychange paste', function(){$target_rules.val($.toJSON(methods.render_value($('#trigger_rules_editor > .trigger_children > .trigger_rule'))))});

                    break;
            }
        }
    };

    $.fn.RefRulesEditor = function(method) {
        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || ! method) {
            return methods.init.apply(this, arguments);
        } else {
            $.error('RefRulesEditor: Unknown method: ' +  method);
        }
    };
})(jQuery);


text:
---
external help file: Microsoft.Azure.Commands.Compute.dll-Help.xml
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.compute/set-azurermdiskupdatediskencryptionkey
schema: 2.0.0
---

# Set-AzureRmDiskUpdateDiskEncryptionKey

## SYNOPSIS
Sets the disk encryption key properties on on a disk update object.

## SYNTAX

```
Set-AzureRmDiskUpdateDiskEncryptionKey [-DiskUpdate] <PSDiskUpdate> [[-SecretUrl] <String>]
 [[-SourceVaultId] <String>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

## DESCRIPTION
The **Set-AzureRmDiskUpdateDiskEncryptionKey** cmdlet sets the disk encryption key properties on on a disk update object.

## EXAMPLES

### Example 1
```
PS C:\> $diskupdateconfig = New-AzureRmDiskUpdateConfig -DiskSizeGB 10 -AccountType PremiumLRS -OsType Windows -CreateOption Empty -EncryptionSettingsEnabled $true;
PS C:\> $secretUrl = https://myvault.vault-int.azure-int.net/secrets/123/;
PS C:\> $secretId = '/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.KeyVault/vaults/TestVault123';
PS C:\> $keyUrl = https://myvault.vault-int.azure-int.net/keys/456;
PS C:\> $keyId = '/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.KeyVault/vaults/TestVault456';
PS C:\> $diskupdateconfig = Set-AzureRmDiskUpdateDiskEncryptionKey -DiskUpdate $diskupdateconfig -SecretUrl $secretUrl -SourceVaultId $secretId;
PS C:\> $diskupdateconfig = Set-AzureRmDiskUpdateKeyEncryptionKey -DiskUpdate $diskupdateconfig -KeyUrl $keyUrl -SourceVaultId $keyId;
PS C:\> Update-AzureRmDisk -ResourceGroupName 'ResourceGroup01' -DiskName 'Disk01' -DiskUpdate $diskupdateconfig;
```

The first command creates a local empty disk update object with size 10GB in Premium_LRS storage account type.  It also sets Windows OS type and enables encryption settings.
The second and third commands set the disk encryption key and key encryption key settings for the disk update object.
The last command takes the disk update object and updates an existing disk with name 'Disk01' in resource group 'ResourceGroup01'.

## PARAMETERS

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.

```yaml
Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DiskUpdate
Specifies a local disk update object.

```yaml
Type: PSDiskUpdate
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```

### -SecretUrl
Specifies the secret Url.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -SourceVaultId
Specifies the source vault ID.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### Microsoft.Azure.Management.Compute.Models.DiskUpdate
System.String

## OUTPUTS

### Microsoft.Azure.Management.Compute.Models.DiskUpdate

## NOTES

## RELATED LINKS


text:
build:
	mkdir bin
	go build -o ./bin/client client/client.go
	go build -o ./bin/tracker tracker/tracker.go

clean:
	rm -rf bin


text:
package org.dswarm.controller.eventbus;

import org.dswarm.persistence.model.resource.Configuration;
import org.dswarm.persistence.model.resource.Resource;

public class XMLSchemaEvent {

	private final Configuration	configuration;
	private final Resource		resource;

	public XMLSchemaEvent(final Configuration configuration, final Resource resource) {
		this.configuration = configuration;
		this.resource = resource;
	}

	public Configuration getConfiguration() {
		return configuration;
	}

	public Resource getResource() {
		return resource;
	}
}


text:
/**
 * Module dependencies.
 */
var session = require('express-session'),
    compression = require('compression'),
    morgan = require('morgan'),
    cookieParser = require('cookie-parser'),
    bodyParser = require('body-parser'),
    methodOverride = require('method-override'),
    mongoStore = require('connect-mongo')(session),
    helpers = require('view-helpers'),
    config = require('./config'),
    env = process.env.NODE_ENV || 'development';

module.exports = function(app, passport, db) {
  app.set('showStackError', env !== 'production');

  app.use(compression({
    filter: function(req, res) {
      return (/json|text|javascript|css/).test(res.getHeader('Content-Type'));
    },
    level: 9
  }));

  //Don't use logger for test env
  if (process.env.NODE_ENV !== 'test') {
    app.use(morgan('dev'));
  }

  //Set views path, template engine and default layout
  app.set('views', config.root + '/server/views');
  app.engine('html', require('hbs').__express);
  app.set('view engine', 'html');

  //Enable jsonp
  app.enable("jsonp callback");

  //cookieParser should be above session
  app.use(cookieParser());

  app.use(function(req, res, next) {
    res.setHeader('Access-Control-Allow-Origin', config.accessControlAllowOrigin);
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
    res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
    res.setHeader('Access-Control-Allow-Credentials', true);
    next();
  });

  //bodyParser should be above methodOverride
  app.use(bodyParser());
  app.use(methodOverride());

  //express/mongo session storage
  app.use(session({
    secret: config.session,
    store: new mongoStore({
      db: db.connection.db,
      collection: 'sessions'
    })
  }));

  //dynamic helpers
  app.use(helpers(config.app.name));

  //use passport session
  app.use(passport.initialize());
  app.use(passport.session());
};


text:
			+

			Документи

			?
			<select ng-model="document.type"
				ng-change="autoSave.fn_change_count()">
				<option
					ng-repeat="(k,v) in mvpAddress.config.selectDictionary('DOCUMENT_TYPE').values"
					value="{{k}}">{{v}}</option>
			</select>

			№
			<input ng-change="autoSave.fn_change_count()"
				placeholder="Номер документа" class="w3-border"
				ng-model="document.number">
			-
			+
			^


text:
package org.odlabs.wiquery.core.events;

/**
 * $Id$
 * <p>
 * Defines standard keyboard events.
 * </p>
 *
 * @author Lionel Armanet
 * @since 0.5
 */
public enum KeyboardEvent implements EventLabel
{

	/**
	 * Defines possible values for keyboard events.
	 */
	KEYDOWN,
	KEYPRESS,
	KEYUP;

	public String getEventLabel()
	{
		return this.name().toLowerCase();
	}

}


text:
<?hh // strict

namespace Facebook\HackCodegen;

/**
 * This class contains the default configuration for Hack code generation.
 * Please update it to your needs.
 * Notice that if you need, you can have more than 1 configuration,
 * and you'll need to explicitly pass an instance to the constructor
 * of some of the classes, e.g. HackBuilder.
 */
final class HackCodegenConfig implements IHackCodegenConfig {

  <<__Memoize>>
  public static function getInstance(): this {
    return new static();
  }

  public function getFileHeader(): ?Vector<string> {
    // If you want a header on each generated file, insert it here.
    return null;
  }

  public function getSpacesPerIndentation(): int {
    return 2;
  }

  public function getMaxLineLength(): int {
    return 80;
  }

  public function getRootDir(): string {
    return __DIR__;
  }
}


text:
nav_title: Access by Proxy and VPN
post_title: Access by Proxy and VPN using DC/OS Tunnel
menu_order: 10
---

When developing services on DC/OS, you may find it helpful to access your cluster from your local machine via SOCKS proxy, HTTP proxy, or VPN. For instance, you can work from your own development environment and immediately test against your DC/OS cluster.

**Warning:** DC/OS Tunnel is appropriate for development, debugging, and testing only. Do not use DC/OS Tunnel in production.

# SOCKS
DC/OS Tunnel can run a SOCKS proxy over SSH to the cluster. SOCKS proxies work for any protocol, but your client must be configured to use the proxy, which runs on port 1080 by default.

# HTTP

The HTTP proxy can run in two modes: transparent and standard.

##  Transparent Mode
In transparent mode, the HTTP proxy runs as superuser on port 80 and does not require modification to your application. Access URLs by appending the `mydcos.directory` domain. You can also [use DNS SRV records as if they were URLs](#srv). The HTTP proxy cannot currently access HTTPS in transparent mode.

## Standard Mode
Though you must configure your client to use the HTTP proxy in standard mode, it does not have any of the limitations of transparent mode. As in transparent mode, you can use [DNS SRV](#srv) records as URLs.

### SRV Records
A SRV DNS record is a mapping from a name to a IP/port pair. DC/OS creates SRV records in the form `_<port-name>._<service-name>._tcp.marathon.mesos`. The HTTP proxy exposes these as URLs. This feature can be useful for communicating with DC/OS services.

# VPN
DC/OS Tunnel provides you with full access to the DNS, masters, and agents from within the cluster. OpenVPN requires root privileges to configure these routes.

# DC/OS Tunnel Options at a Glance

    Pros
    Cons

    SOCKS

Specify ports

All protocols

Requires application configuration

      HTTP (transparent)

SRV as URL

No application configuration

Cannot specify ports (except through SRV)

Only supports HTTP

Runs as superuser

          HTTP (standard)

SRV as URL

Specify ports

Requires application configuration

Only supports HTTP/HTTPS

               VPN

No application configuration

Full and direct access to cluster

Specify ports

All protocols

More prerequisites

Runs as superuser

May need to manually reconfigure DNS

Relatively heavyweight

# Using DC/OS Tunnel

## Prerequisites
* Only Linux and macOS are currently supported.
* The [DC/OS CLI](/docs/1.8/usage/cli/install/).
* The DC/OS Tunnel package. Run `dcos package install tunnel-cli --cli`.
* [SSH access](/docs/1.8/administration/access-node/sshcluster/) (key authentication only).
* [The OpenVPN client](https://openvpn.net/index.php/open-source/downloads.html) for VPN functionality.

## Example Application

All examples will refer to this sample application:
* Service Name: `myapp`
* Group: `mygroup`
* Port: `555`
 * Port Name: `myport`

`myapp` is a web server listening on port `555`. We'll be using `curl`
as our client application. Each successful example will result in the HTML
served by `myapp` to be output output as text.

##  Using DC/OS Tunnel to run a SOCKS Proxy
1. Run the following command from the DC/OS CLI:

    ```
    dcos tunnel socks

    ## Example
    curl --proxy socks5h://127.0.0.1:1080 myapp-mygroup.marathon.agentip.dcos.thisdcos.directory:555
    ```

1. Configure your application to use the proxy on port 1080.

##  Using DC/OS Tunnel to run a HTTP Proxy
### Transparent Mode

1. Run the following command from the DC/OS CLI:

    ```
    sudo dcos tunnel http

    ## Example
    curl _myport._myapp.mygroup._tcp.marathon.mesos.mydcos.directory

    ### Watch out!
    ## This won't work because you can't specify a port in transparent mode
    curl myapp-mygroup.marathon.agentip.dcos.thisdcos.directory.mydcos.directory:555
    ```

1. In transparent mode, the HTTP proxy works by port forwarding. Append `.mydcos.directory` to the end of your domain when you enter commands. For instance, `http://example.com/?query=hello` becomes `http://example.com.mydcos.directory/?query=hello`. **Note:** In transparent mode, you cannot specify a port in a URL.

### Standard mode
1. To run the HTTP proxy in standard mode, without root privileges, use the `--port` flag to configure it to use another port:

    ```
    dcos tunnel http --port 8000

    ## Example
    curl --proxy 127.0.0.1:8000 _myport._myapp.mygroup._tcp.marathon.mesos
    curl --proxy 127.0.0.1:8000 myapp-mygroup.marathon.agentip.dcos.thisdcos.directory:555
    ```

1. Configure your application to use the proxy on the port you specified above.

### SRV Records
The HTTP proxy exposes DC/OS SRV records as URLs in the form `_<port-name>._<service-name>._tcp.marathon.mesos.mydcos.directory` (transparent mode) or `_<port-name>._<service-name>._tcp.marathon.mesos` (standard mode).

#### Find your Service Name
The `<service-name>` is the entry in the **ID** field of a service you create from the DC/OS web interface or the value of the `id` field in your Marathon application definition.

#### Add a Named Port from the DC/OS Web Interface
To name a port from the DC/OS web interface, go to the **Services** tab, click the name of your service, and then click **Edit**. Enter a name for your port on the **Network** tab.

#### Add a Named Port in a Marathon Application Definition
Alternatively, you can add `name` to the `portMappings` or `portDefinitions` field of a Marathon application definition. Whether you use `portMappings` or `portDefinitions` depends on whether you are using `BRIDGE` or `HOST` networking. [Learn more about networking and ports in Marathon](/docs/1.8/usage/managing-services/service-ports/).

```json
"portMappings": [
    {
        "name": "<my-port-name>",
        "containerPort": 3000,
        "hostPort": 0,
        "servicePort": 10000,
        "labels": {
             "VIP_0": "1.1.1.1:30000"
        }
    }
]
```

```json
"portDefinitions": [
    {
      "name": "<my-port-name>",
      "protocol": "tcp",
      "port": 0,
    }
  ]
```

##  Using DC/OS Tunnel to run a VPN
Run the following command from the DC/OS CLI

```
sudo dcos tunnel vpn

## Example
curl myapp-mygroup.marathon.agentip.dcos.thisdcos.directory:555
```

The VPN client attempts to auto-configure DNS, but this functionality does not work on macOS. To use the VPN client on macOS, [add the DNS servers](https://support.apple.com/kb/PH18499?locale=en_US) that DC/OS Tunnel instructs you to use.

When you use the VPN, you are virtually within your cluster. You can access
your master and agent nodes directly:

```
ping master.mesos
ping slave.mesos
```

### macOS OpenVPN Client Installation
* If using [homebrew](http://brew.sh/) then install with:
    ```
    brew install openvpn
    ```
    Then to use it:

    Either add `/usr/local/sbin` to your `$PATH`,

    or add the flag `--client=/usr/local/sbin/openvpn` like so:
    ```
    sudo dcos tunnel vpn --client=/usr/local/sbin/openvpn
    ```

* Another option is to install [TunnelBlick](https://tunnelblick.net/)
    (_don't run it_, we are only installing it for the `openvpn` executable)
    and add the flag `--client=/Applications/Tunnelblick.app/Contents/Resources/openvpn/openvpn-*/openvpn` like so:
    ```
    sudo dcos tunnel vpn --client=/Applications/Tunnelblick.app/Contents/Resources/openvpn/openvpn-*/openvpn
    ```

### Linux OpenVPN Client Installation
`openvpn` should be available via your distribution's package manager.

For example:
* Ubuntu: `apt-get update && apt-get install openvpn`
* ArchLinux: `pacman -S openvpn`


text:
require "spec_helper"

describe Runner::TaskHandler do
  before do
    @task_handler = Runner::TaskHandler.new
  end

  it "should have a backend" do
    Runner::TaskHandler.backend.should_not eq nil
  end

  it "should have a serializer" do
    Runner::TaskHandler.serializer.should_not eq nil
  end

  it "should be able to guess a backend" do
    Runner::TaskHandler.guess_backend.should_not eq nil
  end

  it "should be able to load a serializer" do
    Runner::TaskHandler.load_serializer.should_not eq nil
  end

  it "should have a logger" do
    Runner::TaskHandler.logger.should_not eq nil
  end

  context "when preloaded with a Task" do
    before do
      @task_handler.task = Runner::Task.new
    end

    it "should always run with the task given when started" do
      @task_handler.stub!(:run_with_single_task).and_return true
      @task_handler.should_receive :run_with_single_task
      @task_handler.start
    end

    context "when a task is runned" do
      context "and when it fails to do so" do
        it "should be handled properly" do
          @task_handler.should_receive :handle_failed_task
          @task_handler.stub!(:handle_failed_task).and_return(true)

          @task = Runner::Task.new
          @task.stub!(:invoke_task) {raise "an error"}

          @task_handler.run(@task)
        end
      end
    end
  end

  it "should have a default name" do
    @task_handler.name.should_not be nil
  end

  context "when name changes" do
    context "with a resolvable hostname" do
      it "to nil it should reset to default" do
        Socket.stub!(:gethostname).and_return "localhost"
        @task_handler.name = nil
        @task_handler.name.should =~ /pid:(.*) host:(.*)/
      end
    end

    context "with an error thrown in Socket" do
      it "should reset to default" do
        Socket.stub!(:gethostname) {raise}

        @task_handler.name = nil
        @task_handler.name.should =~ /pid:(.*)/
      end
    end

    it "to 'my new name' it should not reset to default" do
      @task_handler.name = "my new name"
      @task_handler.name.should eq "my new name"
    end
  end

  context "when no specific task is given" do
    it "should handle the default amount of tasks" do
      5.times {Customer.queue.class_method}
      required = Runner::Backend::ActiveRecord::Task.available(5.hours).count - Runner.task_limit
      task_handler = Runner::TaskHandler.new
      task_handler.start
      sleep 2
      Runner::Backend::ActiveRecord::Task.available(5.hours).should have_at_most(required).items
    end
  end
end


text:
/*
* An ordered collection backed by an Array.
* List has access to all Sequence and Iterable methods.
* List can be seen as a richer Array.
*/
var List = createType('List', Sequence);

List.fromArray = function(array) {
	return List.apply(null, array);
};

List.prototype._init = function() {
	this.items = cloneArray(arguments);
};

/*
* Appends the item at the last position of this list.
*/
List.prototype.add = function(item) {
	this.items.push(item);
	return this;
};

/*
* Adds the item at a specific index.
*/
List.prototype.addAt = function(item, index) {
	this._assertRange(index);
	this.items.splice(index, 0, item);
	return this;
};

/*
* Replaces the item at the given index with a new value.
*/
List.prototype.update = function(index, item) {
	this._assertRange(index);
	var previousItem = this.items[index];
	if (previousItem !== item) {
		this.items[index] = item;
	}
	return this;
};

/*
* Removes the item from this list.
*/
List.prototype.remove = function(item) {
	var index = this.indexOf(item);
	if (index > -1) {
		return this.items.splice(index, 1)[0];
	}
	return false;
};

/*
* Removes and returns the item located at the specified index.
*/
List.prototype.removeAt = function(index) {
	var item = this.items.splice(index, 1)[0];
	return item;
};

/*
* Removes the first item from this list.
* This is a mutating equivalent of Iterable's drop(1).
*/
List.prototype.removeFirst = function() {
	return this.removeAt(0);
};

/*
* Removes the last item from this list.
* This is a mutating equivalent of Iterable's dropRight(1).
*/
List.prototype.removeLast = function() {
	return this.removeAt(this.items.length - 1);
};

/*
* Removes all items from this list.
*/
List.prototype.removeAll = function() {
	var size = this.size();
	if (size > 0) {
		this.items.splice(0, size);
	}
	return this;
};

/*
* Removes all items satisfying a predicate from this list.
* Returns the List of removed items.
* This is a mutating, reversed equivalent of Iterable's filter.
*/
List.prototype.removeIf = function(predicate) {
	var removed = [];
	for (var i=0, length=this.items.length; i < length; i++) {
		if (predicate(this.items[i])) {
			removed.push(this.items[i]);
			this.items.splice(i, 1);
			i--;
		}
	}
	return List.fromArray(removed);
};

/*
* Converts this list to a Set.
*/
List.prototype.toSet = function() {
	return Set.fromArray(this.items);
};

List.prototype._assertRange = function(index) {
	if (index < 0 || index > this.size()) {
		throw new Error('Illegal insertion at index ' + index + ' in List with size ' + (this.size() - 1));
	}
};

/*
* Returns a list of integers from start to stop (inclusive),
* incremented or decremented by step.
*
* You can also use the shortcut range(n) which returns the list
* of the n first integers, starting from 0.
*/
var range = function(start, stop, step) {
   if (arguments.length == 1) {
   	stop = arguments[0] - 1;
   	start = 0;
   }
   step = step || 1;

   var items = [];
   var next = start;
   var increasing = (step > 0);

   while ((increasing && next <= stop) || (!increasing && next >= stop)) {
      items.push(next);
      next = next + step;
   }

   var range = List.fromArray(items);

   // Override Sequence's contains with a O(1) alternative
   // when using 'continuous' int ranges.
   if (step == 1)
       range.contains = function(item) {
	       return isNumber(item) && item >= start && item <= stop;
       };

   return range;
};

Collection.range = range;
Collection.List = List;


text:
package com.technicat.microarcade.tictactoe;

import com.technicat.microarcade.*;
import com.technicat.boardgame.*;
import com.technicat.tictactoe.*;

public class TicTacToeMidlet extends BoardGameMidlet {

    protected BoardCanvas createBoard(BoardGame game) {
	return new TicTacToeBoard(game);
    }

    protected BoardGame createGame() {
	return new TicTacToe();
    }

    protected BoardPlayer createPlayer0(int type) {
	switch (type) {
	case DEMO:
	    return new MinMaxPlayer("X",getGame(),BoardGame.PLAYER0,9);
	default:
	    return new HumanPlayer("X",this,BoardGame.PLAYER0);
	}
    }

    protected BoardPlayer createPlayer1(int type) {
	switch (type) {
	case DEMO:
	    return new MinMaxPlayer("O",getGame(),BoardGame.PLAYER1,3);
	case TWO_PLAYER:
	    return new HumanPlayer("O",this,BoardGame.PLAYER1);
	case EASY:
	    return new MinMaxPlayer("O",getGame(),BoardGame.PLAYER1,3);
	case HARD:
	    return new MinMaxPlayer("O",getGame(),BoardGame.PLAYER1,9);
	}
	return null;
    }
}


text:
<?  defined('C5_EXECUTE') or die("Access Denied.");

class Concrete5_Model_StartingPointPackage extends Package {

	protected $DIR_PACKAGES_CORE = DIR_STARTING_POINT_PACKAGES_CORE;
	protected $DIR_PACKAGES = DIR_STARTING_POINT_PACKAGES;
	protected $REL_DIR_PACKAGES_CORE = REL_DIR_STARTING_POINT_PACKAGES_CORE;
	protected $REL_DIR_PACKAGES = REL_DIR_STARTING_POINT_PACKAGES;

	protected $routines = array();

	public function getInstallRoutines() {
		return $this->routines;
	}

	// default routines

	public function __construct() {
		Loader::library('content/importer');
		$this->routines = array(
		new StartingPointInstallRoutine('make_directories', 5, t('Starting installation and creating directories.')),
		new StartingPointInstallRoutine('install_database', 10, t('Creating database tables.')),
		new StartingPointInstallRoutine('add_users', 15, t('Adding admin user.')),
		new StartingPointInstallRoutine('install_permissions', 20, t('Installing permissions & workflow.')),
		new StartingPointInstallRoutine('add_home_page', 23, t('Creating home page.')),
		new StartingPointInstallRoutine('install_attributes', 25, t('Installing attributes.')),
		new StartingPointInstallRoutine('install_blocktypes', 30, t('Adding block types.')),
		new StartingPointInstallRoutine('install_themes', 35, t('Adding themes.')),
		new StartingPointInstallRoutine('install_jobs', 38, t('Installing automated jobs.')),
		new StartingPointInstallRoutine('install_dashboard', 40, t('Installing dashboard.')),
		new StartingPointInstallRoutine('install_required_single_pages', 50, t('Installing login and registration pages.')),
		new StartingPointInstallRoutine('install_config', 55, t('Configuring site.')),
		new StartingPointInstallRoutine('import_files', 58, t('Importing files.')),
		new StartingPointInstallRoutine('install_content', 65, t('Adding pages and content.')),
		new StartingPointInstallRoutine('set_site_permissions', 80, t('Setting up site permissions.')),
		new StartingPointInstallRoutine('precache', 85, t('Prefetching information.')),
		new StartingPointInstallRoutine('finish', 95, t('Finishing.'))
		);
	}

	public function add_home_page() {
		Page::addHomePage();
	}

	public function precache() {
		$c = Page::getByPath('/dashboard/home');
		$blocks = $c->getBlocks();
		foreach($blocks as $b) {
			$bi = $b->getInstance();
			$bi->setupAndRun('view');
		}
		Loader::helper('concrete/interface')->cacheInterfaceItems();
	}

	public function install_attributes() {
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/attributes.xml');
	}

	public function install_dashboard() {
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/dashboard.xml');
	}

	public function install_required_single_pages() {
		Loader::model('single_page');
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/login_registration.xml');
	}

	public function install_blocktypes() {
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/blocktypes.xml');
	}

	public function install_themes() {
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/themes.xml');
	}

	public function install_jobs() {
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/jobs.xml');
	}

	public function install_config() {
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/config.xml');
	}

	public function import_files() {
		if (is_dir($this->getPackagePath() . '/files')) {
			Loader::library('file/importer');
			$fh = new FileImporter();
			$contents = Loader::helper('file')->getDirectoryContents($this->getPackagePath() . '/files');

			foreach($contents as $filename) {
				$f = $fh->import($this->getPackagePath() . '/files/' . $filename, $filename);
			}
		}
	}

	public function install_content() {
		Loader::library('content/importer');
		$installDirectory = DIR_BASE_CORE . '/config';
		$ci = new ContentImporter();
		$ci->importContentFile($this->getPackagePath() . '/content.xml');

	}

	public function install_database() {
		$db = Loader::db();
		$installDirectory = DIR_BASE_CORE. '/config';
		try {
			Database::ensureEncoding();
			Package::installDB($installDirectory . '/db.xml');
		} catch (Exception $e) {
			throw new Exception(t('Unable to install database: %s', $db->ErrorMsg()));
		}
	}

	public function add_users() {
		// insert the default groups
		// create the groups our site users
		// specify the ID's since auto increment may not always be +1
		$g1 = Group::add(tc("GroupName", "Guest"), tc("GroupDescription", "The guest group represents unregistered visitors to your site."), GUEST_GROUP_ID);
		$g2 = Group::add(tc("GroupName", "Registered Users"), tc("GroupDescription", "The registered users group represents all user accounts."), REGISTERED_GROUP_ID);
		$g3 = Group::add(tc("GroupName", "Administrators"), "", ADMIN_GROUP_ID);

		// insert admin user into the user table
		if (defined('INSTALL_USER_PASSWORD')) {
			Loader::library('3rdparty/phpass/PasswordHash');
			$hasher = new PasswordHash(PASSWORD_HASH_COST_LOG2, PASSWORD_HASH_PORTABLE);
			$uPassword = INSTALL_USER_PASSWORD;
			$uPasswordEncrypted = $hasher->HashPassword($uPassword);
		} else {
			$uPasswordEncrypted = INSTALL_USER_PASSWORD_HASH;
		}
		$uEmail = INSTALL_USER_EMAIL;
		UserInfo::addSuperUser($uPasswordEncrypted, $uEmail);
		$u = User::getByUserID(USER_SUPER_ID, true, false);

		Loader::library('mail/importer');
		MailImporter::add(array('miHandle' => 'private_message'));
	}

	public function make_directories() {
		Cache::flush();

		if (!is_dir(DIR_FILES_UPLOADED_THUMBNAILS)) {
			mkdir(DIR_FILES_UPLOADED_THUMBNAILS, DIRECTORY_PERMISSIONS_MODE);
			chmod(DIR_FILES_UPLOADED_THUMBNAILS, DIRECTORY_PERMISSIONS_MODE);
		}
		if (!is_dir(DIR_FILES_INCOMING)) {
			mkdir(DIR_FILES_INCOMING, DIRECTORY_PERMISSIONS_MODE);
			chmod(DIR_FILES_INCOMING, DIRECTORY_PERMISSIONS_MODE);
		}
		if (!is_dir(DIR_FILES_TRASH)) {
			mkdir(DIR_FILES_TRASH, DIRECTORY_PERMISSIONS_MODE);
			chmod(DIR_FILES_TRASH, DIRECTORY_PERMISSIONS_MODE);
		}
		if (!is_dir(DIR_FILES_CACHE)) {
			mkdir(DIR_FILES_CACHE, DIRECTORY_PERMISSIONS_MODE);
			chmod(DIR_FILES_CACHE, DIRECTORY_PERMISSIONS_MODE);
		}
		if (!is_dir(DIR_FILES_CACHE_DB)) {
			mkdir(DIR_FILES_CACHE_DB, DIRECTORY_PERMISSIONS_MODE);
			chmod(DIR_FILES_CACHE_DB, DIRECTORY_PERMISSIONS_MODE);
		}
		if (!is_dir(DIR_FILES_AVATARS)) {
			mkdir(DIR_FILES_AVATARS, DIRECTORY_PERMISSIONS_MODE);
			chmod(DIR_FILES_AVATARS, DIRECTORY_PERMISSIONS_MODE);
		}
	}

	public function finish() {
		rename(DIR_CONFIG_SITE . '/site_install.php', DIR_CONFIG_SITE . '/site.php');
		@unlink(DIR_CONFIG_SITE . '/site_install_user.php');
		// remove this line and uncomment the two above when done developing !!
		//copy(DIR_CONFIG_SITE . '/site_install.php', DIR_CONFIG_SITE . '/site.php');
		@chmod(DIR_CONFIG_SITE . '/site.php', FILE_PERMISSIONS_MODE);
		Cache::flush();

	}

	public function install_permissions() {
		$ci = new ContentImporter();
		$ci->importContentFile(DIR_BASE_CORE. '/config/install/base/permissions.xml');
	}

	public function set_site_permissions() {

		Loader::model('file_set');
		$fs = FileSet::getGlobal();
		$g1 = Group::getByID(GUEST_GROUP_ID);
		$g2 = Group::getByID(REGISTERED_GROUP_ID);
		$g3 = Group::getByID(ADMIN_GROUP_ID);

		$fs->assignPermissions($g1, array('view_file_set_file'));
		$fs->assignPermissions($g3, array('view_file_set_file', 'search_file_set', 'edit_file_set_file_properties', 'edit_file_set_file_contents', 'copy_file_set_files', 'edit_file_set_permissions', 'delete_file_set_files', 'delete_file_set', 'add_file'));
		if (defined('ACTIVE_LOCALE') && ACTIVE_LOCALE != '' && ACTIVE_LOCALE != 'en_US') {
			Config::save('SITE_LOCALE', ACTIVE_LOCALE);
		}
		Config::save('SITE', SITE);
		Config::save('SITE_APP_VERSION', APP_VERSION);
		Config::save('SITE_INSTALLED_APP_VERSION', APP_VERSION);

		$u = new User();
		$u->saveConfig('NEWSFLOW_LAST_VIEWED', 'FIRSTRUN');

		$home = Page::getByID(1, "RECENT");
		$home->assignPermissions($g1, array('view_page'));
		$home->assignPermissions($g3, array('view_page_versions', 'view_page_in_sitemap', 'preview_page_as_user', 'edit_page_properties', 'edit_page_contents', 'edit_page_speed_settings', 'edit_page_theme', 'edit_page_type', 'edit_page_permissions', 'delete_page', 'delete_page_versions', 'approve_page_versions', 'add_subpage', 'move_or_copy_page', 'schedule_page_contents_guest_access'));

		Config::save('SECURITY_TOKEN_JOBS', Loader::helper('validation/identifier')->getString(64));
		Config::save('SECURITY_TOKEN_ENCRYPTION', Loader::helper('validation/identifier')->getString(64));
		Config::save('SECURITY_TOKEN_VALIDATION', Loader::helper('validation/identifier')->getString(64));
	}

	public static function hasCustomList() {
		$fh = Loader::helper('file');
		if (is_dir(DIR_STARTING_POINT_PACKAGES)) {
			$available = $fh->getDirectoryContents(DIR_STARTING_POINT_PACKAGES);
			if (count($available) > 0) {
				return true;
			}
		}
		return false;
	}

	public static function getAvailableList() {
		$fh = Loader::helper('file');
		// first we check the root install directory. If it exists, then we only include stuff from there. Otherwise we get it from the core.
		$available = array();
		if (is_dir(DIR_STARTING_POINT_PACKAGES)) {
			$available = $fh->getDirectoryContents(DIR_STARTING_POINT_PACKAGES);
		}
		if (count($available) == 0) {
			$available = $fh->getDirectoryContents(DIR_STARTING_POINT_PACKAGES_CORE);
		}
		$availableList = array();
		foreach($available as $pkgHandle) {
			$availableList[] = Loader::startingPointPackage($pkgHandle);
		}
		return $availableList;
	}

}

class Concrete5_Model_StartingPointInstallRoutine {

	public function __construct($method, $progress, $text = '') {
		$this->method = $method;
		$this->progress = $progress;
		$this->text = $text;
	}

	public function getMethod() {
		return $this->method;
	}

	public function getText() {
		return $this->text;
	}

	public function getProgress() {
		return $this->progress;
	}

}


text:
""" This module extends standard Python's pickle module so that it is
capable of writing more efficient pickle files that contain Panda
objects with shared pointers.  In particular, a single Python
structure that contains many NodePaths into the same scene graph will
write the NodePaths correctly when used with this pickle module, so
that when it is unpickled later, the NodePaths will still reference
into the same scene graph together.

If you use the standard pickle module instead, the NodePaths will each
duplicate its own copy of its scene graph.

This is necessary because the standard pickle module doesn't provide a
mechanism for sharing context between different objects written to the
same pickle stream, so each NodePath has to write itself without
knowing about the other NodePaths that will also be writing to the
same stream.  This replacement module solves this problem by defining
a __reduce_persist__() replacement method for __reduce__(), which
accepts a pointer to the Pickler object itself, allowing for shared
context between all objects written by that Pickler.

Unfortunately, cPickle cannot be supported, because it does not
support extensions of this nature. """

from types import *
from copy_reg import dispatch_table
from panda3d.core import BamWriter, BamReader

# A funny replacement for "import pickle" so we don't get confused
# with the local pickle.py.
pickle = __import__('pickle')

class Pickler(pickle.Pickler):

    def __init__(self, *args, **kw):
        self.bamWriter = BamWriter()
        pickle.Pickler.__init__(self, *args, **kw)

    # We have to duplicate most of the save() method, so we can add
    # support for __reduce_persist__().

    def save(self, obj):
        # Check for persistent id (defined by a subclass)
        pid = self.persistent_id(obj)
        if pid:
            self.save_pers(pid)
            return

        # Check the memo
        x = self.memo.get(id(obj))
        if x:
            self.write(self.get(x[0]))
            return

        # Check the type dispatch table
        t = type(obj)
        f = self.dispatch.get(t)
        if f:
            f(self, obj) # Call unbound method with explicit self
            return

        # Check for a class with a custom metaclass; treat as regular class
        try:
            issc = issubclass(t, TypeType)
        except TypeError: # t is not a class (old Boost; see SF #502085)
            issc = 0
        if issc:
            self.save_global(obj)
            return

        # Check copy_reg.dispatch_table
        reduce = dispatch_table.get(t)
        if reduce:
            rv = reduce(obj)
        else:
            # New code: check for a __reduce_persist__ method, then
            # fall back to standard methods.
            reduce = getattr(obj, "__reduce_persist__", None)
            if reduce:
                rv = reduce(self)
            else:
                # Check for a __reduce_ex__ method, fall back to __reduce__
                reduce = getattr(obj, "__reduce_ex__", None)
                if reduce:
                    rv = reduce(self.proto)
                else:
                    reduce = getattr(obj, "__reduce__", None)
                    if reduce:
                        rv = reduce()
                    else:
                        raise PicklingError("Can't pickle %r object: %r" %
                                            (t.__name__, obj))

        # Check for string returned by reduce(), meaning "save as global"
        if type(rv) is StringType:
            self.save_global(obj, rv)
            return

        # Assert that reduce() returned a tuple
        if type(rv) is not TupleType:
            raise PicklingError("%s must return string or tuple" % reduce)

        # Assert that it returned an appropriately sized tuple
        l = len(rv)
        if not (2 <= l <= 5):
            raise PicklingError("Tuple returned by %s must have "
                                "two to five elements" % reduce)

        # Save the reduce() output and finally memoize the object
        self.save_reduce(obj=obj, *rv)

class Unpickler(pickle.Unpickler):

    def __init__(self, *args, **kw):
        self.bamReader = BamReader()
        pickle.Unpickler.__init__(self, *args, **kw)

    # Duplicate the load_reduce() function, to provide a special case
    # for the reduction function.

    def load_reduce(self):
        stack = self.stack
        args = stack.pop()
        func = stack[-1]

        # If the function name ends with "Persist", then assume the
        # function wants the Unpickler as the first parameter.
        if func.__name__.endswith('Persist'):
            value = func(self, *args)
        else:
            # Otherwise, use the existing pickle convention.
            value = func(*args)

        stack[-1] = value
    pickle.Unpickler.dispatch[pickle.REDUCE] = load_reduce

# Shorthands

try:
    from cStringIO import StringIO
except ImportError:
    from StringIO import StringIO

def dump(obj, file, protocol=None):
    Pickler(file, protocol).dump(obj)

def dumps(obj, protocol=None):
    file = StringIO()
    Pickler(file, protocol).dump(obj)
    return file.getvalue()

def load(file):
    return Unpickler(file).load()

def loads(str):
    file = StringIO(str)
    return Unpickler(file).load()


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * This test uses a formhistory.sqlite with schema version set to 999 (a
 * future version). This exercies the code that allows using a future schema
 * version as long as the expected columns are present.
 *
 * Part A tests this when the columns do match, so the DB is used.
 * Part B tests this when the columns do *not* match, so the DB is reset.
 */

function run_test()
{
  try {
  var testnum = 0;

  // ===== test init =====
  var testfile = do_get_file("formhistory_v999a.sqlite");
  var profileDir = dirSvc.get("ProfD", Ci.nsIFile);

  // Cleanup from any previous tests or failures.
  var destFile = profileDir.clone();
  destFile.append("formhistory.sqlite");
  if (destFile.exists())
    destFile.remove(false);

  testfile.copyTo(profileDir, "formhistory.sqlite");
  do_check_eq(999, getDBVersion(testfile));

  var fh = Cc["@mozilla.org/satchel/form-history;1"].
           getService(Ci.nsIFormHistory2);

  // ===== 1 =====
  testnum++;
  // Check for expected contents.
  do_check_true(fh.hasEntries);
  do_check_true(fh.entryExists("name-A", "value-A"));
  do_check_true(fh.entryExists("name-B", "value-B"));
  do_check_true(fh.entryExists("name-C", "value-C1"));
  do_check_true(fh.entryExists("name-C", "value-C2"));
  do_check_true(fh.entryExists("name-E", "value-E"));
  // check for downgraded schema.
  do_check_eq(CURRENT_SCHEMA, fh.DBConnection.schemaVersion);

  // ===== 2 =====
  testnum++;
  // Exercise adding and removing a name/value pair
  do_check_false(fh.entryExists("name-D", "value-D"));
  fh.addEntry("name-D", "value-D");
  do_check_true(fh.entryExists("name-D", "value-D"));
  fh.removeEntry("name-D", "value-D");
  do_check_false(fh.entryExists("name-D", "value-D"));

  } catch (e) {
    throw "FAILED in test #" + testnum + " -- " + e;
  }
}


text:
ACCEPTED

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

#### Published in
Öst. bot. Z. 68: 154 (1919)

#### Original name
Chiodecton graphidioides Leight.

### Remarks
null


text:
package async.wsdl_rpclit.client;

import junit.framework.TestCase;

import jakarta.xml.ws.AsyncHandler;
import jakarta.xml.ws.Response;
import java.util.concurrent.ExecutionException;

public class Hello1CallbackHandler extends TestCase implements AsyncHandler<Hello1Response> {

    /*
    * (non-Javadoc)
    *
    * @see javax.xml.rpc.AsyncHandler#handleResponse(javax.xml.rpc.Response)
    */
    public void handleResponse(Response<Hello1Response> response) {
        try {
            Hello1Response resp = response.get();
            HelloType out = resp.getRes();
            HelloType outH = resp.getHeader();
            assertEquals("foo", out.getArgument());
            assertEquals("bar", out.getExtra());
            assertEquals("header arg", outH.getArgument());
            assertEquals("header extra", outH.getExtra());
//            assertEquals("Hello World!", resp.getExtraHeader());
        } catch (ExecutionException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}


text:
RSpec.describe Rubyang::Xpath::Logger do
  let(:name){ 'spec' }
  let(:internal_logger){
    Class.new{
      def fatal; yield; end
      def error; yield; end
      def warn;  yield; end
      def info;  yield; end
      def debug; yield; end
    }.new
  }
  let(:logger){ described_class.new name }

  describe '.initialize' do
    it "takes one argument" do
      expect { Rubyang::Xpath::Logger.initialize internal_logger }.not_to raise_error
    end

    it "initialize Rubyang::Xpath::Logger" do
      Rubyang::Xpath::Logger.initialize internal_logger
      expect(Rubyang::Xpath::Logger.initialized?).to be true
    end
  end

  describe '.uninitialize' do
    it "takes no arguments" do
      expect { Rubyang::Xpath::Logger.uninitialize }.not_to raise_error
    end

    it "uninitialize Rubyang::Xpath::Logger" do
      Rubyang::Xpath::Logger.initialize internal_logger
      Rubyang::Xpath::Logger.uninitialize
      expect(Rubyang::Xpath::Logger.initialized?).to be false
    end
  end

  describe '.initialized?' do
    it "is false when uninitialized" do
      Rubyang::Xpath::Logger.initialize internal_logger
      Rubyang::Xpath::Logger.uninitialize
      expect(Rubyang::Xpath::Logger.initialized?).to be false
    end

    it "is true when initialized" do
      Rubyang::Xpath::Logger.initialize internal_logger
      expect(Rubyang::Xpath::Logger.initialized?).to be true
    end
  end

  describe '#new' do
    it "takes one argument" do
      expect { Rubyang::Xpath::Logger.new name }.not_to raise_error
    end
  end

  describe '#fatal' do
    let(:method){ :fatal }

    context 'Rubyang::Xpath::Logger is not initialized' do
      before :example do
        Rubyang::Xpath::Logger.uninitialize
      end
      it "does not call #fatal method of @@logger" do
        expect { logger.send(method){ method } }.not_to raise_error
      end
    end

    context 'Rubyang::Xpath::Logger is initialized' do
      before :example do
        Rubyang::Xpath::Logger.initialize internal_logger
      end
      it "calls #fatal method of @@logger with '#\{name\}: ' prefix" do
        expect(logger.send(method){ method }).to eq "#{name}: #{method}"
      end
    end
  end

  describe '#error' do
    let(:method){ :error }

    context 'Rubyang::Xpath::Logger is not initialized' do
      before :example do
        Rubyang::Xpath::Logger.uninitialize
      end
      it "does not call #error method of @@logger" do
        expect { logger.send(method){ method } }.not_to raise_error
      end
    end

    context 'Rubyang::Xpath::Logger is initialized' do
      before :example do
        Rubyang::Xpath::Logger.initialize internal_logger
      end
      it "calls #error method of @@logger with '#\{name\}: ' prefix" do
        expect(logger.send(method){ method }).to eq "#{name}: #{method}"
      end
    end
  end

  describe '#warn' do
    let(:method){ :warn }

    context 'Rubyang::Xpath::Logger is not initialized' do
      before :example do
        Rubyang::Xpath::Logger.uninitialize
      end
      it "does not call #warn method of @@logger" do
        expect { logger.send(method){ method } }.not_to raise_error
      end
    end

    context 'Rubyang::Xpath::Logger is initialized' do
      before :example do
        Rubyang::Xpath::Logger.initialize internal_logger
      end
      it "calls #warn method of @@logger with '#\{name\}: ' prefix" do
        expect(logger.send(method){ method }).to eq "#{name}: #{method}"
      end
    end
  end

  describe '#info' do
    let(:method){ :info }

    context 'Rubyang::Xpath::Logger is not initialized' do
      before :example do
        Rubyang::Xpath::Logger.uninitialize
      end
      it "does not call #info method of @@logger" do
        expect { logger.send(method){ method } }.not_to raise_error
      end
    end

    context 'Rubyang::Xpath::Logger is initialized' do
      before :example do
        Rubyang::Xpath::Logger.initialize internal_logger
      end
      it "calls #info method of @@logger with '#\{name\}: ' prefix" do
        expect(logger.send(method){ method }).to eq "#{name}: #{method}"
      end
    end
  end

  describe '#debug' do
    let(:method){ :debug }

    context 'Rubyang::Xpath::Logger is not initialized' do
      before :example do
        Rubyang::Xpath::Logger.uninitialize
      end
      it "does not call #debug method of @@logger" do
        expect { logger.send(method){ method } }.not_to raise_error
      end
    end

    context 'Rubyang::Xpath::Logger is initialized' do
      before :example do
        Rubyang::Xpath::Logger.initialize internal_logger
      end
      it "calls #debug method of @@logger with '#\{name\}: ' prefix" do
        expect(logger.send(method){ method }).to eq "#{name}: #{method}"
      end
    end
  end
end


text:
import {isExperimentOn} from '../../../../../src/experiments';
import {poll} from '../../../../../testing/iframe';

const body =
    '<amp-list id="list" width=300 height=100 ' +
        'src="http://localhost:9876/list/fruit-data/get?cors=0">' +
      '<template type="amp-mustache">' +
        '{{name}} : {{quantity}} @ ${{unitPrice}}' +
      '</template>' +
    '</amp-list>';

const extensions = ['amp-list', 'amp-mustache', 'amp-bind'];

describe('amp-list', function() {
  const TIMEOUT = Math.max(window.ampTestRuntimeConfig.mochaTimeout, 4000);
  this.timeout(TIMEOUT);

  describes.integration('(integration)', {
    body, extensions,
  }, env => {
    it('should render items', function*() {
      const list = env.win.document.getElementById('list');
      expect(list).to.exist;

      let children;
      yield poll('#list render', () => {
        children = list.querySelectorAll('div[role=list] > div');
        return children.length > 0;
      }, undefined, /* opt_timeout */ TIMEOUT);

      expect(children.length).to.equal(3);
      expect(children[0].textContent.trim()).to.equal('apple : 47 @ $0.33');
      expect(children[1].textContent.trim()).to.equal('pear : 538 @ $0.54');
      expect(children[2].textContent.trim()).to.equal('tomato : 0 @ $0.23');
    });
  });

  const body2 =
  '<button id="button" on="tap:list.changeToLayoutContainer()">+</button>' +
  '<amp-list id="list" width=300 height=100 ' +
      'src="http://localhost:9876/list/fruit-data/get?cors=0">' +
    '<template type="amp-mustache">' +
      '{{name}} : {{quantity}} @ ${{unitPrice}}' +
    '</template>' +
  '</amp-list>';

  describes.integration('with changeToLayoutContainer', {
    body: body2, extensions,
    experiments: ['amp-list-resizable-children']},
  env => {

    let win, doc;

    beforeEach(() => {
      win = env.win;
      doc = win.document;
    });

    it('should change to layout container as action', function*() {
      expect(isExperimentOn(win, 'amp-list-resizable-children')).to.be.true;

      const button = doc.getElementById('button');
      const list = doc.getElementById('list');
      button.click();

      yield poll('changes to layout container', () => {
        const layout = list.getAttribute('layout');
        return layout == 'container';
      }, undefined, /* opt_timeout */ TIMEOUT);

      expect(list.classList.contains('i-amphtml-layout-container')).to.be.true;
    });
  });

  const body3 =
  '<amp-state id="state">' +
    '<script type="application/json">' +
      'false' +
    '</script>' +
  '</amp-state>' +
    '<button id="button" on="tap:AMP.setState({state: true})">+</button>' +
    '<amp-list id="list" width=300 height=100 ' +
      '[is-layout-container]="state" ' +
      'src="http://localhost:9876/list/fruit-data/get?cors=0">' +
      '<template type="amp-mustache">' +
        '{{name}} : {{quantity}} @ ${{unitPrice}}' +
      '</template>' +
    '</amp-list>';

  describes.integration('with bindable is-layout-container', {
    body: body3, extensions,
    experiments: ['amp-list-resizable-children']},
  env => {

    let win, doc;

    beforeEach(() => {
      win = env.win;
      doc = win.document;
    });

    it('should change to layout container as on bind', function*() {
      expect(isExperimentOn(win, 'amp-list-resizable-children')).to.be.true;

      const button = doc.getElementById('button');
      const list = doc.getElementById('list');
      button.click();

      yield poll('changes to layout container', () => {
        const layout = list.getAttribute('layout');
        return layout == 'container';
      }, undefined, /* opt_timeout */ TIMEOUT);

      expect(list.classList.contains('i-amphtml-layout-container')).to.be.true;
    });
  });
});


text:
package edu.asu.plp.tool.prototype.model;

/**
 * Event for requesting an {@link Theme} through the {@link edu.asu.plp.tool.backend.EventRegistry}.
 *
 * Used for requesting a change to the Application Theme.
 *
 * Subscribe to {@link ThemeRequestCallback} for retrieving the returned theme.
 *
 * @author Nesbitt, Morgan on 2/24/2016.
 */
public class ThemeRequestEvent
{
	private String themeName;

	public ThemeRequestEvent( String themeName )
	{
		this.themeName = themeName;
	}

	public String getThemeName()
	{
		return themeName;
	}
}


text:
#import <GPUToolsAnalysis/DYAnalyzerHeuristic.h>

@class NSMutableSet;

// Not exported
@interface DYAnalyzerHeuristic_VertexSetup : DYAnalyzerHeuristic
{
    BOOL hasUsedVAO;
    BOOL hasSetVertexDataForDrawCall;
    int numberOfDrawCallsWithVertexSetup;
    NSMutableSet *usedStaticBufferSet;
}

+ (id)identifier;
- (void).cxx_destruct;
- (void)reportIndexedDrawTransformFeedbackActiveNotPaused:(const struct Function *)arg1;
- (void)reportDifferentStrides:(const struct Function *)arg1 bufferID:(int)arg2;
- (void)reportSameVertexData:(const struct Function *)arg1 bufferID:(int)arg2;
- (void)reportOverlappingVertexData:(const struct Function *)arg1 bufferID:(int)arg2;
- (void)reportNonExistentBufferUsage:(const struct Function *)arg1 bufferID:(int)arg2;
- (void)reportIndexedDrawExceededArrayBufferSize:(const struct Function *)arg1 bufferID:(int)arg2;
- (void)reportDrawExceededArrayBufferSize:(const struct Function *)arg1 bufferID:(int)arg2;
- (void)reportDrawExceededElementArrayBufferSize:(const struct Function *)arg1 bufferID:(int)arg2;
- (void)recommendNotUsingSignedByte:(const struct Function *)arg1;
- (void)recommendUsingEvenNumberOfComponentsForShortData:(const struct Function *)arg1;
- (void)recommendUsingFourComponentsForByteData:(const struct Function *)arg1;
- (void)recommendUsingIndexedRendering:(const struct Function *)arg1;
- (void)recommendUsingUnsignedShortIB:(const struct Function *)arg1;
- (void)reportVAOArrayBufferBindingDependency:(const struct Function *)arg1;
- (void)recommendUsingVAO:(const struct Function *)arg1;
- (void)recommendInterleavedData:(const struct Function *)arg1;
- (void)recommendUsingIBO:(const struct Function *)arg1;
- (void)recommendUsingVBO:(const struct Function *)arg1;
- (void)recommendCompactTexCoordData:(const struct Function *)arg1;
- (void)recommendByteSizedColorData:(const struct Function *)arg1;
- (void)recommendNotUsingGLFixed:(const struct Function *)arg1;
- (void)reportUnalignedVBOVertexElement:(const struct Function *)arg1;
- (void)reportUnalignedClientSideVertexElement:(const struct Function *)arg1;
- (void)endBlock:(int)arg1;
- (void)startBlock:(int)arg1;
- (void)buildStaticBufferListForDrawCallES20:(id)arg1 vertexAttribIndex:(int)arg2 usingVertexArrayObject:(int)arg3;
- (void)buildStaticBufferListForDrawCallES11:(id)arg1 arrayEnum:(int)arg2 arrayBindingEnum:(int)arg3 usingClientActiveTexture:(int)arg4 usingVertexArrayObject:(int)arg5;
- (int)processDrawElementsFunctions:(const struct Function *)arg1 context:(const ContextStateMirror_efb9dfa5 *)arg2;
- (void)processFunction:(const struct Function *)arg1 stateMirrorRetCode:(unsigned int)arg2;
- (_Bool)hasArrayBuffers:(const VertexArrayObject_162aff0d *)arg1 context:(const ContextStateMirror_efb9dfa5 *)arg2;
- (int)countAvailableVertices:(const VertexArrayObject_162aff0d *)arg1 context:(const ContextStateMirror_efb9dfa5 *)arg2;
- (id)init;

@end