text:
using ServiceStack.IntegrationTests.ServiceModel;

namespace ServiceStack.IntegrationTests.ServiceInterface
{
	public class LocalSubnetRestrictionService
		: TestServiceBase<LocalSubnetRestriction>
	{
		protected override object Run(LocalSubnetRestriction request)
		{
			return new LocalSubnetRestrictionResponse();
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

const { OperationAPI } = require('../../..');

class ExampleAPI extends OperationAPI {
    async initialize() {
        this.initialized = true;
        return super.initialize();
    }

    async shutdown() {
        this.shutdown = true;
        return super.shutdown();
    }

    name() {
        return 'ExampleAPI';
    }

    async handle(config) {
        return {
            config,
            say() {
                return 'hello';
            }
        };
    }
}

module.exports = ExampleAPI;


text:
<resources>

    <!-- Base application theme. -->
    <style name="Indigo" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/primary</item>
        <item name="colorPrimaryDark">@color/primary_dark</item>
        <item name="colorAccent">@color/accent</item>
        <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
    </style>

    <!-- Indigo -->
    <color name="primary">#3F51B5</color>
    <color name="primary_dark">#303F9F</color>
    <color name="accent">#FF4081</color>
    <color name="text_primary">#D9FFFFFF</color>
    <color name="text_secondary">#D9000000</color>

    <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="spinBars">true</item>
        <item name="color">@android:color/white</item>
    </style>

    <!-- Indigo without actionbar when toolbar is used -->
    <style name="IndigoWithoutActionBar" parent="Indigo">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <!-- Sign Up Login screen -->
    <style name="SignUpLoginElement">
        <item name="android:layout_width">match_parent</item>
        <item name="android:maxWidth">@dimen/sign_up_login_activity_element_max_width</item>
        <item name="android:layout_height">@dimen/sign_up_login_activity_element_height</item>
        <item name="android:maxHeight">@dimen/sign_up_login_activity_element_height</item>
        <item name="android:radius">@dimen/sign_up_login_activity_element_radius</item>
    </style>

    <!--    Login button with a drawable on the left -->
    <style name="SignUpLoginButtonWithDrawableOnLeft" parent="SignUpLoginElement">
        <item name="android:drawablePadding">2dp</item>
        <item name="android:paddingLeft">30dp</item>
        <item name="android:paddingRight">26dp</item>
    </style>

    <!--    Facebook Sign in button -->
    <style name="FacebookLoginButton" parent="SignUpLoginButtonWithDrawableOnLeft">
        <item name="android:background">@drawable/sign_up_login_activity_facebook_background</item>
        <item name="android:textColor">@android:color/white</item>
        <item name="android:text">@string/sign_up_login_activity_sign_in_with_facebook</item>
        <item name="android:drawableLeft">@drawable/sign_up_login_facebook_logo</item>
    </style>

    <!--    Google Sign in button -->
    <style name="GooglePlusLoginButton" parent="SignUpLoginButtonWithDrawableOnLeft">
        <item name="android:background">@drawable/sign_up_login_activity_google_plus_background</item>
        <item name="android:textColor">@android:color/white</item>
        <item name="android:text">@string/sign_up_login_activity_sign_in_with_google_plus</item>
        <item name="android:drawableLeft">@drawable/sign_up_login_google_plus_logo</item>
    </style>

    <!--    Sign up or login button -->
    <style name="SignUpOrLoginButton" parent="SignUpLoginElement">
        <item name="android:background">@drawable/sign_up_login_activity_sign_up_and_log_in_background</item>
        <item name="android:textColor">@android:color/white</item>
    </style>

    <!--    Sign up or login editText -->
    <style name="SignUpOrLoginEditText" parent="SignUpLoginElement">
        <item name="android:background">@drawable/sign_up_login_activity_edit_text_background</item>
        <item name="android:textColor">@android:color/black</item>
        <item name="android:gravity">center</item>
        <item name="android:ellipsize">start</item>
    </style>

    <!--    Sign up or login editText email -->
    <style name="SignUpOrLoginEMailEditText" parent="SignUpOrLoginEditText">
        <item name="android:hint">@string/sign_up_activity_email_hint</item>
        <item name="android:inputType">textEmailAddress</item>
    </style>

    <!--    Sign up or login editText password -->
    <style name="SignUpOrLoginPasswordEditText" parent="SignUpOrLoginEditText">
        <item name="android:hint">@string/sign_up_activity_password_hint</item>
        <item name="android:inputType">textPassword</item>
    </style>

    <!--    Sign up or login editText verify password -->
    <style name="SignUpOrLoginVerifyPasswordEditText" parent="SignUpOrLoginPasswordEditText">
        <item name="android:hint">@string/sign_up_activity_verify_password_hint</item>
        <item name="android:inputType">textPassword</item>
    </style>

    <!--    Normal button -->
    <style name="WorldSpotlightButton" parent="SignUpLoginElement">
        <item name="android:background">@drawable/sign_up_login_activity_skip_background</item>
        <item name="android:textColor">@android:color/white</item>
        <item name="android:layout_gravity">center_horizontal</item>
    </style>

</resources>


text:
This project is intended to give you, dear reader, a hands-on introduction
to the Scala programming language. We'll cover some basic functional
programming concepts and some need-to-know language features, all over the
span of about an hour. If after that you still want more then you'll find
a list of additional resources way down at the bottom of this page.

## Prior to the Workshop
You're going to need to do a few things prior to the workshop.

#### Install JDK 7+
If you're currently programming in Java you'll already have this.
Otherwise [grab it](http://www.oracle.com/technetwork/java/javase) and
install it

#### Install SBT
You're going to need to install [SBT](http://www.scala-sbt.org/). This
is the Scala Build Tool and will take care of building your project,
dependency management etc. In fact, think of it to Scala as Maven is to
Java. (For die-hard gradle users -- sorry for using the "M" word).

#### Installing an IDE / Text Editor
I recommend [IntelliJ IDEA](docs/setup-intellij.md) and will be using
this IDE during the workshop. If IntelliJ isn't your cup of tea then
[Eclipse](docs/setup-eclipse.md) would do the trick. If you prefer the
text editor approach then you can get some nice Scala syntax highlighting
in [Atom](docs/setup-atom.md).

#### The First Run
Once you have SBT installed and your IDE configured you're going to want
to build the project and download all those lovely dependencies. Open up
your terminal/command prompt and navigate to the root of the project.
Run this:
```
    sbt clean compile run
```
This will do a few things:
* Download the correct version of SBT for the project as specified in
project/build.properties -- clever right?
* Compile the necessary Scala bits for the version specified in build.sbt
* Download the necessary dependencies for this project
* Start up a server on port 9000

__This will take a few minutes__! But it's all worth it, trust me! Once
it's done try hitting http://localhost:9000 in a browser. For the extra
curios take a look at A_Scala101Test.scala. This and the other stuff
will be covered in the workshop.

## Additional Resources
Looking for more? Try these:

#### Online
* [The official Scala site](http://www.scala-lang.org)
* [The Morning Paper - Why Functional Programming Matters] (https://blog.acolyer.org/2016/09/14/why-functional-programming-matters/)
* [Daniel Westheide's "The Neophyte's Guide to Scala"](http://danielwestheide.com/scala/neophytes.html)
* [Martin Odersky's Scala Coursera course] (https://www.coursera.org/learn/progfun1)
* [Lightbend's eBook collection] (http://www.lightbend.com/resources/e-books)

#### Books
* [Scala for the Impatient - This book is fantastic!](https://www.amazon.co.uk/Scala-Impatient-Cay-Horstmann/dp/0321774094)
* [Functional Programming in Scala](https://www.amazon.co.uk/Functional-Programming-Scala-Paul-Chiusano/dp/1617290653)
* [Programming in Scala](https://www.amazon.co.uk/Programming-Scala-Comprehensive-Step-Step-ebook/dp/B01EX49FOU)


text:
/* jshint node: true */
var express = require('express');
var pkg = require('../package');
var router = express.Router();

var mongoose = require('../config/db.js').mongoose;
var dbHelper = require('../services/dbHelper');
var userHelper = require('../services/userHelper.js');
var bookHelper = require('../services/bookHelper');
var transactionHelper = require('../services/transactionHelper.js');

var book = require('../models/book');

var wrap = require('co-express');

module.exports = function(app, passport) {
    app.get('/explore', function(req, res, next) {
        //TODO: JMC database connection
        //also system defaults for alt
        req = userHelper.processUser(req);
        var Book = mongoose.model('Book', book);

        Book.find({}, function(err, books) {
            if (err) req.flash('error', '' + err);

            res.render('explore/explore', { site: app.locals.site, books: books, user: req.user, req: req });
        });
    });

    app.get('/explore/mine', wrap(function*(req, res, next) {
        //TODO: JMC database connection
        //also system defaults for alt
        if (userHelper.auth(req, res, app.locals.site)) {
            req = userHelper.processUser(req);
            var usrBooks = yield bookHelper.getUserBooks(req.user._id);
            var transactionBooks = yield transactionHelper.getTransactionBooks(req.user._id);
            var storeBooks = [];

            for (var i = 0; i < usrBooks.length; i++) {
                var isDuplicate = false;
                for (var j = 0; j < transactionBooks.loanedUsrBooks.length; j++) {
                    if (bookHelper.compareBookObjects(usrBooks[i], transactionBooks.loanedUsrBooks[j])) {
                        isDuplicate = true;
                    }
                }

                if (!isDuplicate) {
                    storeBooks.push(usrBooks[i]);
                }
            }

            if(!transactionBooks.rentedUsrBooks[0]) {
                transactionBooks.rentedUsrBooks = [];
            }

            res.render('explore/explore-mine', { site: app.locals.site, books: storeBooks, transactionBooks: transactionBooks, user: req.user, req: req });
        }
    }));
};


text:
<?php

namespace Drupal\migrate\Plugin\migrate\destination;

use Drupal\Core\Plugin\PluginBase;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Exception\RequirementsException;
use Drupal\migrate\Plugin\MigrateDestinationInterface;
use Drupal\migrate\Plugin\MigrateIdMapInterface;
use Drupal\migrate\Plugin\RequirementsInterface;

/**
 * Base class for migrate destination classes.
 *
 * @see \Drupal\migrate\Plugin\MigrateDestinationInterface
 * @see \Drupal\migrate\Plugin\MigrateDestinationPluginManager
 * @see \Drupal\migrate\Annotation\MigrateDestination
 * @see plugin_api
 *
 * @ingroup migration
 */
abstract class DestinationBase extends PluginBase implements MigrateDestinationInterface, RequirementsInterface {

  /**
   * Indicates whether the destination can be rolled back.
   *
   * @var bool
   */
  protected $supportsRollback = FALSE;

  /**
   * The rollback action to be saved for the last imported item.
   *
   * @var int
   */
  protected $rollbackAction = MigrateIdMapInterface::ROLLBACK_DELETE;

  /**
   * The migration.
   *
   * @var \Drupal\migrate\Plugin\MigrationInterface
   */
  protected $migration;

  /**
   * Constructs an entity destination plugin.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
   *   The migration.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->migration = $migration;
  }

  /**
   * {@inheritdoc}
   */
  public function rollbackAction() {
    return $this->rollbackAction;
  }

  /**
   * {@inheritdoc}
   */
  public function checkRequirements() {
    if (empty($this->pluginDefinition['requirements_met'])) {
      throw new RequirementsException();
    }
  }

  /**
   * {@inheritdoc}
   */
  public function rollback(array $destination_identifier) {
    // By default we do nothing.
  }

  /**
   * {@inheritdoc}
   */
  public function supportsRollback() {
    return $this->supportsRollback;
  }

  /**
   * For a destination item being updated, set the appropriate rollback action.
   *
   * @param array $id_map
   *   The map row data for the item.
   * @param int $update_action
   *   The rollback action to take if we are updating an existing item.
   */
  protected function setRollbackAction(array $id_map, $update_action = MigrateIdMapInterface::ROLLBACK_PRESERVE) {
    // If the entity we're updating was previously migrated by us, preserve the
    // existing rollback action.
    if (isset($id_map['sourceid1'])) {
      $this->rollbackAction = $id_map['rollback_action'];
    }
    // Otherwise, we're updating an entity which already existed on the
    // destination and want to make sure we do not delete it on rollback.
    else {
      $this->rollbackAction = $update_action;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getDestinationModule() {
    if (!empty($this->configuration['destination_module'])) {
      return $this->configuration['destination_module'];
    }
    if (!empty($this->pluginDefinition['destination_module'])) {
      return $this->pluginDefinition['destination_module'];
    }
    if (is_string($this->migration->provider)) {
      return $this->migration->provider;
    }
    else {
      return reset($this->migration->provider);
    }
  }

}


text:
'use strict';

/**
* @author       Jeremy Dowell <jeremy@codevinsky.com>
* @license      {@link http://www.wtfpl.net/txt/copying/|WTFPL}
*/

/**
* Creates a new `Juicy` object.
*
* @class Phaser.Plugin.Juicy
* @constructor
*
* @param {Phaser.Game} game Current game instance.
*/
Phaser.Plugin.Juicy = function (game) {

  Phaser.Plugin.call(this, game);

  /**
  * @property {Phaser.Rectangle} _boundsCache - A reference to the current world bounds.
  * @private
  */
  this._boundsCache = Phaser.Utils.extend(false, {}, this.game.world.bounds);

  /**
  * @property {number} _shakeWorldMax - The maximum world shake radius
  * @private
  */
  this._shakeWorldMax = 20;

  /**
  * @property {number} _shakeWorldTime - The maximum world shake time
  * @private
  */
  this._shakeWorldTime = 0;

  /**
  * @property {number} _trailCounter - A count of how many trails we're tracking
  * @private
  */
  this._trailCounter = 0;

  /**
  * @property {object} _overScales - An object containing overscaling configurations
  * @private
  */
  this._overScales = {};

  /**
  * @property {number} _overScalesCounter - A count of how many overScales we're tracking
  * @private
  */
  this._overScalesCounter = 0;
};

Phaser.Plugin.Juicy.prototype = Object.create(Phaser.Plugin.prototype);
Phaser.Plugin.Juicy.prototype.constructor = Phaser.Plugin.Juicy;

/**
* Creates a new `Juicy.ScreenFlash` object.
*
* @class Phaser.Plugin.Juicy.ScreenFlash
* @constructor
*
* @param {Phaser.Game} game -  Current game instance.
* @param {string} color='white' - The color to flash the screen.
* @memberof Phaser.Plugin.Juicy
*/
Phaser.Plugin.Juicy.ScreenFlash = function(game, color) {
  color = color || 'white';
  var bmd = game.add.bitmapData(game.width, game.height);
  bmd.ctx.fillStyle = color;
  bmd.ctx.fillRect(0,0, game.width, game.height);

  Phaser.Sprite.call(this, game, 0,0, bmd);
  this.alpha = 0;
};

Phaser.Plugin.Juicy.ScreenFlash.prototype = Object.create(Phaser.Sprite.prototype);
Phaser.Plugin.Juicy.ScreenFlash.prototype.constructor = Phaser.Plugin.Juicy.ScreenFlash;

/**
* Flashes the screen
*
* @param {number} [maxAlpha=1] - The maximum alpha to flash the screen to
* @param {number} [duration=100] - The duration of the flash in milliseconds
* @method Phaser.Plugin.Juicy.ScreenFlash#flash
* @memberof Phaser.Plugin.Juicy.ScreenFlash
*/
Phaser.Plugin.Juicy.ScreenFlash.prototype.flash = function(maxAlpha, duration) {
  maxAlpha = maxAlpha || 1;
  duration = duration || 100;
  var flashTween = this.game.add.tween(this).to({alpha: maxAlpha}, 100, Phaser.Easing.Bounce.InOut, true,0, 0, true);
  flashTween.onComplete.add(function() {
    this.alpha = 0;
  }, this);
};

/**
* Creates a new `Juicy.Trail` object.
*
* @class Phaser.Plugin.Juicy.Trail
* @constructor
*
* @param {Phaser.Game} game -  Current game instance.
* @param {number} [trailLength=100] - The length of the trail
* @param {number} [color=0xFFFFFF] - The color of the trail
* @memberof Phaser.Plugin.Juicy
*/
Phaser.Plugin.Juicy.Trail = function(game, trailLength, color) {
  Phaser.Graphics.call(this, game, 0,0);

  /**
  * @property {Phaser.Sprite} target - The target sprite whose movement we want to create the trail from
  */
  this.target = null;
  /**
  * @property {number} trailLength - The number of segments to use to create the trail
  */
  this.trailLength = trailLength || 100;
  /**
  * @property {number} trailWidth - The width of the trail
  */
  this.trailWidth = 15.0;

  /**
  * @property {boolean} trailScale - Whether or not to taper the trail towards the end
  */
  this.trailScaling = false;

  /**
  * @property {Phaser.Sprite} trailColor - The color of the trail
  */
  this.trailColor = color || 0xFFFFFF;

  /**
  * @property {Array<Phaser.Point>} _segments - A historical collection of the previous position of the target
  * @private
  */
  this._segments = [];
  /**
  * @property {Array<number>} _verts - A collection of vertices created from _segments
  * @private
  */
  this._verts = [];
  /**
  * @property {Array<Phaser.Point>} _segments - A collection of indices created from _verts
  * @private
  */
  this._indices = [];

};

Phaser.Plugin.Juicy.Trail.prototype = Object.create(Phaser.Graphics.prototype);
Phaser.Plugin.Juicy.Trail.prototype.constructor = Phaser.Plugin.Juicy.Trail;

/**
* Updates the Trail if a target is set
*
* @method Phaser.Plugin.Juicy.Trail#update
* @memberof Phaser.Plugin.Juicy.Trail
*/

Phaser.Plugin.Juicy.Trail.prototype.update = function() {
  if(this.target) {
    this.x = this.target.x;
    this.y = this.target.y;
    this.addSegment(this.target.x, this.target.y);
    this.redrawSegments(this.target.x, this.target.y);
  }
};

/**
* Adds a segment to the segments list and culls the list if it is too long
*
* @param {number} [x] - The x position of the point
* @param {number} [y] - The y position of the point
*
* @method Phaser.Plugin.Juicy.Trail#addSegment
* @memberof Phaser.Plugin.Juicy.Trail
*/
Phaser.Plugin.Juicy.Trail.prototype.addSegment = function(x, y) {
  var segment;

  while(this._segments.length > this.trailLength) {
    segment = this._segments.shift();
  }
  if(!segment) {
    segment = new Phaser.Point();
  }

  segment.x = x;
  segment.y = y;

  this._segments.push(segment);
};

/**
* Creates and draws the triangle trail from segments
*
* @param {number} [offsetX] - The x position of the object
* @param {number} [offsetY] - The y position of the object
*
* @method Phaser.Plugin.Juicy.Trail#redrawSegments
* @memberof Phaser.Plugin.Juicy.Trail
*/
Phaser.Plugin.Juicy.Trail.prototype.redrawSegments = function(offsetX, offsetY) {
  this.clear();
  var s1, // current segment
      s2, // previous segment
      vertIndex = 0, // keeps track of which vertex index we're at
      offset, // temporary storage for amount to extend line outwards, bigger = wider
      ang, //temporary storage of the inter-segment angles
      sin = 0, // as above
      cos = 0; // again as above

  // first we make sure that the vertice list is the same length as we we want
  // each segment (except the first) will create to vertices with two values each
  if (this._verts.length !== (this._segments.length -1) * 4) {
    // if it's not correct, we clear the entire list
    this._verts = [];
  }

  // now we loop over all the segments, the list has the "youngest" segment at the end
  var prevAng = 0;

  for(var j = 0; j < this._segments.length; ++j) {
    // store the active segment for convenience
    s1 = this._segments[j];

    // if there's a previous segment, time to do some math
    if(s2) {
      // we calculate the angle between the two segments
      // the result will be in radians, so adding half of pi will "turn" the angle 90 degrees
      // that means we can use the sin and cos values to "expand" the line outwards
      ang = Math.atan2(s1.y - s2.y, s1.x - s2.x) + Math.PI / 2;
      sin = Math.sin(ang);
      cos = Math.cos(ang);

      // now it's time to creat ethe two vertices that will represent this pair of segments
      // using a loop here is probably a bit overkill since it's only two iterations
      for(var i = 0; i < 2; ++i) {
        // this makes the first segment stand out to the "left" of the line
        // annd the second to the right, changing that magic number at the end will alther the line width
        offset = ( -0.5 + i / 1) * this.trailWidth;

        // if trail scale effect is enabled, we scale down the offset as we move down the list
        if(this.trailScaling) {
          offset *= j / this._segments.length;
        }

        // finally we put to values in the vert list
        // using the segment coordinates as a base we add the "extended" point
        // offsetX and offsetY are used her to move the entire trail
        this._verts[vertIndex++] = s1.x + cos * offset - offsetX;
        this._verts[vertIndex++] = s1.y + sin * offset - offsetY;
      }
    }
    // finally store the current segment as the previous segment and go for another round
    s2 = s1.copyTo({});
  }
  // we need at least four vertices to draw something
  if(this._verts.length >= 8) {
    // now, we have a triangle "strip", but flash can't draw that without
    // instructions for which vertices to connect, so it's time to make those

    // here, we loop over all the vertices and pair them together in triangles
    // each group of four vertices forms two triangles
    for(var k = 0; k < this._verts.length; k++) {
      this._indices[k * 6 + 0] = k * 2 + 0;
      this._indices[k * 6 + 1] = k * 2 + 1;
      this._indices[k * 6 + 2] = k * 2 + 2;
      this._indices[k * 6 + 3] = k * 2 + 1;
      this._indices[k * 6 + 4] = k * 2 + 2;
      this._indices[k * 6 + 5] = k * 2 + 3;
    }
    this.beginFill(this.trailColor);
    this.drawTriangles(this._verts, this._indices);
    this.endFill();

  }
};

/**
* Add a Sprite reference to this Plugin.
* All this plugin does is move the Sprite across the screen slowly.
* @type {Phaser.Sprite}
*/

/**
* Begins the screen shake effect
*
* @param {number} [duration=20] - The duration of the screen shake
* @param {number} [strength=20] - The strength of the screen shake
*
* @method Phaser.Plugin.Juicy#shake
* @memberof Phaser.Plugin.Juicy
*/
Phaser.Plugin.Juicy.prototype.shake = function (duration, strength) {
  this._shakeWorldTime = duration || 20;
  this._shakeWorldMax = strength || 20;
  this.game.world.setBounds(this._boundsCache.x - this._shakeWorldMax, this._boundsCache.y - this._shakeWorldMax, this._boundsCache.width + this._shakeWorldMax, this._boundsCache.height + this._shakeWorldMax);
};

/**
* Creates a 'Juicy.ScreenFlash' object
*
* @param {string} color - The color of the screen flash
*
* @type {Phaser.Plugin.Juicy.ScreenFlash}
*/

Phaser.Plugin.Juicy.prototype.createScreenFlash = function(color) {
    return new Phaser.Plugin.Juicy.ScreenFlash(this.game, color);
};

/**
* Creates a 'Juicy.Trail' object
*
* @param {number} length - The length of the trail
* @param {number} color - The color of the trail
*
* @type {Phaser.Plugin.Juicy.Trail}
*/
Phaser.Plugin.Juicy.prototype.createTrail = function(length, color) {
  return new Phaser.Plugin.Juicy.Trail(this.game, length, color);
};

/**
* Creates the over scale effect on the given object
*
* @param {Phaser.Sprite} object - The object to over scale
* @param {number} [scale=1.5] - The scale amount to overscale by
* @param {Phaser.Point} [initialScale=new Phaser.Point(1,1)] - The initial scale of the object
*
*/
Phaser.Plugin.Juicy.prototype.overScale = function(object, scale, initialScale) {
  scale = scale || 1.5;
  var id = this._overScalesCounter++;
  initialScale = initialScale || new Phaser.Point(1,1);
  var scaleObj = this._overScales[id];
  if(!scaleObj) {
    scaleObj = {
      object: object,
      cache: initialScale.copyTo({})
    };
  }
  scaleObj.scale = scale;

  this._overScales[id] = scaleObj;
};

/**
* Creates the jelly effect on the given object
*
* @param {Phaser.Sprite} object - The object to gelatinize
* @param {number} [strength=0.2] - The strength of the effect
* @param {number} [delay=0] - The delay of the snap-back tween. 50ms are automaticallly added to whatever the delay amount is.
* @param {Phaser.Point} [initialScale=new Phaser.Point(1,1)] - The initial scale of the object
*
*/
Phaser.Plugin.Juicy.prototype.jelly = function(object, strength, delay, initialScale) {
  strength = strength || 0.2;
  delay = delay || 0;
  initialScale = initialScale ||  new Phaser.Point(1, 1);

  this.game.add.tween(object.scale).to({x: initialScale.x + (initialScale.x * strength)}, 50, Phaser.Easing.Quadratic.InOut, true, delay)
  .to({x: initialScale.x}, 600, Phaser.Easing.Elastic.Out, true);

  this.game.add.tween(object.scale).to({y: initialScale.y + (initialScale.y * strength)}, 50, Phaser.Easing.Quadratic.InOut, true, delay + 50)
  .to({y: initialScale.y}, 600, Phaser.Easing.Elastic.Out, true);
};

/**
* Creates the mouse stretch effect on the given object
*
* @param {Phaser.Sprite} object - The object to mouse stretch
* @param {number} [strength=0.5] - The strength of the effect
* @param {Phaser.Point} [initialScale=new Phaser.Point(1,1)] - The initial scale of the object
*
*/
Phaser.Plugin.Juicy.prototype.mouseStretch = function(object, strength, initialScale) {
    strength = strength || 0.5;
    initialScale = initialScale || new Phaser.Point(1,1);
    object.scale.x = initialScale.x + (Math.abs(object.x - this.game.input.activePointer.x) / 100) * strength;
    object.scale.y = initialScale.y + (initialScale.y * strength) - (object.scale.x * strength);
};

/**
* Runs the core update function and causes screen shake and overscaling effects to occur if they are queued to do so.
*
* @method Phaser.Plugin.Juicy#update
* @memberof Phaser.Plugin.Juicy
*/
Phaser.Plugin.Juicy.prototype.update = function () {
  var scaleObj;
  // Screen Shake
  if(this._shakeWorldTime > 0) {
    var magnitude = (this._shakeWorldTime / this._shakeWorldMax) * this._shakeWorldMax;
    var x = this.game.rnd.integerInRange(-magnitude, magnitude);
    var y = this.game.rnd.integerInRange(-magnitude, magnitude);

    this.game.camera.x = x;
    this.game.camera.y = y;
    this._shakeWorldTime--;
    if(this._shakeWorldTime <= 0) {
      this.game.world.setBounds(this._boundsCache.x, this._boundsCache.x, this._boundsCache.width, this._boundsCache.height);
    }
  }

  // over scales
  for(var s in this._overScales) {
    if(this._overScales.hasOwnProperty(s)) {
      scaleObj = this._overScales[s];
      if(scaleObj.scale > 0.01) {
        scaleObj.object.scale.x = scaleObj.scale * scaleObj.cache.x;
        scaleObj.object.scale.y = scaleObj.scale * scaleObj.cache.y;
        scaleObj.scale -= this.game.time.elapsed * scaleObj.scale * 0.35;
      } else {
        scaleObj.object.scale.x = scaleObj.cache.x;
        scaleObj.object.scale.y = scaleObj.cache.y;
        delete this._overScales[s];
      }
    }
  }
};

// for browserify compatibility
if(typeof module === 'object' && module.exports) {
  module.exports = Phaser.Plugin.Juicy;
}

// Draw Triangles Polyfill for back compatibility
if(!Phaser.Graphics.prototype.drawTriangle) {
  Phaser.Graphics.prototype.drawTriangle = function(points, cull) {
      var triangle = new Phaser.Polygon(points);
      if (cull) {
          var cameraToFace = new Phaser.Point(this.game.camera.x - points[0].x, this.game.camera.y - points[0].y);
          var ab = new Phaser.Point(points[1].x - points[0].x, points[1].y - points[0].y);
          var cb = new Phaser.Point(points[1].x - points[2].x, points[1].y - points[2].y);
          var faceNormal = cb.cross(ab);
          if (cameraToFace.dot(faceNormal) > 0) {
              this.drawPolygon(triangle);
          }
      } else {
          this.drawPolygon(triangle);
      }
      return;
  };

  /*
  * Draws {Phaser.Polygon} triangles
  *
  * @param {Array<Phaser.Point>|Array<number>} vertices - An array of Phaser.Points or numbers that make up the vertices of the triangles
  * @param {Array<number>} {indices=null} - An array of numbers that describe what order to draw the vertices in
  * @param {boolean} [cull=false] - Should we check if the triangle is back-facing
  * @method Phaser.Graphics.prototype.drawTriangles
  */

  Phaser.Graphics.prototype.drawTriangles = function(vertices, indices, cull) {

      var point1 = new Phaser.Point(),
          point2 = new Phaser.Point(),
          point3 = new Phaser.Point(),
          points = [],
          i;

      if (!indices) {
          if(vertices[0] instanceof Phaser.Point) {
              for(i = 0; i < vertices.length / 3; i++) {
                  this.drawTriangle([vertices[i * 3], vertices[i * 3 + 1], vertices[i * 3 + 2]], cull);
              }
          } else {
              for (i = 0; i < vertices.length / 6; i++) {
                  point1.x = vertices[i * 6 + 0];
                  point1.y = vertices[i * 6 + 1];
                  point2.x = vertices[i * 6 + 2];
                  point2.y = vertices[i * 6 + 3];
                  point3.x = vertices[i * 6 + 4];
                  point3.y = vertices[i * 6 + 5];
                  this.drawTriangle([point1, point2, point3], cull);
              }

          }
      } else {
          if(vertices[0] instanceof Phaser.Point) {
              for(i = 0; i < indices.length /3; i++) {
                  points.push(vertices[indices[i * 3 ]]);
                  points.push(vertices[indices[i * 3 + 1]]);
                  points.push(vertices[indices[i * 3 + 2]]);
                  if(points.length === 3) {
                      this.drawTriangle(points, cull);
                      points = [];
                  }

              }
          } else {
              for (i = 0; i < indices.length; i++) {
                  point1.x = vertices[indices[i] * 2];
                  point1.y = vertices[indices[i] * 2 + 1];
                  points.push(point1.copyTo({}));
                  if (points.length === 3) {
                      this.drawTriangle(points, cull);
                      points = [];
                  }
              }
          }
      }
  };
}


text:
/*
 * ModeShape (http://www.modeshape.org)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.modeshape.sequencer.cnd;

import static org.modeshape.sequencer.cnd.CndSequencerLexicon.AUTO_CREATED;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.AVAILABLE_QUERY_OPERATORS;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.CHILD_NODE_DEFINITION;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.DEFAULT_PRIMARY_TYPE;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.DEFAULT_VALUES;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.HAS_ORDERABLE_CHILD_NODES;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.IS_ABSTRACT;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.IS_FULL_TEXT_SEARCHABLE;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.IS_MIXIN;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.IS_QUERYABLE;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.IS_QUERY_ORDERABLE;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.MANDATORY;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.MULTIPLE;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.NAME;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.NODE_TYPE;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.NODE_TYPE_NAME;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.ON_PARENT_VERSION;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.PRIMARY_ITEM_NAME;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.PROPERTY_DEFINITION;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.PROTECTED;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.REQUIRED_PRIMARY_TYPES;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.REQUIRED_TYPE;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.SAME_NAME_SIBLINGS;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.SUPERTYPES;
import static org.modeshape.sequencer.cnd.CndSequencerLexicon.VALUE_CONSTRAINTS;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import javax.jcr.Binary;
import javax.jcr.NamespaceRegistry;
import javax.jcr.Node;
import javax.jcr.Property;
import javax.jcr.RepositoryException;
import javax.jcr.Value;
import javax.jcr.nodetype.NodeDefinition;
import javax.jcr.nodetype.NodeTypeDefinition;
import javax.jcr.nodetype.PropertyDefinition;
import javax.jcr.version.OnParentVersionAction;
import org.modeshape.common.collection.Problems;
import org.modeshape.common.collection.SimpleProblems;
import org.modeshape.common.logging.Logger;
import org.modeshape.common.util.CheckArg;
import org.modeshape.jcr.CndImporter;
import org.modeshape.jcr.ExecutionContext;
import org.modeshape.jcr.JcrLexicon;
import org.modeshape.jcr.api.nodetype.NodeTypeManager;
import org.modeshape.jcr.api.sequencer.Sequencer;
import org.modeshape.jcr.value.NamespaceRegistry.Namespace;

/**
 * A sequencer of CND files.
 *
 * @author Horia Chiorean
 */
public class CndSequencer extends Sequencer {

    private static final String RESIDUAL_ITEM_NAME = "*";
    private static final Logger LOGGER = Logger.getLogger(CndSequencer.class);

    @Override
    public void initialize( NamespaceRegistry registry,
                            NodeTypeManager nodeTypeManager ) throws RepositoryException, IOException {
        super.registerNodeTypes("sequencer-cnd.cnd", nodeTypeManager, true);
    }

    @Override
    public boolean execute( Property inputProperty,
                            Node outputNode,
                            Context context ) throws Exception {
        Binary binaryValue = inputProperty.getBinary();
        CheckArg.isNotNull(binaryValue, "binary");

        // if the output is jcr:system/jcr:nodeTypes import via the NodeTypeManager
        if (outputIsSystemNodeTypes(outputNode, binaryValue)) {
            return true;
        }

        CndImporter cndImporter = null;
        try (InputStream stream = binaryValue.getStream()) {
            cndImporter = importNodesFromCND(stream);
            if (cndImporter == null) {
                return false;
            }
        }

        registerImportedNamespaces(outputNode, cndImporter);
        processNodeTypeDefinitions(outputNode, cndImporter);

        return true;
    }

    private void processNodeTypeDefinitions( Node outputNode,
                                             CndImporter cndImporter ) throws RepositoryException {
        List<NodeTypeDefinition> importedNodeTypes = cndImporter.getNodeTypeDefinitions();

        for (NodeTypeDefinition nodeTypeDefinition : importedNodeTypes) {
            storeNodeTypeDefinition(outputNode, nodeTypeDefinition);
        }
    }

    private void registerImportedNamespaces( Node outputNode,
                                             CndImporter cndImporter ) throws RepositoryException {
        NamespaceRegistry namespaceRegistry = outputNode.getSession().getWorkspace().getNamespaceRegistry();
        for (Namespace namespace : cndImporter.getNamespaces()) {
            super.registerNamespace(namespace.getPrefix(), namespace.getNamespaceUri(), namespaceRegistry);
        }
    }

    private CndImporter importNodesFromCND( InputStream cndInputStream ) throws IOException {
        Problems problemsDuringImport = new SimpleProblems();

        CndImporter cndImporter = new CndImporter(new ExecutionContext());
        cndImporter.importFrom(cndInputStream, problemsDuringImport, null);
        if (problemsDuringImport.hasErrors()) {
            problemsDuringImport.writeTo(LOGGER);
            return null;
        }

        return cndImporter;
    }

    private boolean outputIsSystemNodeTypes( Node outputNode,
                                             Binary binaryValue ) throws RepositoryException, IOException {
        String systemNodesPath = JcrLexicon.SYSTEM.getString() + "/" + JcrLexicon.NODE_TYPES.getString();
        if (outputNode.getPath().contains(systemNodesPath)) {
            NodeTypeManager nodeTypeManager = (NodeTypeManager)outputNode.getSession().getWorkspace().getNodeTypeManager();
            nodeTypeManager.registerNodeTypes(binaryValue.getStream(), true);
            return true;
        }
        return false;
    }

    private void storeNodeTypeDefinition( Node outputNode,
                                          NodeTypeDefinition nodeTypeDefinition ) throws RepositoryException {
        Node nodeTypeNode = processNodeTypeDefinition(outputNode, nodeTypeDefinition);

        PropertyDefinition[] declaredPropertyDefinitions = nodeTypeDefinition.getDeclaredPropertyDefinitions();
        if (declaredPropertyDefinitions != null) {
            for (PropertyDefinition propertyDefinition : declaredPropertyDefinitions) {
                processPropertyDefinition(nodeTypeNode, propertyDefinition);
            }
        }

        NodeDefinition[] declaredChildNodeDefinitions = nodeTypeDefinition.getDeclaredChildNodeDefinitions();
        if (declaredChildNodeDefinitions != null) {
            for (NodeDefinition childNodeDefinition : declaredChildNodeDefinitions) {
                processChildNodeDefinition(nodeTypeNode, childNodeDefinition);
            }
        }
    }

    private void processChildNodeDefinition( Node nodeTypeNode,
                                             NodeDefinition childNodeDefinition ) throws RepositoryException {
        Node childNode = nodeTypeNode.addNode(CHILD_NODE_DEFINITION, CHILD_NODE_DEFINITION);

        if (!RESIDUAL_ITEM_NAME.equals(childNodeDefinition.getName())) {
            childNode.setProperty(NAME, childNodeDefinition.getName());
        }

        childNode.setProperty(AUTO_CREATED, childNodeDefinition.isAutoCreated());
        childNode.setProperty(MANDATORY, childNodeDefinition.isMandatory());
        childNode.setProperty(ON_PARENT_VERSION, OnParentVersionAction.nameFromValue(childNodeDefinition.getOnParentVersion()));
        childNode.setProperty(PROTECTED, childNodeDefinition.isProtected());
        String[] requiredPrimaryTypeNames = childNodeDefinition.getRequiredPrimaryTypeNames();
        childNode.setProperty(REQUIRED_PRIMARY_TYPES, requiredPrimaryTypeNames != null ? requiredPrimaryTypeNames : new String[0]);
        childNode.setProperty(SAME_NAME_SIBLINGS, childNodeDefinition.allowsSameNameSiblings());
        childNode.setProperty(DEFAULT_PRIMARY_TYPE, childNodeDefinition.getDefaultPrimaryTypeName());
    }

    private void processPropertyDefinition( Node nodeTypeNode,
                                            PropertyDefinition propertyDefinition ) throws RepositoryException {
        Node propertyDefinitionNode = nodeTypeNode.addNode(PROPERTY_DEFINITION, PROPERTY_DEFINITION);

        if (!RESIDUAL_ITEM_NAME.equals(propertyDefinition.getName())) {
            propertyDefinitionNode.setProperty(NAME, propertyDefinition.getName());
        }
        propertyDefinitionNode.setProperty(AUTO_CREATED, propertyDefinition.isAutoCreated());
        propertyDefinitionNode.setProperty(MANDATORY, propertyDefinition.isMandatory());
        propertyDefinitionNode.setProperty(MULTIPLE, propertyDefinition.isMultiple());
        propertyDefinitionNode.setProperty(PROTECTED, propertyDefinition.isProtected());
        propertyDefinitionNode.setProperty(ON_PARENT_VERSION,
                                           OnParentVersionAction.nameFromValue(propertyDefinition.getOnParentVersion()));
        propertyDefinitionNode.setProperty(REQUIRED_TYPE, org.modeshape.jcr.api.PropertyType.nameFromValue(propertyDefinition.getRequiredType())
                                                                      .toUpperCase());
        String[] availableQueryOperators = propertyDefinition.getAvailableQueryOperators();
        propertyDefinitionNode.setProperty(AVAILABLE_QUERY_OPERATORS,
                                           availableQueryOperators != null ? availableQueryOperators : new String[0]);
        Value[] defaultValues = propertyDefinition.getDefaultValues();
        propertyDefinitionNode.setProperty(DEFAULT_VALUES, defaultValues != null ? defaultValues : new Value[0]);
        String[] valueConstraints = propertyDefinition.getValueConstraints();
        propertyDefinitionNode.setProperty(VALUE_CONSTRAINTS, valueConstraints != null ? valueConstraints : new String[0]);
        propertyDefinitionNode.setProperty(IS_FULL_TEXT_SEARCHABLE, propertyDefinition.isFullTextSearchable());
        propertyDefinitionNode.setProperty(IS_QUERY_ORDERABLE, propertyDefinition.isQueryOrderable());
    }

    private Node processNodeTypeDefinition( Node outputNode,
                                            NodeTypeDefinition nodeTypeDefinition ) throws RepositoryException {
        Node nodeTypeNode = outputNode.addNode(nodeTypeDefinition.getName(), NODE_TYPE);

        nodeTypeNode.setProperty(IS_MIXIN, nodeTypeDefinition.isMixin());
        nodeTypeNode.setProperty(IS_ABSTRACT, nodeTypeDefinition.isAbstract());
        nodeTypeNode.setProperty(IS_QUERYABLE, nodeTypeDefinition.isQueryable());
        nodeTypeNode.setProperty(NODE_TYPE_NAME, nodeTypeDefinition.getName());
        nodeTypeNode.setProperty(HAS_ORDERABLE_CHILD_NODES, nodeTypeDefinition.hasOrderableChildNodes());
        String[] declaredSupertypeNames = nodeTypeDefinition.getDeclaredSupertypeNames();
        nodeTypeNode.setProperty(SUPERTYPES, declaredSupertypeNames != null ? declaredSupertypeNames : new String[0]);

        if (nodeTypeDefinition.getPrimaryItemName() != null) {
            nodeTypeNode.setProperty(PRIMARY_ITEM_NAME, nodeTypeDefinition.getPrimaryItemName());
        }

        return nodeTypeNode;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Didymosphaeria atropunctata Tochinai & Yamagiwa

### Remarks
null


text:
import OdoDevice from '@odopod/odo-device';
import events from './events';
import {
  clearTransition,
  getElement,
  getFakeEvent,
  isOwnEvent,
  isSameTransitionProperty,
  saveTransition,
} from './_animation-utils';

export default function onTransitionEnd(
  elem,
  fn,
  context = window,
  property = null,
  timeout = null,
) {
  const element = getElement(elem);

  const callback = fn.bind(context);
  let timerId;

  /**
   * @param {TransitionEvent|{target: Element, currentTarget: Element}} evt Event object.
   */

  function transitionEnded(evt) {
    // Some other element's transition event could have bubbled up to this.
    // or
    // If the optional property exists and it's not the property which was
    // transitioned, exit out of the function and continue waiting for the
    // right transition property.
    if (!isOwnEvent(evt) || !isSameTransitionProperty(evt, property)) {
      return;
    }

    // Remove from active transitions.
    clearTransition(transitionId); // eslint-disable-line no-use-before-define

    // If the browser has transitions, there will be a listener bound to the
    // `transitionend` event which needs to be removed.
    if (OdoDevice.HAS_TRANSITIONS) {
      evt.currentTarget.removeEventListener(events.TRANSITIONEND, transitionEnded);
    }

    // Done!
    callback(evt);
    clearTimeout(timerId);
  }

  if (OdoDevice.HAS_TRANSITIONS) {
    element.addEventListener(events.TRANSITIONEND, transitionEnded);

    // Sometimes the transition end event doesn't fire, usually when
    // properties don't change or when iOS decides to just snap instead of
    // transition. To get around this, a timer is set which will trigger the
    // fake event.
    if (timeout) {
      timerId = setTimeout(() => {
        transitionEnded(getFakeEvent(element));
      }, timeout);
    }
  } else {
    // Push to the end of the queue with a fake event which will pass the checks
    // inside the callback function.
    timerId = setTimeout(() => {
      transitionEnded(getFakeEvent(element));
    }, 0);
  }

  // Save this active transition end listener so it can be canceled.
  const transitionId = saveTransition(element, timerId, transitionEnded);

  // Return id used to cancel the transition end listener, similar to setTimeout
  // and requestAnimationFrame.
  return transitionId;
}


text:
package org.apache.lenya.cms.publication;

public interface ResourceTypeResolver {

    boolean existsResourceType(String name);

    ResourceType getResourceType(String name);

}


text:
package com.nonagon.modular.dynamicform.client;

import java.util.Date;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;

public class FormRevision extends JavaScriptObject {

	public static FormRevision create() {

		FormRevision instance = ((FormRevision)JavaScriptObject.createObject());
		instance.init();

		return instance;
	}

	protected final native void init()/*-{

		this.__type = "Nonagon.Modular.DynamicForm.FormRevision, Nonagon.Modular.DynamicForm";
	}-*/;

	protected FormRevision() {}

	public final native int getId()/*-{ return this.Id; }-*/;
	public final native int getFormId()/*-{ return this.FormId; }-*/;

	public final native int getVersion()/*-{ return this.Version; }-*/;
	public final native void setVersion(int value)/*-{ this.Version = value; }-*/;

	public final native String getOutput()/*-{ return this.Output; }-*/;
	public final native void setOutput(String value)/*-{ this.Output = value; }-*/;

	public final native FormTemplate getTemplate()/*-{ return this.Template; }-*/;
	public final native void setTemplate(FormTemplate value)/*-{ this.Template = value; }-*/;

	public final native JsArray<FormField> getFields()/*-{ return this.Fields; }-*/;
	public final native void setFields(JsArray<FormField> value)/*-{ this.Fields = value; }-*/;

	public final FormStatus getFormStatus() {

		String formStatus = jsniGetFormStatus();
		return FormStatus.fromString(formStatus);
	}

	public final void setFormStatus(FormStatus value) {

		String formStatus = FormStatus.fromEnum(value);
		jsniSetFormStatus(formStatus);
	}

	public final Date getCreatedDate() { return new Date((long)jsniGetCreatedDate()); }
	public final Date getLastUpdatedDate() { return new Date((long)jsniGetLastUpdatedDate()); }

	private final native String jsniGetFormStatus()/*-{ return this.Status; }-*/;
	private final native void jsniSetFormStatus(String value)/*-{ this.Status = value; }-*/;

	private final native double jsniGetCreatedDate() /*-{ return Date.parse(this.CreatedDate); }-*/;
	private final native double jsniGetLastUpdatedDate() /*-{ return Date.parse(this.LastUpdatedDate); }-*/;
}


text:
#ifndef QLINEEDIT_H
#define QLINEEDIT_H

#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qframe.h>
#include <QtGui/qtextcursor.h>
#include <QtCore/qstring.h>
#include <QtCore/qmargins.h>

QT_BEGIN_NAMESPACE

#ifndef QT_NO_LINEEDIT

class QValidator;
class QMenu;
class QLineEditPrivate;
class QCompleter;
class QStyleOptionFrame;
class QAbstractSpinBox;
class QDateTimeEdit;
class QIcon;
class QToolButton;

class Q_WIDGETS_EXPORT QLineEdit : public QWidget
{
    Q_OBJECT

    Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask)
    Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true)
    Q_PROPERTY(int maxLength READ maxLength WRITE setMaxLength)
    Q_PROPERTY(bool frame READ hasFrame WRITE setFrame)
    Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode)
    Q_PROPERTY(QString displayText READ displayText)
    Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition)
    Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
    Q_PROPERTY(bool modified READ isModified WRITE setModified DESIGNABLE false)
    Q_PROPERTY(bool hasSelectedText READ hasSelectedText)
    Q_PROPERTY(QString selectedText READ selectedText)
    Q_PROPERTY(bool dragEnabled READ dragEnabled WRITE setDragEnabled)
    Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
    Q_PROPERTY(bool undoAvailable READ isUndoAvailable)
    Q_PROPERTY(bool redoAvailable READ isRedoAvailable)
    Q_PROPERTY(bool acceptableInput READ hasAcceptableInput)
    Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText)
    Q_PROPERTY(Qt::CursorMoveStyle cursorMoveStyle READ cursorMoveStyle WRITE setCursorMoveStyle)
    Q_PROPERTY(bool clearButtonEnabled READ isClearButtonEnabled WRITE setClearButtonEnabled)
public:
    enum ActionPosition {
        LeadingPosition,
        TrailingPosition
    };
    Q_ENUM(ActionPosition)

    explicit QLineEdit(QWidget *parent = Q_NULLPTR);
    explicit QLineEdit(const QString &, QWidget *parent = Q_NULLPTR);
    ~QLineEdit();

    QString text() const;

    QString displayText() const;

    QString placeholderText() const;
    void setPlaceholderText(const QString &);

    int maxLength() const;
    void setMaxLength(int);

    void setFrame(bool);
    bool hasFrame() const;

    void setClearButtonEnabled(bool enable);
    bool isClearButtonEnabled() const;

    enum EchoMode { Normal, NoEcho, Password, PasswordEchoOnEdit };
    Q_ENUM(EchoMode)
    EchoMode echoMode() const;
    void setEchoMode(EchoMode);

    bool isReadOnly() const;
    void setReadOnly(bool);

#ifndef QT_NO_VALIDATOR
    void setValidator(const QValidator *);
    const QValidator * validator() const;
#endif

#ifndef QT_NO_COMPLETER
    void setCompleter(QCompleter *completer);
    QCompleter *completer() const;
#endif

    QSize sizeHint() const Q_DECL_OVERRIDE;
    QSize minimumSizeHint() const Q_DECL_OVERRIDE;

    int cursorPosition() const;
    void setCursorPosition(int);
    int cursorPositionAt(const QPoint &pos);

    void setAlignment(Qt::Alignment flag);
    Qt::Alignment alignment() const;

    void cursorForward(bool mark, int steps = 1);
    void cursorBackward(bool mark, int steps = 1);
    void cursorWordForward(bool mark);
    void cursorWordBackward(bool mark);
    void backspace();
    void del();
    void home(bool mark);
    void end(bool mark);

    bool isModified() const;
    void setModified(bool);

    void setSelection(int, int);
    bool hasSelectedText() const;
    QString selectedText() const;
    int selectionStart() const;

    bool isUndoAvailable() const;
    bool isRedoAvailable() const;

    void setDragEnabled(bool b);
    bool dragEnabled() const;

    void setCursorMoveStyle(Qt::CursorMoveStyle style);
    Qt::CursorMoveStyle cursorMoveStyle() const;

    QString inputMask() const;
    void setInputMask(const QString &inputMask);
    bool hasAcceptableInput() const;

    void setTextMargins(int left, int top, int right, int bottom);
    void setTextMargins(const QMargins &margins);
    void getTextMargins(int *left, int *top, int *right, int *bottom) const;
    QMargins textMargins() const;

    using QWidget::addAction;
    void addAction(QAction *action, ActionPosition position);
    QAction *addAction(const QIcon &icon, ActionPosition position);

public Q_SLOTS:
    void setText(const QString &);
    void clear();
    void selectAll();
    void undo();
    void redo();
#ifndef QT_NO_CLIPBOARD
    void cut();
    void copy() const;
    void paste();
#endif

public:
    void deselect();
    void insert(const QString &);
#ifndef QT_NO_CONTEXTMENU
    QMenu *createStandardContextMenu();
#endif

Q_SIGNALS:
    void textChanged(const QString &);
    void textEdited(const QString &);
    void cursorPositionChanged(int, int);
    void returnPressed();
    void editingFinished();
    void selectionChanged();

protected:
    void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
    void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
    void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
    void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE;
    void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
    void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE;
    void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE;
    void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
#ifndef QT_NO_DRAGANDDROP
    void dragEnterEvent(QDragEnterEvent *) Q_DECL_OVERRIDE;
    void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
    void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
    void dropEvent(QDropEvent *) Q_DECL_OVERRIDE;
#endif
    void changeEvent(QEvent *) Q_DECL_OVERRIDE;
#ifndef QT_NO_CONTEXTMENU
    void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE;
#endif

    void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
    void initStyleOption(QStyleOptionFrame *option) const;
public:
    QVariant inputMethodQuery(Qt::InputMethodQuery) const Q_DECL_OVERRIDE;
    Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const;
    bool event(QEvent *) Q_DECL_OVERRIDE;
protected:
    QRect cursorRect() const;

public:

private:
    friend class QAbstractSpinBox;
    friend class QAccessibleLineEdit;
#ifdef QT_KEYPAD_NAVIGATION
    friend class QDateTimeEdit;
#endif
    Q_DISABLE_COPY(QLineEdit)
    Q_DECLARE_PRIVATE(QLineEdit)
    Q_PRIVATE_SLOT(d_func(), void _q_handleWindowActivate())
    Q_PRIVATE_SLOT(d_func(), void _q_textEdited(const QString &))
    Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged(int, int))
#ifndef QT_NO_COMPLETER
    Q_PRIVATE_SLOT(d_func(), void _q_completionHighlighted(const QString &))
#endif
#ifdef QT_KEYPAD_NAVIGATION
    Q_PRIVATE_SLOT(d_func(), void _q_editFocusChange(bool))
#endif
    Q_PRIVATE_SLOT(d_func(), void _q_selectionChanged())
    Q_PRIVATE_SLOT(d_func(), void _q_updateNeeded(const QRect &))
    Q_PRIVATE_SLOT(d_func(), void _q_textChanged(const QString &))
    Q_PRIVATE_SLOT(d_func(), void _q_clearButtonClicked())
};

#endif // QT_NO_LINEEDIT

QT_END_NAMESPACE

#endif // QLINEEDIT_H


text:
package com.intellij.openapi.updateSettings.impl;

public enum ChannelStatus {
  EAP("eap", "Early Access Program"),
  MILESTONE("milestone", "Milestone EAP Builds"),
  BETA("beta", "Beta Releases or Public Previews"),
  RELEASE("release", "Stable Releases");

  private final String myCode;
  private final String myDisplayName;

  ChannelStatus(String code, String displayName) {
    myCode = code;
    myDisplayName = displayName;
  }

  public static ChannelStatus fromCode(String code) {
    for (ChannelStatus type : values()) {
      if (type.getCode().equalsIgnoreCase(code)) {
        return type;
      }
    }
    return RELEASE;
  }

  public String getCode() {
    return myCode;
  }

  public String getDisplayName() {
    return myDisplayName;
  }

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


text:
Agile tools for development teams!

### Theme
Proudly using the wonderful theme [Blur Admin](https://github.com/akveo/blur-admin) by [Akveo team](http://akveo.com/).

License
-------------
MIT license.


text:
namespace ui {
class KeyEvent;
class TouchEvent;
}  // namespace ui

namespace ash {

class TouchCalibratorView;

// TouchCalibratorController is responsible for managing the touch calibration
// process. In case of native touch calibration it is also responsible for
// collecting the touch calibration associated data from the user. It
// instantiates TouchCalibratorView classes to present the native UX interface
// the user can interact with for calibration.
// This controller ensures that only one instance of calibration is running at
// any given time.
class ASH_EXPORT TouchCalibratorController
    : public ui::EventHandler,
      public WindowTreeHostManager::Observer {
 public:
  using CalibrationPointPairQuad =
      display::TouchCalibrationData::CalibrationPointPairQuad;
  using TouchCalibrationCallback = base::OnceCallback<void(bool)>;

  static const base::TimeDelta kTouchIntervalThreshold;

  TouchCalibratorController();

  TouchCalibratorController(const TouchCalibratorController&) = delete;
  TouchCalibratorController& operator=(const TouchCalibratorController&) =
      delete;

  ~TouchCalibratorController() override;

  // ui::EventHandler
  void OnKeyEvent(ui::KeyEvent* event) override;
  void OnTouchEvent(ui::TouchEvent* event) override;

  // WindowTreeHostManager::Observer
  void OnDisplayConfigurationChanged() override;

  // Starts the calibration process for the given |target_display|.
  // |opt_callback| is an optional callback that if provided is executed
  // with the success or failure of the calibration as a boolean argument.
  void StartCalibration(const display::Display& target_display,
                        bool is_custom_calibration,
                        TouchCalibrationCallback opt_callback);

  // Stops any ongoing calibration process. This is a hard stop which does not
  // save any calibration data. Call CompleteCalibration() if you wish to save
  // calibration data.
  void StopCalibrationAndResetParams();

  // Completes the touch calibration by storing the calibration data for the
  // display.
  void CompleteCalibration(const CalibrationPointPairQuad& pairs,
                           const gfx::Size& display_size);

  // Returns true if any type of touch calibration is active.
  bool IsCalibrating() const;

 private:
  friend class TouchCalibratorControllerTest;
  FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest, TouchThreshold);
  FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest, CustomCalibration);
  FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest,
                           CustomCalibrationInvalidTouchId);
  FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest,
                           InternalTouchDeviceIsRejected);

  enum class CalibrationState {
    // Indicates that the touch calibration is currently active with the built
    // in native UX.
    kNativeCalibration = 0,

    // Indicates that the touch calibration is currently active with a custom
    // UX via the extensions API.
    kCustomCalibration,

    // Indicates that touch calibration is currently inactive.
    kInactive
  };

  CalibrationState state_ = CalibrationState::kInactive;

  // A map for TouchCalibrator view with the key as display id of the display
  // it is present in.
  std::map<int64_t, views::UniqueWidgetPtr> touch_calibrator_widgets_;

  // The display which is being calibrated by the touch calibrator controller.
  // This is valid only if |is_calibrating| is set to true.
  display::Display target_display_;

  // During calibration this stores the timestamp when the previous touch event
  // was received.
  base::Time last_touch_timestamp_;

  // This is populated during calibration, based on the source id of the device
  // the events are originating from.
  int touch_device_id_ = ui::InputDevice::kInvalidId;

  // A set of ids that belong to touch devices associated with the internal
  // display and are of type |ui::InputDeviceType::INPUT_DEVICE_INTERNAL|. This
  // is only valid when |state_| is not |kInactive|.
  std::set<int> internal_touch_device_ids_;

  // An array of Calibration point pairs. This stores all the 4 display and
  // touch input point pairs that will be used for calibration.
  CalibrationPointPairQuad touch_point_quad_;

  // A callback to be called when touch calibration completes.
  TouchCalibrationCallback opt_callback_;

  // The touch device under calibration may be re-associated to another display
  // during calibration. In such a case, the events originating from the touch
  // device are tranformed based on parameters of the previous display it was
  // linked to. We need to undo these transformations before recording the event
  // locations.
  gfx::Transform event_transformer_;
};

}  // namespace ash
#endif  // ASH_DISPLAY_TOUCH_CALIBRATOR_CONTROLLER_H_


text:
package org.apache.ambari.server.stack.upgrade;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

import org.apache.ambari.server.stack.upgrade.orchestrate.StageWrapper;

/**
 * Identifies that an upgrade step that requires confirmation before continuing.
 */
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="server_action")
public class ServerActionTask extends ServerSideActionTask {

  @XmlTransient
  private Type type = Type.SERVER_ACTION;

  @Override
  public Type getType() {
    return type;
  }

  @Override
  public StageWrapper.Type getStageWrapperType() {
    return StageWrapper.Type.SERVER_SIDE_ACTION;
  }
}


text:
require "httparty"
require "logger"
require "json"

require "this_data/rule"
require "this_data/event"
require "this_data/version"
require "this_data/verbs"
require "this_data/client"
require "this_data/configuration"
require "this_data/track_request"
require "util/nested_struct"

module ThisData

  # API Endpoint Paths
  EVENTS_ENDPOINT   = '/events'
  VERIFY_ENDPOINT   = '/verify'
  RULES_ENDPOINT    = '/rules'

  # Risk level constants, defined at http://help.thisdata.com/docs/apiv1verify#what-does-the-risk_level-mean
  RISK_LEVEL_GREEN  = 'green'
  RISK_LEVEL_ORANGE = 'orange'
  RISK_LEVEL_RED    = 'red'

  class << self

    # Configuration Object (instance of ThisData::Configuration)
    attr_writer :configuration

    def setup
      yield(configuration)
    end

    def configuration
      @configuration ||= ThisData::Configuration.new
    end

    def default_configuration
      configuration.defaults
    end

    # Tracks a user initiated event which has occurred within your app, e.g.
    # a user logging in.
    #
    # Performs asynchronously if ThisData.configuration.async is true.
    #
    # Parameters:
    # - event       (Required: Hash) a Hash containing details about the event.
    #               See http://help.thisdata.com/v1.0/docs/apiv1events for a
    #               full & current list of available options.
    def track(event, options={})
      if ThisData.configuration.async
        track_async(event, options)
      else
        track_with_response(event, options)
      end
    end

    # Verify asks ThisData's API "is this request really from this user?",
    # and returns a response with a risk score.
    #
    # Note: this method does not perform error handling.
    #
    # Parameters:
    # - params      (Required: Hash) a Hash containing details about the current
    #               request & user.
    #               See http://help.thisdata.com/docs/apiv1verify for a
    #               full & current list of available options.
    #
    # Returns a Hash
    def verify(params, options={})
      response = Client.new.post(
        ThisData::VERIFY_ENDPOINT,
        body: JSON.generate(params),
        query: options
      )
      response.parsed_response
    end

    # A helper method to track a log-in event. Validates that the minimum
    # required data is present.
    def track_login(ip: '', user: {}, user_agent: nil)
      raise ArgumentError, "IP Address is required" unless ip.length
      raise ArgumentError, "User needs ID value" unless user[:id].to_s.length
      track({
        verb: ThisData::Verbs::LOG_IN,
        ip: ip,
        user_agent: user_agent,
        user: user
      })
    end

    def log(message, level: 'info', prefix: true)
      if prefix
        message = "[ThisData] " + message.to_s
      end
      configuration.logger.send(level, message) if configuration.logger
    end
    def warn(message, prefix: true)
      log(message, level: 'warn', prefix: prefix)
    end
    def error(message, prefix: true)
      log(message, level: 'error', prefix: prefix)
    end

    private

      # Creates a Client and tracks an event.
      # Event must be a Hash.
      # Rescues and logs all exceptions.
      # Returns an HTTPResponse
      def track_with_response(event, options={})
        response = Client.new.track(event, options)
        success = response && response.success? # HTTParty doesn't like `.try`
        if success
          log("Tracked event! #{response.response.inspect}")
        else
          warn("Track failure! #{response.response.inspect} #{response.body}")
        end
        response
      rescue => e
        ThisData.error("Failed to track event:")
        ThisData.error(e)
        e.backtrace.each do |line|
          ThisData.error(line, prefix: false)
        end
        false
      end

      # Performs the track function within a new Thread, so it is non blocking.
      # Returns the Thread created
      def track_async(event, options={})
        Thread.new do
          track_with_response(event, options)
        end
      rescue => e
        ThisData.error("Cannot create Thread: #{e.inspect}")
        false
      end

  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2020 The Android Open Source Project

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

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

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

<resources>
    <string name="app_name" translatable="false">Example Watchfaces</string>
    <string name="canvas_analog_watch_face_name"
        translatable="false">Example Analog Watchface</string>
    <string name="canvas_digital_watch_face_name"
        translatable="false">Example Digital Watchface</string>
    <string name="gl_watch_face_name" translatable="false">Example OpenGL Watchface</string>
    <string name="gl_background_init_watch_face_name"
        translatable="false">Background Init Watchface</string>
    <string name="hierarchical_watch_face_name"
        translatable="false">Hierarchical Watchface (Needs T)</string>

    <!-- Name of watchface style [CHAR LIMIT=20] -->
    <string name="red_style_name">Red Style</string>

    <!-- Name of watchface style [CHAR LIMIT=20] -->
    <string name="green_style_name">Green Style</string>

    <!-- Name of watchface style [CHAR LIMIT=20] -->
    <string name="yellow_style_name">Yellow Style</string>

    <!-- Name of watchface style category for selecting the color theme [CHAR LIMIT=20] -->
    <string name="colors_style_setting">Colors</string>

    <!-- Subtitle for the menu option to select the watch face color theme [CHAR LIMIT=20] -->
    <string name="colors_style_setting_description">Watchface colorization</string>

    <!-- An option within the watch face color style theme settings [CHAR LIMIT=20] -->
    <string name="colors_style_red">Red</string>

    <!-- An option within the watch face color style theme settings [CHAR LIMIT=20] -->
    <string name="colors_style_green">Green</string>

    <!-- An option within the watch face color style theme settings [CHAR LIMIT=20] -->
    <string name="colors_style_blue">Blue</string>

    <!-- An option within the watch face color style theme settings [CHAR LIMIT=20] -->
    <string name="colors_style_yellow">Yellow</string>

    <!-- An option within the watch face color style theme settings -->
    <string name="colors_style_red_screen_reader">Red color theme</string>

    <!-- An option within the watch face color style theme settings -->
    <string name="colors_style_green_screen_reader">Green color theme</string>

    <!-- An option within the watch face color style theme settings -->
    <string name="colors_style_blue_screen_reader">Blue color theme</string>

    <!-- An option within the watch face color style theme settings -->
    <string name="colors_style_yellow_screen_reader">Yellow color theme</string>

    <!-- Name of watchface style category for selecting the hand style [CHAR LIMIT=20] -->
    <string name="hand_style_setting" translatable="false">Hand Style</string>

    <!-- Subtitle for the menu option to select the watch face hand style [CHAR LIMIT=20] -->
    <string name="hand_style_setting_description" translatable="false">Hand visual look</string>

    <!-- An option with the watch face hand style settings [CHAR LIMIT=20] -->
    <string name="hand_style_classic" translatable="false">Classic</string>

    <!-- An option with the watch face hand style settings  for use by screen readers -->
    <string name="hand_style_classic_screen_reader" translatable="false">Classic watch hand
    style</string>

    <!-- An option with the watch face hand style settings [CHAR LIMIT=20] -->
    <string name="hand_style_modern" translatable="false">Modern</string>

    <!-- An option with the watch face hand style settings  for use by screen readers -->
    <string name="hand_style_modern_screen_reader" translatable="false">Modern watch hand
    style</string>

    <!-- An option with the watch face hand style settings [CHAR LIMIT=20] -->
    <string name="hand_style_gothic" translatable="false">Gothic</string>

    <!-- An option with the watch face hand style settings for use by screen readers -->
    <string name="hand_style_gothic_screen_reader" translatable="false">Gothic watch hand
    style</string>

    <!-- An option within the analog watch face to draw pips to mark each hour [CHAR LIMIT=20] -->
    <string name="watchface_pips_setting">Hour Pips</string>

    <!-- Subtitle for the menu option to configure if we should draw pips to mark each hour
     on the watch face [CHAR LIMIT=20] -->
    <string name="watchface_pips_setting_description">Whether to draw or not</string>

    <!-- A menu option to select a widget that lets us configure the length of the watch hands
    [CHAR LIMIT=20] -->
    <string name="watchface_hand_length_setting">Hand length</string>

    <!-- Sub title for the menu option to select a widget that lets us configure the length of the
    watch hands [CHAR LIMIT=20] -->
    <string name="watchface_hand_length_setting_description">Scale of watch hands</string>

    <!-- A menu option to select a widget that lets us configure the Complications (a watch
    making term) [CHAR LIMIT=20] -->
    <string name="watchface_complications_setting">Complications</string>

    <!-- Sub title for the menu option to select a widget that lets us configure the Complications
    (a watch making term) [CHAR LIMIT=20] -->
    <string name="watchface_complications_setting_description">Number and position</string>

    <!-- Menu option within the complications configuration widget that lets us select both
    the left and the right complication for rendering. [CHAR LIMIT=20] -->
    <string name="watchface_complications_setting_both">Both</string>

    <!-- Menu option within the complications configuration widget that lets us select no
    complications for rendering. [CHAR LIMIT=20] -->
    <string name="watchface_complications_setting_none">None</string>

    <!-- Menu option within the complications configuration widget that lets us select only the left
    complication for rendering. [CHAR LIMIT=20] -->
    <string name="watchface_complications_setting_left">Left</string>

    <!-- Menu option within the complications configuration widget that lets us select only the
    right complication for rendering. [CHAR LIMIT=20] -->
    <string name="watchface_complications_setting_right">Right</string>

    <!-- Menu option to select a widget that lets us configure the frequency of hours labeling
    [CHAR LIMIT=20] -->
    <string name="watchface_draw_hours_freq_setting">Hours labeling</string>

    <!-- Sub title for the menu option to select a widget that lets us configure the frequency of
    hours labeling [CHAR LIMIT=20] -->
    <string name="watchface_draw_hours_freq_setting_description">Labeling frequency</string>

    <!-- Menu option to select a widget that lets us configure whether to show hour pips
    [CHAR LIMIT=20] -->
    <string name="watchface_draw_hours_setting">Hour pips</string>

    <!-- Sub title for the menu option to select a widget that lets us configure whether to show
    hour pips [CHAR LIMIT=20] -->
    <string name="watchface_draw_hours_setting_description">Display on/off</string>

    <!-- Name of the left complication for use visually in the companion editor. [CHAR LIMIT=20] -->
    <string name="left_complication_screen_name">Left</string>

    <!-- Name of the left complication for use by in the companion editor screen reader. -->
    <string name="left_complication_screen_reader_name">Left complication.</string>

    <!-- Name of the right complication for use visually in the companion editor.
    [CHAR LIMIT=20] -->
    <string name="right_complication_screen_name">Right</string>

    <!-- Name of the right complication for use by the companion editor screen reader. -->
    <string name="right_complication_screen_reader_name">Right complication.</string>

    <!-- Name of a complication at the top of the screen, for use visually in the companion editor.
    [CHAR LIMIT=20] -->
    <string name="upper_complication_screen_name">Upper</string>

    <!-- Name of a complication at the top of the screen, for use by the companion editor screen
    reader. -->
    <string name="upper_complication_screen_reader_name">Upper complication.</string>

    <!-- Name of a complication at the bottom of the screen, for use visually in the companion
    editor. [CHAR LIMIT=20] -->
    <string name="lower_complication_screen_name">Lower</string>

    <!-- Name of a complication at the bottom of the screen, for use by the companion editor screen
    reader. -->
    <string name="lower_complication_screen_reader_name">Lower complication.</string>

    <!-- Name of the optional background complication which is drawn behind the watchface, for use
    visually in the companion editor. [CHAR LIMIT=20] -->
    <string name="background_complication_screen_name">Background</string>

    <!-- Name of the optional background complication which is drawn behind the watchface, for use
    by the companion editor screen reader. -->
    <string name="background_complication_screen_reader_name">Background complication.</string>

    <!-- Name of a style that controls the appearance of a digital clock [CHAR LIMIT=20] -->
    <string name="digital_clock_style_name">Clock style</string>

    <!-- Sub title for the menu option to select a widget that lets us configure the style of a
    digital watch [CHAR LIMIT=20] -->
    <string name="digital_clock_style_description">Clock style setting</string>

    <!-- Menu option for a 12 hour digital clock display. [CHAR LIMIT=20] -->
    <string name="digital_clock_style_12">12</string>

    <!-- Menu option for a 12 hour digital clock display. [CHAR LIMIT=20] -->
    <string name="digital_clock_style_12_screen_reader">12 hour clock</string>

    <!-- Menu option for a 24 hour digital clock display used by screen reader. -->
    <string name="digital_clock_style_24">24</string>

    <!-- Menu option for a 24 hour digital clock display used by screen reader.-->
    <string name="digital_clock_style_24_screen_reader">24 hour clock</string>

    <!-- Menu option for selecting a digital clock [CHAR LIMIT=20] -->
    <string name="style_digital_watch">Digital</string>

    <!-- Menu option for selecting a digital clock from a screen reader. -->
    <string name="style_digital_watch_screen_reader">Digital watch style</string>

    <!-- Menu option for selecting an analog clock [CHAR LIMIT=20] -->
    <string name="style_analog_watch">Analog</string>

    <!-- Menu option for selecting an analog clock  from a screen reader.-->
    <string name="style_analog_watch_screen_reader">Analog watch style </string>

    <!-- Title for the menu option to select an analog or digital clock [CHAR LIMIT=20] -->
    <string name="clock_type">Clock type</string>

    <!-- Sub title for the menu option to select an analog or digital clock [CHAR LIMIT=20] -->
    <string name="clock_type_description">Select analog or digital</string>

    <!-- A menu option to select a widget that lets us configure the Complications (a watch
    making term) for the digital watch [CHAR LIMIT=20] -->
    <string name="digital_complications_setting">Complication</string>

    <!-- Sub title for the menu option to select a widget that lets us configure the Complications
    (a watch making term) for the digital watch [CHAR LIMIT=20] -->
    <string name="digital_complications_setting_description">On or off</string>

    <!-- List entry, enabling the complication for the digital watch. [CHAR LIMIT=20] -->
    <string name="digital_complication_on_screen_name">On</string>

    <!-- List entry, disabling the complication for the digital watch. [CHAR LIMIT=20] -->
    <string name="digital_complication_off_screen_name">Off</string>

    <!-- List entry setting the number of complications enabled for the analog watch.
    [CHAR LIMIT=20] -->
    <string name="analog_complication_one_screen_name">One</string>

    <!-- List entry setting the number of complications enabled for the analog watch.
    [CHAR LIMIT=20] -->
    <string name="analog_complication_two_screen_name">Two</string>

    <!-- List entry setting the number of complications enabled for the analog watch.
    [CHAR LIMIT=20] -->
    <string name="analog_complication_three_screen_name">Three</string>

    <!-- Name of a complication at the top of the screen, for use visually in the companion editor.
    [CHAR LIMIT=20] -->
    <string name="hierarchical_complication1_screen_name">Top</string>

    <!-- Name of a complication at the top of the screen, for use by the companion editor screen
    reader. -->
    <string name="hierarchical_complication1_screen_reader_name">Top complication</string>

    <!-- Name of a complication at the middle of the screen, for use visually in the companion editor.
    [CHAR LIMIT=20] -->
    <string name="hierarchical_complication2_screen_name">Middle</string>

    <!-- Name of a complication at the middle of the screen, for use by the companion editor screen
    reader. -->
    <string name="hierarchical_complication2_screen_reader_name">Middle complication</string>

    <!-- Name of a complication at the bottom of the screen, for use visually in the companion editor.
    [CHAR LIMIT=20] -->
    <string name="hierarchical_complication3_screen_name">Bottom</string>

    <!-- Name of a complication at the bottom of the screen, for use by the companion editor screen
    reader. -->
    <string name="hierarchical_complication3_screen_reader_name">Bottom complication</string>

</resources>


text:
var fs = require("fs");
var Path = require('path');
var stripJsonComments = require("strip-json-comments");
var jsonFormat = require('json-format');
//var _ = require('underscore');
var Bcrypt = require("bcrypt");
var changeCase = require("change-case-keys");

var rootPath = Path.normalize(__dirname + "/../../..");
var dataPath = rootPath + "/database/initial-data/users.json";

var BaseC = require(rootPath + "/server/models/base-model.js").collection;
var baseC = new BaseC();

// populate users
var usersArray = JSON.parse( stripJsonComments( fs.readFileSync(dataPath, "utf-8") ) );

usersArray.forEach(function(obj){
	if(!obj.pwHash){ throw new Error("missing password"); }

	obj.pwHash = Bcrypt.hashSync(obj.pwHash, 10);
});

changeCase(usersArray, "underscored", 2);
var dbData = JSON.stringify(usersArray);

console.log("db data: ", JSON.stringify(baseC.toJSON()));

var promise =
	baseC.execute({
		query: {
	        command: "select * from users_create($1);",
		  	arguments: dbData
		}
	})
	.then(
		function(resp){
			console.log("Users table has been populated.");
			console.log(jsonFormat(baseC.toJSON()));
			return resp;
		},
	    function(err){
			throw err;
	    }
	)
	.finally(function(){ baseC.disconnect(); });

module.exports = promise;


text:
/**
* Utility methods for OpenPhoto - this will include the entire framework
* And ability to swap frameworks (YUI or jQuery) in and out.
*/
(function() {

    // just make sure that OP, the global namespace for OpenPhoto
    // is defined
    if ( typeof(OP) === "undefined") {
        OP = {};
    }

    //constants
    var PLUGIN_FILE_PREFIX = 'openphoto-lib-';

    /**
    * Class that contains all utility functions for OpenPhoto
    * We can use a Constructor function in this case since we will
    * not have multiple instances of Util.  Also, it makes it easier to
    * extend via prototype.
    * @class Util
    */
    function Util() {

        /**
        * default configuration options
        * user can optionally specify an onComplete attribute in the css/js
        * object which will execute when the assets are loaded.
        * @type {object}
        * @property config
        */
        this.config = {
            baseUrl: '',
            jsLocation: '/assets/javascripts/',
            css: {
                assets: []
            },
            js: {
                assets:[]
            }
        };

        /**
        * the event map for click events, maps the HTML
        * classNames to the custom event names
        * @type {object}
        * @property eventMap
        */
        this.eventMap = {};

        /**
        * A hash of custom events
        * @type {object}
        * @property _customEvents
        */
        this._customEvents = {};

        /**
        * Count of the number of scripts loaded
        * @type {Number}
        * @property _scriptLoadCount
        */
        this._scriptLoadCount = 0;

        /**
        * Count of the number of css loaded
        * @type {Number}
        * @property _cssLoadCount
        */
        this._cssLoadCount = 0;

        /**
        * initialization method
        * @param {object} lib - the library to use
        * @param {object} config - the configuration object
        * @method init
        */
        this.init = function(lib, config) {

            OP.Log.info('[Util] init:');

            //merge the config with the user specified config
            this.config = this.merge(this.config, config);

            // we specify what library type in the .ini file
            // either jQuery or YUI - and then the user can load
            // additional css/js assets by specifying the files in the
            // js config - as specified by the plugin file (that will be user generated).

            //the library is a requirement, by default jQuery will be loaded
            this.lib = lib;
            this.libType = this.detectLibrary();

            // get the library plugin file that maps library functions to a normalized
            // naming so that we can use whatever library that is specified
            this.getLibraryPlugin();
        };

        this.addEventMap = function(eventMap) {
          this.eventMap = eventMap;
          for (var eType in this.eventMap) {
            if (this.eventMap.hasOwnProperty(eType)) {
              this.eventMap[eType] = this.merge(this.eventMap[eType], this.eventMap[eType]);
            }
          }
        };

        /**
        * Now that the library plugin has been loaded, we add all event handlers
        * @return {void}
        * @method _init
        */
        this._init = function() {

            OP.Log.info('[Util] _init:')

            var js = this.config.js.assets,
                css = this.config.css.assets,
                i,
                length;

            //attach events
            this.attachEvent( 'body', 'click', this.onviewevent, this);
            this.attachEvent( 'body', 'focus', this.onviewevent, this);
            this.attachEvent( 'body', 'change', this.onviewevent, this);
            this.attachEvent( 'body', 'mouseover', this.onmouseevent, this);
            this.attachEvent( 'body', 'mouseout', this.onmouseevent, this);
            this.attachEvent( 'html', 'keydown', this.onkeydownevent, this);
            this.attachEvent( 'html', 'keyup', this.onkeydownevent, this);
            this.attachEvent( 'form', 'submit', this.onviewevent, this);

            //load additional js in order specified
            for(i=0, j=js.length; i<j; i++) {
                this.loadScript( js[i], this._handleScriptLoad, this );
            }

            //load additional css in order specified
            for(i=0, j=css.length; i<j; i++) {
                this.loadCss( css[i], this._handleCssLoad, this );
            }

        };

        /**
        * handles events - delegates based on className
        * @param {Event} e
        * @return {void}
        * @method onviewevent
        */
        this.onviewevent = function(e) {
            OP.Log.info('[Util] ' + e.type + ': ' + e.target);

            var targ = e.target || e.srcElement,
                classes = targ.className.split(" "),
                length = classes.length,
                map = this.eventMap[e.type],
                cls;

            while (length--) {
                cls = classes[length];
                if (map !== undefined && map[cls]) {
                    //do not prevent the default action, let the callback
                    //function do it if it wants
                    map[cls](e, targ);
                }
            }
        };

        /**
        * handles keydown events
        * @param {Event} e
        * @return {void}
        * @method onkeydownevent
        */
        this.onkeydownevent = function(e) {
            OP.Log.info('[Util] ' + e.type + ': ' + e.target);

            var targ = e.target || e.srcElement,
                classes = targ.className.split(" "),
                length = classes.length,
                map = this.eventMap[e.type],
                nodeName = targ.nodeName.toLowerCase(),
                keyCode = e.keyCode,
                cls;

            if (nodeName === "textarea" || nodeName === "input") {

                //i don't think there is a case where the user needs to know
                //if the user is inputing text, but just in case, lets fire
                //a custom event on user input
                this.fire( 'keydown:user-input', e);

            } else {

                //the event map for key press can be two dimensional, it can be
                //keycode, or className then keyCode, if keyCode, fire the custom event
                if (typeof(map) === 'object' && map[keyCode]) {
                    this.fire( map[keyCode], e);
                }

                //both className and keycode
                while (length--) {
                    cls = classes[length];
                    if (map !== undefined && map[cls] && map[cls][keyCode]) {
                        //do not prevent the default action, let the callback
                        //function do it if it wants
                        this.fire( map[cls][keyCode], e);
                    }
                }

            }

        };

        /**
        * handles mouseover/mouseout events
        * @param {Event} e
        * @return {void}
        * @method onkeydownevent
        */
        this.onmouseevent = function(e) {

            //OP.Log.info('[Util] ' + e.type + ': ' + e.target);

            var targ = e.target || e.srcElement,
                classes = targ.className.split(" "),
                length = classes.length,
                map = this.eventMap[e.type],
                cls;

            while (length--) {
                cls = classes[length];
                if (map !== undefined && map[cls]) {
                    //do not prevent the default action, let the callback
                    //function do it if it wants
                    this.fire( map[cls], e);
                }
            }
        };

        /* -------------------------------------------------
        *         Utilities
        * ------------------------------------------------- */

        /**
        * Get the library plugin which will create a normalized interface
        * for the libraries so that they can be used properly. Onload of the
        * library plugin, we will attach our event listeners
        * @return {void}
        * @method getLibraryPlugin
        */
        this.getLibraryPlugin = function() {

            OP.Log.info('[Util] getLibraryPlugin');

            var url = this.config.baseUrl + this.config.jsLocation + PLUGIN_FILE_PREFIX + this.libType + ".js";

            //load the script and attach the event handlers onload
            this.loadScript(url, this._init, this);

        };

        /**
        * Shallow merge of all objects passed into it in order of the objects passed in
        * this is just needed to merge the config, but will probably be overwritten by
        * the library plugin
        * @return {object} merged object
        * @method merge
        */
        this.merge = function() {

            OP.Log.info('[Util] merge');

            var merged = {},
                i,
                j,
                obj,
                key;

            for (i=0, j=arguments.length; i<j; i++) {
                obj = arguments[i];
                for (key in obj) {
                    if (obj.hasOwnProperty(key)) {
                        merged[key] = obj[key];
                    }
                }
            }

            return merged;

        };

        /**
        * Utility function to dynamically load a script
        * @param {string} url of the source of the script
        * @param {Function} fn the callback function to execute onload
        * @param {object} scope - the scope of the callback function
        * @return {void}
        * @method loadScript
        */
        this.loadScript = function(url, fn, scope) {

            OP.Log.info('[Util] loadScript');

            var head = document.getElementsByTagName('head')[0],
                script = document.createElement('script'),
                onload, onerror, loaded = false;

            onerror = function() {
              OP.Log.info('[Util] loadScript failed for ' + url);
            };

            script.type = "text/javascript";
            script.src = url;
            script.onerror = onerror;

            //callback function was specified - add the onload handlers
            if (typeof(fn) !== 'undefined') {

                scope = scope || window,
                onload = function() {
                    if( loaded ) return null;
                    loaded = true;
                    return fn.apply(scope);
                };
                script.onload = onload;

                // This is for IE
                script.onreadystatechange = function() {
                    if (this.readyState === 'complete' || this.readyState === 'loaded') {
                        onload();
                        script.onreadystatechange = null;
                    }
                }

            }

            head.appendChild(script);

        };

        /**
        * Utility function to dynamically load css
        * @param {string} url of the source of the sstylesheet
        * @param {Function} fn the callback function to execute onload
        * @param {object} scope - the scope of the callback function
        * @return {void}
        * @method loadScript
        */
        this.loadCss = function(url, fn, scope) {

            OP.Log.info('[Util] loadCss');

            var head = document.getElementsByTagName('head')[0],
                link = document.createElement('link'),
                callback;

            link.type = 'text/css';
            link.rel = 'stylesheet';
            link.href = url;

            //callback function was specified - add the onload handlers
            if (typeof(fn) !== 'undefined') {

                scope = scope || window,
                callback = function() {
                    return fn.apply(scope);
                };

                link.onload = callback;
                link.onreadystatechange = function() {
                    if (this.readyState === 'complete') {
                        callback();
                    }
                }

            }

            head.appendChild(link);

        };

        /**
        * The user can specify a callback to execute when all of the javascript assets
        * have loaded.  This helper method keeps track of the number of javascript assets
        * loaded and executes the onComplete callback when everything is loaded.
        * @return {void}
        * @method _handleScriptLoad
        */
        this._handleScriptLoad = function() {

            this._scriptLoadCount++;

            if ( (this._scriptLoadCount === this.config.js.assets.length) && (typeof(this.config.js.onComplete) !== 'undefined')) {
                this.config.js.onComplete();
            }

        }

        /**
        * The user can specify a callback to execute when all of the css assets
        * have loaded.  This helper method keeps track of the number of css assets
        * loaded and executes the onComplete callback when everything is loaded.
        * @return {void}
        * @method _handleCssLoad
        */
        this._handleCssLoad = function() {

            this._cssLoadCount++;

            if ( (this._cssLoadCount === this.config.css.assets.length) && (typeof(this.config.css.onComplete) !== 'undefined')) {
                this.config.css.onComplete();
            }

        }

        /**
        * Determines the library type - really simplistic rules for now
        * @return {string} library the library type
        * @method detectLibrary
        */
        this.detectLibrary = function() {

            //very simple for now, but we can extend it later
            var lib = '';

            //jQuery
            if ( typeof(jQuery) !== 'undefined' ) {
                lib = 'jquery';
            }  else {

                //YUI2
                if ( typeof(YAHOO) !== 'undefined' ) {
                    lib = 'yui2';
                } else {
                    lib = 'yui3';
                }

            }

            return lib;

        };

        /* -------------------------------------------------
        *         Custom Events
        * ------------------------------------------------- */

        /**
        * Subscribe to a custom event - the callback will be executed when the custom event is fired
        * @param {string} eventName - the name of the custom event to subscribe to
        * @param {Function} callback - the callback function that will be executed when the event is fired
        * @param {Object} scope - the scope of the callback function (what this will refer to)
        * @return {void}
        * @method on
        */
        this.on = function(eventName, callback, scope) {

            OP.Log.info('[Util] on: ' + eventName)

            var events = this._customEvents,
                cEvent = events[eventName],
                scope = scope || window,
                length;

            if (! cEvent ) {
                events[eventName] = [];
                cEvent = events[eventName];
            }

            //make sure the event doesn't exist already - if it does, return without
            //adding the event again
            length = cEvent.length;
            while(length--) {
                if (cEvent[length].fn === callback) {
                    return;
                }
            }

            cEvent[ cEvent.length ] = {
                fn: callback,
                scope: scope
            };

        };

        /**
        * A little less terse name, but removes an event listener if it exists
        * @param {string} eventName - the name of the custom event to unsubscribe from
        * @param {Function} callback - the callback function that would have been executed on fire of the custom event
        * @return {void}
        * @method unsubscribe
        */
        this.unsubscribe = function(eventName, callback) {

            OP.Log.info('[Util] unsubscribe: ' + callback);

            var events = this._customEvents,
                cEvent = events[eventName],
                length;

            if (!!cEvent) {
                length = cEvent.length;
                while (length--) {
                    if (cEvent[length].fn === callback) {
                        cEvent.splice(length, 1);
                        break;
                    }
                }
            }

        };

        /**
        * Fire a custom event - invoke all listeners passing whatever optional arguments
        * @param {string} eventName - name of the event to fire
        * @return {void}
        * @method fire
        */
        this.fire = function(eventName, arg) {

            OP.Log.info('[Util] fire: ' + eventName);

            var callbacks = this._customEvents[eventName],
                arg = arg || {},
                i, j;

            if (!!callbacks) {
                for ( i=0, j=callbacks.length; i<j; i++ ) {
                    callbacks[i].fn.call(callbacks[i].scope, arg);
                }
            }

        };
    }

    //store the util instance
    OP.Util = new Util();

}());