text:
package com.ctrip.zeus.dao.mapper;

import com.ctrip.zeus.dao.entity.SlbGroupServerStatus;
import com.ctrip.zeus.dao.entity.SlbGroupServerStatusExample;
import org.apache.ibatis.annotations.Param;

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

public interface SlbGroupServerStatusMapper {
    long countByExample(SlbGroupServerStatusExample example);

    int deleteByExample(SlbGroupServerStatusExample example);

    int deleteByPrimaryKey(Long id);

    int insert(SlbGroupServerStatus record);

    int insertSelective(SlbGroupServerStatus record);

    SlbGroupServerStatus selectOneByExample(SlbGroupServerStatusExample example);

    SlbGroupServerStatus selectOneByExampleSelective(@Param("example") SlbGroupServerStatusExample example, @Param("selective") SlbGroupServerStatus.Column ... selective);

    List<SlbGroupServerStatus> selectByExampleSelective(@Param("example") SlbGroupServerStatusExample example, @Param("selective") SlbGroupServerStatus.Column ... selective);

    List<SlbGroupServerStatus> selectByExample(SlbGroupServerStatusExample example);

    SlbGroupServerStatus selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") SlbGroupServerStatus.Column ... selective);

    SlbGroupServerStatus selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") SlbGroupServerStatus record, @Param("example") SlbGroupServerStatusExample example);

    int updateByExample(@Param("record") SlbGroupServerStatus record, @Param("example") SlbGroupServerStatusExample example);

    int updateByPrimaryKeySelective(SlbGroupServerStatus record);

    int updateByPrimaryKey(SlbGroupServerStatus record);

    int upsert(SlbGroupServerStatus record);

    int upsertSelective(SlbGroupServerStatus record);

    /*Self Defined*/
    int updateStatus(@Param("record") SlbGroupServerStatus data, @Param("reset") int reset);

    int batchUpdateStatus(List<Map<String, Object>> records);

    int insertUpdate(SlbGroupServerStatus record);

    int batchInsertIncludeId(List<SlbGroupServerStatus> records);

    List<SlbGroupServerStatus> concatSelect(@Param("concats") String[] concats);
    /*Self Defined*/
}


text:
SOCKET_ADDRESS = "ws://192.168.7.2:3333/websocket"

var app = app || {};
app.EventBus = _.extend({}, Backbone.Events);

$(function(){
  //Initialze Application and navigation
  var visualPRU = new app.VisualPRUApplication();
  $(document).foundation();

});

app.PRU = Backbone.Model.extend({
  defaults: {
    id: null,
    state: {
              programCounter: null,
              status: null,
              runMode: null
           },
    program: {
                sourceFiles : [{name:'',content:''}],
                compiledFile : {name: '', content: [{filename:'',lineno: 0, text:''}]},
                errors : [],
                warnings : []
              },
    memory: {
              generalPurpose: [],
              scratchpad: [],
              shared: []
            }
  },
  initialize: function(options){
  }
});

app.VisualPRUApplication = Backbone.View.extend({
  el:'body',
  initialize: function(options){
    //Initialize the Application
    _.extend(this, this.defaults, options);
    this.headerView = new app.HeaderView();
    this.statusView = new app.StatusView();
    this.pruView = new app.PRUView();

    //Keep track of the PRUs
    this.prus = {};
    this.activePRU = null;

    //Intiate a socket connection to the backend server
    this.ws = new WebSocket(SOCKET_ADDRESS);
    var that = this;
    this.ws.onopen = function() {
      //Send a socket connection request to the backend
      var message = {action:'connect'};
      that.ws.send(JSON.stringify(message));

    };
    this.ws.onmessage = function (evt) {
      var message = JSON.parse(evt.data);//['response'];
      if(message.type == 'pruState'){

        //Update the state of the PRU whose state was changed
        that.prus[message.pruState.id].set(message.pruState);
        app.EventBus.trigger('application:pru:change',{prus: that.prus, activePRU: that.activePRU});

      }else if(message.type == 'connection'){
        if(message.status=='success'){
          _.each(message.availablePRUStates,function(pruState, pruID){
            that.prus[pruID] = new app.PRU(pruState);
          });

          app.EventBus.trigger('application:connection:opened');

          //Load the first PRU workspace(sorted by ID) by default
          that.setActivePRU(_.sortBy(_.keys(that.prus))[0]);
        }
      }
    };
    this.ws.onerror = function(error) {
      console.log('WebSocket Error: ' + error);
      app.EventBus.trigger('application:connection:error');
    };
    this.ws.onclose = function() {
      console.log('WebSocket Connection Closed');
      app.EventBus.trigger('application:connection:closed');
    };

    //Listen for communication requests from the application
    this.listenTo(app.EventBus, 'header:pru:change', this.setActivePRU);
    this.listenTo(app.EventBus, 'editor:save', this.onEditorSave);
    this.listenTo(app.EventBus, 'editor:compile', this.onEditorCompile);
    this.listenTo(app.EventBus, 'compiler:reset', this.onCompilerReset);
    this.listenTo(app.EventBus, 'compiler:run', this.onCompilerRun);
    this.listenTo(app.EventBus, 'compiler:halt', this.onCompilerHalt);
    this.listenTo(app.EventBus, 'compiler:step', this.onCompilerStep);
    this.listenTo(app.EventBus, 'memory:set-range', this.onMemorySetRange);

    //Disable form submission on enter due to incorrect request being sent
    $(document).on('keypress','form input[type=text]',$.proxy(function(e){
      if ( e.which == 13 ) {
        e.preventDefault();
        //TODO Consider triggering the a.submit button click() on enter to submit the correct request
      }
    },this));

  },

  onEditorSave: function(sourceFiles){
    this.activePRU.get('program').sourceFiles = sourceFiles;
  },

  onEditorCompile: function(sourceFiles){
    this.onEditorSave(sourceFiles);
    //Initiate the server-side compilation
    this.sendActivePRUMessage('compile',{sourceFiles: sourceFiles});
  },

  onCompilerReset: function(){
    this.sendActivePRUMessage('reset');
  },

  onCompilerRun: function(){
    this.sendActivePRUMessage('run');
  },

  onCompilerHalt: function(){
    this.sendActivePRUMessage('halt');
  },

  onCompilerStep: function(){
    this.sendActivePRUMessage('step');
  },

  onMemorySetRange: function(range){
    this.sendActivePRUMessage('set-memory-range',range);
  },

  sendActivePRUMessage: function(action, data){
    var message = {action: action, data: data, pruID: this.activePRU.get('id')};
    this.ws.send(JSON.stringify(message));
  },

  setActivePRU: function(pruID){
    //If the requested PRU is valid, then set it to active. Otherwise send 'null' instead of 'undefined' to indicate no active PRU
    this.activePRU = this.prus[pruID];

    if(typeof this.activePRU === 'undefined'){
      this.activePRU = null;
    }

    app.EventBus.trigger('application:pru:change',{prus: this.prus, activePRU: this.activePRU});
  }
});

app.HeaderView = Backbone.View.extend({
  el:'nav',
  initialize: function(options){
    _.extend(this, this.defaults, options);
    this.render();

    this.listenTo(app.EventBus, 'application:pru:change', this.onPRUChange);
  },
  events: {
    'click li.workspace a' : 'onWorkspaceClick',
    'click li.text a' : 'doNothing'
  },
  render: function(){
    this.$el.html(_.template($("#header-view-template").html(),{prus: this.prus, activePRUID: this.activePRUID}));
    return this;
  },

  onWorkspaceClick: function(e){
    e.preventDefault();
    var pruID = $(e.currentTarget).data('pruid');
    app.EventBus.trigger('header:pru:change',pruID);
  },

  doNothing: function(e){
    e.preventDefault();
    return false;
  },

  onPRUChange: function(message){
    //Extract the required information from the message.
    var pruIDs = _.sortBy(_.keys(message.prus));

    //Create a pru object with "id" and "state" attributes
    this.prus = [];
    _.each(_.sortBy(_.keys(message.prus)), function(pru){
      this.prus.push({id:pru, status:message.prus[pru].get('state').status});
    },this);

    //Store the id of the selected PRU
    if(message.activePRU != null){
      this.activePRUID = message.activePRU.get('id');
    }else{
      this.activePRUID = null;
    }
    this.render();
  }
});

app.PRUView = Backbone.View.extend({
  el:'#pru-view',
  initialize: function(options){
    _.extend(this, this.defaults, options);

    //Render the PRU workspace. Note that we have to render the container view before we can instantiate the subviews
    this.render();
    this.editorView = new app.EditorView({el:this.$el.find('#editor-view')});
    this.compilerView = new app.CompilerView({el:this.$el.find('#compiler-view')});
    this.memoryView = new app.MemoryView({el:this.$el.find('#memory-view')});

    this.listenTo(app.EventBus, 'application:connection:opened', this.show);
    this.listenTo(app.EventBus, 'application:connection:closed', this.hide);

    this.hide();
  },
  show: function(){
    this.$el.show();
  },
  hide: function(){
    this.$el.hide();
  },
  render: function(){
    this.$el.html(_.template($("#pru-view-template").html()));
    return this;
  }

});

app.StatusView = Backbone.View.extend({
  el:'#status-view',
  initialize: function(options){
    _.extend(this, this.defaults, options);

    this.isConnected = false;

    this.render();

    this.listenTo(app.EventBus, 'application:connection:opened', this.onConnectionOpened);
    this.listenTo(app.EventBus, 'application:connection:closed', this.onConnectionClosed);

  },
  onConnectionOpened: function(){
    this.isConnected = true;
    this.render();
  },
  onConnectionClosed: function(){
    this.isConnected = false;
    this.render();
  },
  render: function(){
    this.$el.html(_.template($("#status-view-template").html(),{isConnected: this.isConnected}));
    return this;
  }

});

app.EditorView = Backbone.View.extend({
  initialize: function(options){
    _.extend(this, this.defaults, options);

    this.sourceFiles = [];
    this.activeSourceFile = null;

    this.render();

    this.listenTo(app.EventBus, 'application:pru:change', this.onPRUChange);

  },
  events: {
    'click a.new-program' : 'newProgram',
    'click a.compile' : 'compile',
    'keydown textarea' : 'prettifyText',
    'paste textarea' : 'prettifyText',
    'click a.add-file-trigger' : 'addFileTrigger',
    'click a.delete-current-file-trigger' : 'deleteCurrentFileTrigger',
    'click .tab-title a' : 'switchFile',
  },

  onPRUChange: function(message){
    //Store the status of the PRU
    this.pruStatus = message.activePRU.get('state').status;

    //Update the previous PRU's source file prior to rendering the new workspace
    if(this.activeSourceFile!=null){
      this.activeSourceFile.content = this.$el.find('textarea').val();
    }

    //Extract the program-related information from the message if a valid PRU was selected
    if(message.activePRU!=null){
      this.sourceFiles = message.activePRU.get('program').sourceFiles;
      //If source files were loaded to the PRU, then we will store them and select the first one as active
      if(this.sourceFiles.length>0){
        this.activeSourceFile = this.sourceFiles[0];
      }else{
        this.activeSourceFile = null;
      }
    }

    //Render the source files in the editor
    this.render();
  },
  render: function(){
    //Add the content to the DOM
    this.$el.html(_.template($('#editor-view-template').html(), {sourceFiles: this.sourceFiles, activeSourceFile: this.activeSourceFile, pruStatus: this.pruStatus}));

    //Prettify the editor if it rendered to the screen
    if(this.sourceFiles.length>0){
      this.prettifyText();
    }

    //Enable the dynamically generated modal windows
    this.$el.find('#add-file-modal').foundation('reveal');
    return this;
  },
  compile: function(e){
    e.preventDefault();
    //Save the content for the active source file. this.activeSourceFiles references the object in this.sourceFiles, updating one updates the other
    this.activeSourceFile.content = this.$el.find('textarea').val();
    app.EventBus.trigger('editor:compile',this.sourceFiles);
  },
  newProgram: function(e){
    console.log("New Program");
  },
  addFileTrigger: function(e){
    e.preventDefault();
    $('#add-file-modal').foundation('reveal', 'open');
    //Add click handler to dynamic modal
    $('a.add-file').on('click', $.proxy(this.addFile,this));
  },
  //TODO: Check for a valid filename
  addFile: function(e){
    e.preventDefault();

    //Convert Array of name,value objects to a single object
    var tmp = $(e.currentTarget).closest('form').serializeArray();
    var form = _.reduce(tmp,function(object,pair){object[pair.name] = pair.value; return object;},{});

    //Add the file if the name does not exist, and set it as the active source file
    if(_.findWhere(this.sourceFiles, {name:form.name + form.suffix}) === undefined){
      //Save the content of our current file if we are currently editing a file
      if(this.activeSourceFile!=null){
        this.activeSourceFile.content = this.$el.find('textarea').val();
      }

      //Create the new file and add it to the filelist
      this.activeSourceFile = {name: form.name + form.suffix, content:''};
      this.sourceFiles.push(this.activeSourceFile);
    }

    //Remove click handler form dynamic modal
    $('a.add-file').off('click');
    $('#add-file-modal').foundation('reveal', 'close');

    this.render();
  },

  deleteCurrentFileTrigger: function(e){
    e.preventDefault();
    $('#delete-current-file-modal').foundation('reveal', 'open');
    //Add click handler to dynamic modal
    $('a.delete-current-file').on('click', $.proxy(this.deleteCurrentFile,this));
    $('a.cancel-delete-current-file').on('click', $.proxy(this.cancelDeleteCurrentFile,this));
  },

  deleteCurrentFile: function(e){
    e.preventDefault();

    //Find the active source file and delete it from the source list
    var filename =  this.$el.find(".tab-title.active a").data('filename');
    var index;
    for(var i=0;i<this.sourceFiles.length;i++){
      if(this.sourceFiles[i].name == filename){
        this.sourceFiles.splice(i,1);
        break;
      }
    }

    //Set the active source file to the last in the list if there are files in the workspace
    if(this.sourceFiles.length>0){
      this.activeSourceFile = this.sourceFiles[this.sourceFiles.length-1]
    }else{
      this.activeSourceFile = null;
    }

    //Remove click handlers form dynamic modal
    $('a.delete-current-file').off('click');
    $('a.cancel-delete-current-file').off('click');
    $('#delete-current-file-modal').foundation('reveal', 'close');

    this.render();
  },

  cancelDeleteCurrentFile: function(e){
    e.preventDefault();
    //Remove click handlers form dynamic modal
    $('a.delete-current-file').off('click');
    $('a.cancel-delete-current-file').off('click');
    $('#delete-current-file-modal').foundation('reveal', 'close');
  },

  switchFile: function(e){
    e.preventDefault();

    //Store the content of the current file
    this.activeSourceFile.content = this.$el.find('textarea').val();
    var filename = $(e.currentTarget).data('filename');

    //Set the new activeSourceFile
    this.activeSourceFile = _.findWhere(this.sourceFiles,{name: filename});
    this.render();
  },

  prettifyText: function(e){

    var view = this.$el;
    var that = this;
    //The timeout ensures that the text is in the textarea after the events have been fired(specifically the onpaste event)
    setTimeout(function(){
      //Save the updated content to the model
      that.activeSourceFile.content = view.find('textarea').val();

      //Expand the text area size
      var numLines = view.find('textarea').val().replace(/\r?\n$/,'').split(/\r*\n/).length;
      view.find('textarea').attr('rows',(numLines+1).toString());

      //Add line numbers
      var container = view.find('.line-nums')[0];
      var html = '';
      for(var i=0; i<numLines; i++){
        html += '
'+(i+1)+'
';
      }
      $(container).html(html);
    },50);
  }
});

app.CompilerView = Backbone.View.extend({
  initialize: function(options){
    _.extend(this, this.defaults, options);

    this.errors = [];
    this.warnings = [];
    this.compiledFile = {};

    this.listenTo(app.EventBus, 'application:pru:change', this.onPRUChange);

    this.render();

  },
  events: {
    'click a.reset' : 'reset',
    'click a.run' : 'run',
    'click a.halt' : 'halt',
    'click a.step' : 'step'
  },
  onPRUChange: function(message){
    //Extract the required information from the message.
    if(message.activePRU!=null){
      this.errors = message.activePRU.get('program').errors;
      this.warnings = message.activePRU.get('program').warnings;
      this.compiledFile = message.activePRU.get('program').compiledFile;
      this.programCounter = message.activePRU.get('state').programCounter;
      this.pruStatus = message.activePRU.get('state').status;
    }
    this.render(); // For now, we only will support the first file
  },
  render: function(){

    //Figure out if the program successfully compiled or not
    var displayData = {status:'empty', lines: [], programCounter: 0, pruStatus: 'halted', hasCompiledFile:false};//_.isEmpty(this.compiledFile.content)
    if(this.errors.length > 0){
      //Errors were found
      displayData.status = 'error';
      displayData.lines = this.errors;
    }else if(!_.isEmpty(this.compiledFile.content)){
      //No errors
      displayData.status = 'success';
      displayData.lines = this.compiledFile.content;
      displayData.programCounter = this.programCounter;
      displayData.pruStatus = this.pruStatus;
      displayData.hasCompiledFile = true;
    }

    //Render to the screen
    this.$el.html(_.template($("#compiler-view-template").html(),displayData));

    return this;
  },
  reset: function(e){
    console.log("reset");
    app.EventBus.trigger("compiler:reset");
  },
  run: function(e){
    console.log("run");
    app.EventBus.trigger("compiler:run");
  },
  halt: function(e){
    console.log("halt");
    app.EventBus.trigger("compiler:halt");
  },
  step: function(e){
    console.log("step");
    app.EventBus.trigger("compiler:step");
  }

});

app.MemoryView = Backbone.View.extend({
  initialize: function(options){
    _.extend(this, this.defaults, options);
    this.listenTo(app.EventBus, 'application:pru:change', this.onPRUChange);
    this.memory = {
              generalPurpose: [],
              scratchpad: [],
              shared: []
            };

    this.memorySelect = 'generalPurpose';
    this.memoryOffset = 0;
    this.addressCount = 100; // Number of addresses to request/show

    this.render();

  },
  events: {
    'change .memory-select select': 'onMemorySelect',
    'keydown .memory-range input': 'onMemoryRangeChanged',
    'click .memory-range a.submit' : 'setMemoryRange'
  },
  onPRUChange: function(message){
    //Extract the required information from the message.
    if(message.activePRU!=null){
      this.memory = message.activePRU.get('memory');
    }
    this.render();
  },
  render: function(){
    this.$el.html(_.template($("#memory-view-template").html(),{memory:this.memory, selected: this.memorySelect, offset: this.memoryOffset}));
    return this;
  },
  onMemorySelect: function(e){
    if(this.$el.find('.memory-select select').val()!= "generalPurpose"){
      this.$el.find('.memory-range').show();
    }else{
      this.$el.find('.memory-range').hide();
    }
    this.memorySelect = $(e.currentTarget).val();

    this.render();
  },
  setMemoryRange: function(e){
    e.preventDefault();
    this.memoryOffset = parseInt(this.$el.find('input[name="memory-offset"]').val(),16) || 0;
    app.EventBus.trigger("memory:set-range",{range:{type:this.memorySelect, offset: this.memoryOffset, addressCount: this.addressCount}});
  },
  onMemoryRangeChanged: function(e){
    var currentValue = $(e.currentTarget).val();
    //var hex = /^[a-f0-9]+$/i;
    //If Valid Hex Digit less than 4 bytes or a non-alphanumeric key which facilitates a good UI(eg. left-arrow, delete, shift, etc...)
    if((e.which>=48 && e.which <= 70 && currentValue.length<8) || e.which == 8 || e.which == 46 || e.which == 37 || e.which == 36 || e.which == 35 || e.which == 39 || e.which == 16){
      //Do Nothing
    }else{
      //Don't allow the value to be changed
      e.preventDefault();
    }
  }
});

redpajama_set_name: RedPajamaGithub


text:
package com.amazonaws.services.codeartifact.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.codeartifact.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * GetPackageVersionAssetResult JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetPackageVersionAssetResultJsonUnmarshaller implements Unmarshaller<GetPackageVersionAssetResult, JsonUnmarshallerContext> {

    public GetPackageVersionAssetResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        GetPackageVersionAssetResult getPackageVersionAssetResult = new GetPackageVersionAssetResult();

        if (context.isStartOfDocument()) {
            if (context.getHeader("X-AssetName") != null) {
                context.setCurrentHeader("X-AssetName");
                getPackageVersionAssetResult.setAssetName(context.getUnmarshaller(String.class).unmarshall(context));
            }
            if (context.getHeader("X-PackageVersion") != null) {
                context.setCurrentHeader("X-PackageVersion");
                getPackageVersionAssetResult.setPackageVersion(context.getUnmarshaller(String.class).unmarshall(context));
            }
            if (context.getHeader("X-PackageVersionRevision") != null) {
                context.setCurrentHeader("X-PackageVersionRevision");
                getPackageVersionAssetResult.setPackageVersionRevision(context.getUnmarshaller(String.class).unmarshall(context));
            }
        }

        getPackageVersionAssetResult.setAsset(context.getHttpResponse().getContent());

        return getPackageVersionAssetResult;
    }

    private static GetPackageVersionAssetResultJsonUnmarshaller instance;

    public static GetPackageVersionAssetResultJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new GetPackageVersionAssetResultJsonUnmarshaller();
        return instance;
    }
}


text:
layout: blog
category: blog
title: Natürlich wurden sie beteiligt
summary: Sie haben es nur nicht gemerkt
image: natuerlichwurdensiebeteiligthoch.png
tags: [Bürgerbeteiligung,Verwaltung]
---


text:
require 'rails_helper'

RSpec.describe PeekAndVocab, :type => :model do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
var http = require('http')
  , Router = require('./router')
  , db = require('./db')
  , util = require('util')
  , Resource = require('./resource')
  , Keys = require('./keys')
  , SessionStore = require('./session').SessionStore
  , fs = require('fs')
  , io = require('socket.io')
  , setupReqRes = require('./util/http').setup
  , debug = require('debug')('server')
  , config = require('./config-loader');

function extend(origin, add) {
  // don't do anything if add isn't an object
  if (!add || typeof add !== 'object') return origin;

  var keys = Object.keys(add);
  var i = keys.length;
  while (i--) {
    if(add[keys[i]]) origin[keys[i]] = add[keys[i]];
  }
  return origin;
}

/**
 * Create an http server with the given options and create a `Router` to handle its requests.
 *
 * Options:
 *
 *   - `db`           the database connection info
 *   - `host`         the server's hostname
 *   - `port`         the server's port
 *
 * Properties:
 *
 *  - `sessions`      the servers `SessionStore`
 *  - `sockets`       raw socket.io sockets
 *  - `db`            the servers `Db` instance
 *
 * Example:
 *
 *     var server = new Server({port: 3000, db: {host: 'localhost', port: 27015, name: 'my-db'}});
 *
 *     server.listen();
 *
 * @param {Object} options
 * @return {HttpServer}
 */

function Server(options) {
  var server = process.server = this;
  http.Server.call(this);

  // defaults
  this.options = options = extend({
    port: 2403,
    db: {port: 27017, host: '127.0.0.1', name: 'deployd'}
  }, options);

  debug('started with options %j', options);

  // an object to map a server to its stores
  this.stores = {};

  // back all memory stores with a db
  this.db = db.create(options.db);

  // use socket io for a session based realtime channel
  this.sockets = io.listen(this, {
    'log level': 0
  }).sockets;

  // persist sessions in a store
  var sessionStore = this.sessions = new SessionStore('sessions', this.db, this.sockets, options.sessions);

  // persist keys in a store
  var keys = this.keys = new Keys();

  this.on('request', server.handleRequest);

  server.on('request:error', function (err, req, res) {
    console.error();
    console.error(req.method, req.url, err.stack || err);
    process.exit(1);
  });
}
util.inherits(Server, http.Server);

Server.prototype.handleRequest = function handleRequest (req, res) {
  var server = this;
  // dont handle socket.io requests
  if(req.url.indexOf('/socket.io/') === 0) return;

  debug('%s %s', req.method, req.url);

  // add utilites to req and res
  setupReqRes(server.options, req, res, function(err, next) {
    if(err) return res.end(err.message);

    var authToken, usesBearerAuth = false;
    if (req.headers && req.headers.authorization) {
      var parts = req.headers.authorization.split(' ');
      var scheme = parts[0]
      , credentials = parts[1];

      if (/^Bearer$/i.test(scheme)) {
        authToken = credentials;
        usesBearerAuth = true;
      }
    }

    server.sessions.createSession(authToken || req.cookies.get('sid'), function(err, session) {
      if(err) {
        debug('session error', err, session);
        throw err;
      } else {
        if (!usesBearerAuth) {
          // (re)set the session id cookie if we're not using Authorization Bearer
          if (session.sid) req.cookies.set('sid', session.sid);
        }
        req.session = session;

        var root = req.headers['dpd-ssh-key'] || req.cookies.get('DpdSshKey');

        if (server.options.env === 'development') {
          if (root) { req.isRoot = true; }
          server.route(req, res);
        } else if (root) {
          // all root requests
          // must be authenticated
          debug('authenticating', root);
          server.keys.get(root, function(err, key) {
            if(err) throw err;
            if(key) req.isRoot = true;
            debug('is root?', session.isRoot);
            server.route(req, res);
          });
        } else {
          // normal route
          server.route(req, res);
        }
      }
    });
  });
};

/**
 * Start listening for incoming connections.
 *
 * @return {Server} for chaining
 */

Server.prototype.listen = function(port, host) {
  var server = this;
  var serverpath = server.options.server_dir || fs.realpathSync('./');

  config.loadConfig(serverpath, server, function(err, resourcesInstances) {
    if (err) {
      console.error();
      console.error("Error loading resources: ");
      console.error(err.stack || err);
      process.exit(1);
    } else {
      server.resources = resourcesInstances;
      var router = new Router(resourcesInstances, server);
      server.router = router;
      http.Server.prototype.listen.call(server, port || server.options.port, host || server.options.host);
    }
  });
  return this;
};

Server.prototype.route = function route (req, res) {
  var server = this;
  var serverpath = server.options.server_dir || './';

  config.loadConfig(serverpath, server, function(err, resourcesInstances) {
    if (err) throw err;
    var router = new Router(resourcesInstances, server);
    server.router = router;

    server.resources = resourcesInstances;
    router.route(req, res);
  });
};

/**
 * Create a new `Store` for persisting data using the database info that was passed to the server when it was created.
 *
 * Example:
 *
 *     // Create a new server
 *     var server = new Server({port: 3000, db: {host: 'localhost', port: 27015, name: 'my-db'}});
 *
 *     // Attach a store to the server
 *     var todos = server.createStore('todos');
 *
 *     // Use the store to CRUD data
 *     todos.insert({name: 'go to the store', done: true}, ...); // see `Store` for more info
 *
 * @param {String} namespace
 * @return {Store}
 */

Server.prototype.createStore = function(namespace) {
	return (this.stores[namespace] = this.db.createStore(namespace));
};

module.exports = Server;


text:
// plugins can be structured however you want, this is just an example

( function () {
    var yerba, $;

    function plugin(){}

    plugin.prototype = {
        // initialize method
        _init: function () {
            // this.foo = 'bar';

            return this
                .setCustomMethods()
                .handleEvents();
        },

        // add some methods to yerba
        setCustomMethods: function () {
            // return if yerba isn't set
            if ( !yerba )
                return this;

            // overwriting built-in methods is possible but not recommended

            // used by the yerba object itself
            yerba.logMessage = function ( msg ) {
                console.log( 'yerba said: ' + msg );
            };

            // used by individual yerbas
            yerba.fn.logMessage = function ( msg ) {
                console.log( 'yerba item ' + this._id + ' said: ' + msg );
            };

            return this;
        },

        handleEvents: function () {
            // handle some events from yerba
            /* yerba.on( 'data', function ( data ) {
                console.log( 'yerba event said: ' + data );
            });

            yerba.emit( 'send', [ 1, 2, 3, 4, 5 ] ); */

            return this;
        }
    };

    module.exports = function ( activeYerba ) {
        // make sure yerba is set before loading the plugin, for now
        // i would like to be able to just require yerba and have it sync up
        yerba = activeYerba;

        // grab the (tiny) internal helper class used by yerba - type checks, extend, genID, toArray, etc
        // could easily use whatever library you want, or not
        $ = yerba._$;

        // return the new plugin. it doesn't have to be in this format, or even return anything
        return new plugin()._init();
    };
})();


text:
"use strict";

var Model = require("../models/index.js");

var Users = Model.Bookshelf.Collection.extend({
	model: Model.User
});
exports.UserCollection = Users;

var Posts = Model.Bookshelf.Collection.extend({
	model: Model.Post
});
exports.PostCollection = Posts;

var Categories = Model.Bookshelf.Collection.extend({
	model: Model.Category
});
exports.CategoryCollection = Categories;

var Tags = Model.Bookshelf.Collection.extend({
	model: Model.Tag
});
exports.TagsCollection = Tags;


text:
/**
 */
package gluemodel.substationStandard.LNNodes.LNGroupR.impl;

import gluemodel.substationStandard.Dataclasses.ASG;
import gluemodel.substationStandard.Dataclasses.ING;
import gluemodel.substationStandard.Dataclasses.MV;
import gluemodel.substationStandard.Dataclasses.SPC;
import gluemodel.substationStandard.Dataclasses.SPS;

import gluemodel.substationStandard.LNNodes.LNGroupR.LNGroupRPackage;
import gluemodel.substationStandard.LNNodes.LNGroupR.RSYN;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 *
 * An implementation of the model object 'RSYN'.
 *
 *

 * The following features are implemented:
 *

 *

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getRHz RHz}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getLHz LHz}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getRV RV}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getLV LV}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getRel Rel}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getVlnd Vlnd}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getAngInd Ang Ind}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getHzInd Hz Ind}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getSynPrg Syn Prg}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getDifVClc Dif VClc}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getDifAngClc Dif Ang Clc}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getDifV Dif V}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getDifHz Dif Hz}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getDifAng Dif Ang}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getLivDeaMod Liv Dea Mod}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getDeaLinVal Dea Lin Val}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getLivLinVal Liv Lin Val}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getDeaBusVal Dea Bus Val}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getPlsTmms Pls Tmms}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupR.impl.RSYNImpl#getBkrTmms Bkr Tmms}

 *

 *
 * @generated
 */
public class RSYNImpl extends GroupRImpl implements RSYN {
	/**
	 * The cached value of the '{@link #getRHz() RHz}' reference.
	 *
	 *
	 * @see #getRHz()
	 * @generated
	 * @ordered
	 */
	protected SPC rHz;

	/**
	 * The cached value of the '{@link #getLHz() LHz}' reference.
	 *
	 *
	 * @see #getLHz()
	 * @generated
	 * @ordered
	 */
	protected SPC lHz;

	/**
	 * The cached value of the '{@link #getRV() RV}' reference.
	 *
	 *
	 * @see #getRV()
	 * @generated
	 * @ordered
	 */
	protected SPC rv;

	/**
	 * The cached value of the '{@link #getLV() LV}' reference.
	 *
	 *
	 * @see #getLV()
	 * @generated
	 * @ordered
	 */
	protected SPC lv;

	/**
	 * The cached value of the '{@link #getRel() Rel}' reference.
	 *
	 *
	 * @see #getRel()
	 * @generated
	 * @ordered
	 */
	protected SPS rel;

	/**
	 * The cached value of the '{@link #getVlnd() Vlnd}' reference.
	 *
	 *
	 * @see #getVlnd()
	 * @generated
	 * @ordered
	 */
	protected SPS vlnd;

	/**
	 * The cached value of the '{@link #getAngInd() Ang Ind}' reference.
	 *
	 *
	 * @see #getAngInd()
	 * @generated
	 * @ordered
	 */
	protected SPS angInd;

	/**
	 * The cached value of the '{@link #getHzInd() Hz Ind}' reference.
	 *
	 *
	 * @see #getHzInd()
	 * @generated
	 * @ordered
	 */
	protected SPS hzInd;

	/**
	 * The cached value of the '{@link #getSynPrg() Syn Prg}' reference.
	 *
	 *
	 * @see #getSynPrg()
	 * @generated
	 * @ordered
	 */
	protected SPS synPrg;

	/**
	 * The cached value of the '{@link #getDifVClc() Dif VClc}' reference.
	 *
	 *
	 * @see #getDifVClc()
	 * @generated
	 * @ordered
	 */
	protected MV difVClc;

	/**
	 * The cached value of the '{@link #getDifAngClc() Dif Ang Clc}' reference.
	 *
	 *
	 * @see #getDifAngClc()
	 * @generated
	 * @ordered
	 */
	protected MV difAngClc;

	/**
	 * The cached value of the '{@link #getDifV() Dif V}' reference.
	 *
	 *
	 * @see #getDifV()
	 * @generated
	 * @ordered
	 */
	protected ASG difV;

	/**
	 * The cached value of the '{@link #getDifHz() Dif Hz}' reference.
	 *
	 *
	 * @see #getDifHz()
	 * @generated
	 * @ordered
	 */
	protected ASG difHz;

	/**
	 * The cached value of the '{@link #getDifAng() Dif Ang}' reference.
	 *
	 *
	 * @see #getDifAng()
	 * @generated
	 * @ordered
	 */
	protected ASG difAng;

	/**
	 * The cached value of the '{@link #getLivDeaMod() Liv Dea Mod}' reference.
	 *
	 *
	 * @see #getLivDeaMod()
	 * @generated
	 * @ordered
	 */
	protected ING livDeaMod;

	/**
	 * The cached value of the '{@link #getDeaLinVal() Dea Lin Val}' reference.
	 *
	 *
	 * @see #getDeaLinVal()
	 * @generated
	 * @ordered
	 */
	protected ASG deaLinVal;

	/**
	 * The cached value of the '{@link #getLivLinVal() Liv Lin Val}' reference.
	 *
	 *
	 * @see #getLivLinVal()
	 * @generated
	 * @ordered
	 */
	protected ASG livLinVal;

	/**
	 * The cached value of the '{@link #getDeaBusVal() Dea Bus Val}' reference.
	 *
	 *
	 * @see #getDeaBusVal()
	 * @generated
	 * @ordered
	 */
	protected ASG deaBusVal;

	/**
	 * The cached value of the '{@link #getPlsTmms() Pls Tmms}' reference.
	 *
	 *
	 * @see #getPlsTmms()
	 * @generated
	 * @ordered
	 */
	protected ING plsTmms;

	/**
	 * The cached value of the '{@link #getBkrTmms() Bkr Tmms}' reference.
	 *
	 *
	 * @see #getBkrTmms()
	 * @generated
	 * @ordered
	 */
	protected ING bkrTmms;

	/**
	 *
	 *
	 * @generated
	 */
	protected RSYNImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return LNGroupRPackage.Literals.RSYN;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC getRHz() {
		if (rHz != null && rHz.eIsProxy()) {
			InternalEObject oldRHz = (InternalEObject)rHz;
			rHz = (SPC)eResolveProxy(oldRHz);
			if (rHz != oldRHz) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__RHZ, oldRHz, rHz));
			}
		}
		return rHz;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC basicGetRHz() {
		return rHz;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setRHz(SPC newRHz) {
		SPC oldRHz = rHz;
		rHz = newRHz;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__RHZ, oldRHz, rHz));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC getLHz() {
		if (lHz != null && lHz.eIsProxy()) {
			InternalEObject oldLHz = (InternalEObject)lHz;
			lHz = (SPC)eResolveProxy(oldLHz);
			if (lHz != oldLHz) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__LHZ, oldLHz, lHz));
			}
		}
		return lHz;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC basicGetLHz() {
		return lHz;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setLHz(SPC newLHz) {
		SPC oldLHz = lHz;
		lHz = newLHz;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__LHZ, oldLHz, lHz));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC getRV() {
		if (rv != null && rv.eIsProxy()) {
			InternalEObject oldRV = (InternalEObject)rv;
			rv = (SPC)eResolveProxy(oldRV);
			if (rv != oldRV) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__RV, oldRV, rv));
			}
		}
		return rv;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC basicGetRV() {
		return rv;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setRV(SPC newRV) {
		SPC oldRV = rv;
		rv = newRV;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__RV, oldRV, rv));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC getLV() {
		if (lv != null && lv.eIsProxy()) {
			InternalEObject oldLV = (InternalEObject)lv;
			lv = (SPC)eResolveProxy(oldLV);
			if (lv != oldLV) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__LV, oldLV, lv));
			}
		}
		return lv;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPC basicGetLV() {
		return lv;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setLV(SPC newLV) {
		SPC oldLV = lv;
		lv = newLV;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__LV, oldLV, lv));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS getRel() {
		if (rel != null && rel.eIsProxy()) {
			InternalEObject oldRel = (InternalEObject)rel;
			rel = (SPS)eResolveProxy(oldRel);
			if (rel != oldRel) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__REL, oldRel, rel));
			}
		}
		return rel;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS basicGetRel() {
		return rel;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setRel(SPS newRel) {
		SPS oldRel = rel;
		rel = newRel;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__REL, oldRel, rel));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS getVlnd() {
		if (vlnd != null && vlnd.eIsProxy()) {
			InternalEObject oldVlnd = (InternalEObject)vlnd;
			vlnd = (SPS)eResolveProxy(oldVlnd);
			if (vlnd != oldVlnd) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__VLND, oldVlnd, vlnd));
			}
		}
		return vlnd;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS basicGetVlnd() {
		return vlnd;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setVlnd(SPS newVlnd) {
		SPS oldVlnd = vlnd;
		vlnd = newVlnd;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__VLND, oldVlnd, vlnd));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS getAngInd() {
		if (angInd != null && angInd.eIsProxy()) {
			InternalEObject oldAngInd = (InternalEObject)angInd;
			angInd = (SPS)eResolveProxy(oldAngInd);
			if (angInd != oldAngInd) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__ANG_IND, oldAngInd, angInd));
			}
		}
		return angInd;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS basicGetAngInd() {
		return angInd;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setAngInd(SPS newAngInd) {
		SPS oldAngInd = angInd;
		angInd = newAngInd;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__ANG_IND, oldAngInd, angInd));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS getHzInd() {
		if (hzInd != null && hzInd.eIsProxy()) {
			InternalEObject oldHzInd = (InternalEObject)hzInd;
			hzInd = (SPS)eResolveProxy(oldHzInd);
			if (hzInd != oldHzInd) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__HZ_IND, oldHzInd, hzInd));
			}
		}
		return hzInd;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS basicGetHzInd() {
		return hzInd;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setHzInd(SPS newHzInd) {
		SPS oldHzInd = hzInd;
		hzInd = newHzInd;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__HZ_IND, oldHzInd, hzInd));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS getSynPrg() {
		if (synPrg != null && synPrg.eIsProxy()) {
			InternalEObject oldSynPrg = (InternalEObject)synPrg;
			synPrg = (SPS)eResolveProxy(oldSynPrg);
			if (synPrg != oldSynPrg) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__SYN_PRG, oldSynPrg, synPrg));
			}
		}
		return synPrg;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public SPS basicGetSynPrg() {
		return synPrg;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setSynPrg(SPS newSynPrg) {
		SPS oldSynPrg = synPrg;
		synPrg = newSynPrg;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__SYN_PRG, oldSynPrg, synPrg));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public MV getDifVClc() {
		if (difVClc != null && difVClc.eIsProxy()) {
			InternalEObject oldDifVClc = (InternalEObject)difVClc;
			difVClc = (MV)eResolveProxy(oldDifVClc);
			if (difVClc != oldDifVClc) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__DIF_VCLC, oldDifVClc, difVClc));
			}
		}
		return difVClc;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public MV basicGetDifVClc() {
		return difVClc;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setDifVClc(MV newDifVClc) {
		MV oldDifVClc = difVClc;
		difVClc = newDifVClc;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__DIF_VCLC, oldDifVClc, difVClc));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public MV getDifAngClc() {
		if (difAngClc != null && difAngClc.eIsProxy()) {
			InternalEObject oldDifAngClc = (InternalEObject)difAngClc;
			difAngClc = (MV)eResolveProxy(oldDifAngClc);
			if (difAngClc != oldDifAngClc) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__DIF_ANG_CLC, oldDifAngClc, difAngClc));
			}
		}
		return difAngClc;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public MV basicGetDifAngClc() {
		return difAngClc;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setDifAngClc(MV newDifAngClc) {
		MV oldDifAngClc = difAngClc;
		difAngClc = newDifAngClc;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__DIF_ANG_CLC, oldDifAngClc, difAngClc));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG getDifV() {
		if (difV != null && difV.eIsProxy()) {
			InternalEObject oldDifV = (InternalEObject)difV;
			difV = (ASG)eResolveProxy(oldDifV);
			if (difV != oldDifV) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__DIF_V, oldDifV, difV));
			}
		}
		return difV;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG basicGetDifV() {
		return difV;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setDifV(ASG newDifV) {
		ASG oldDifV = difV;
		difV = newDifV;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__DIF_V, oldDifV, difV));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG getDifHz() {
		if (difHz != null && difHz.eIsProxy()) {
			InternalEObject oldDifHz = (InternalEObject)difHz;
			difHz = (ASG)eResolveProxy(oldDifHz);
			if (difHz != oldDifHz) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__DIF_HZ, oldDifHz, difHz));
			}
		}
		return difHz;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG basicGetDifHz() {
		return difHz;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setDifHz(ASG newDifHz) {
		ASG oldDifHz = difHz;
		difHz = newDifHz;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__DIF_HZ, oldDifHz, difHz));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG getDifAng() {
		if (difAng != null && difAng.eIsProxy()) {
			InternalEObject oldDifAng = (InternalEObject)difAng;
			difAng = (ASG)eResolveProxy(oldDifAng);
			if (difAng != oldDifAng) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__DIF_ANG, oldDifAng, difAng));
			}
		}
		return difAng;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG basicGetDifAng() {
		return difAng;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setDifAng(ASG newDifAng) {
		ASG oldDifAng = difAng;
		difAng = newDifAng;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__DIF_ANG, oldDifAng, difAng));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ING getLivDeaMod() {
		if (livDeaMod != null && livDeaMod.eIsProxy()) {
			InternalEObject oldLivDeaMod = (InternalEObject)livDeaMod;
			livDeaMod = (ING)eResolveProxy(oldLivDeaMod);
			if (livDeaMod != oldLivDeaMod) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__LIV_DEA_MOD, oldLivDeaMod, livDeaMod));
			}
		}
		return livDeaMod;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ING basicGetLivDeaMod() {
		return livDeaMod;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setLivDeaMod(ING newLivDeaMod) {
		ING oldLivDeaMod = livDeaMod;
		livDeaMod = newLivDeaMod;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__LIV_DEA_MOD, oldLivDeaMod, livDeaMod));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG getDeaLinVal() {
		if (deaLinVal != null && deaLinVal.eIsProxy()) {
			InternalEObject oldDeaLinVal = (InternalEObject)deaLinVal;
			deaLinVal = (ASG)eResolveProxy(oldDeaLinVal);
			if (deaLinVal != oldDeaLinVal) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__DEA_LIN_VAL, oldDeaLinVal, deaLinVal));
			}
		}
		return deaLinVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG basicGetDeaLinVal() {
		return deaLinVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setDeaLinVal(ASG newDeaLinVal) {
		ASG oldDeaLinVal = deaLinVal;
		deaLinVal = newDeaLinVal;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__DEA_LIN_VAL, oldDeaLinVal, deaLinVal));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG getLivLinVal() {
		if (livLinVal != null && livLinVal.eIsProxy()) {
			InternalEObject oldLivLinVal = (InternalEObject)livLinVal;
			livLinVal = (ASG)eResolveProxy(oldLivLinVal);
			if (livLinVal != oldLivLinVal) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__LIV_LIN_VAL, oldLivLinVal, livLinVal));
			}
		}
		return livLinVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG basicGetLivLinVal() {
		return livLinVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setLivLinVal(ASG newLivLinVal) {
		ASG oldLivLinVal = livLinVal;
		livLinVal = newLivLinVal;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__LIV_LIN_VAL, oldLivLinVal, livLinVal));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG getDeaBusVal() {
		if (deaBusVal != null && deaBusVal.eIsProxy()) {
			InternalEObject oldDeaBusVal = (InternalEObject)deaBusVal;
			deaBusVal = (ASG)eResolveProxy(oldDeaBusVal);
			if (deaBusVal != oldDeaBusVal) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__DEA_BUS_VAL, oldDeaBusVal, deaBusVal));
			}
		}
		return deaBusVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ASG basicGetDeaBusVal() {
		return deaBusVal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setDeaBusVal(ASG newDeaBusVal) {
		ASG oldDeaBusVal = deaBusVal;
		deaBusVal = newDeaBusVal;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__DEA_BUS_VAL, oldDeaBusVal, deaBusVal));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ING getPlsTmms() {
		if (plsTmms != null && plsTmms.eIsProxy()) {
			InternalEObject oldPlsTmms = (InternalEObject)plsTmms;
			plsTmms = (ING)eResolveProxy(oldPlsTmms);
			if (plsTmms != oldPlsTmms) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__PLS_TMMS, oldPlsTmms, plsTmms));
			}
		}
		return plsTmms;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ING basicGetPlsTmms() {
		return plsTmms;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setPlsTmms(ING newPlsTmms) {
		ING oldPlsTmms = plsTmms;
		plsTmms = newPlsTmms;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__PLS_TMMS, oldPlsTmms, plsTmms));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ING getBkrTmms() {
		if (bkrTmms != null && bkrTmms.eIsProxy()) {
			InternalEObject oldBkrTmms = (InternalEObject)bkrTmms;
			bkrTmms = (ING)eResolveProxy(oldBkrTmms);
			if (bkrTmms != oldBkrTmms) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LNGroupRPackage.RSYN__BKR_TMMS, oldBkrTmms, bkrTmms));
			}
		}
		return bkrTmms;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ING basicGetBkrTmms() {
		return bkrTmms;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setBkrTmms(ING newBkrTmms) {
		ING oldBkrTmms = bkrTmms;
		bkrTmms = newBkrTmms;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LNGroupRPackage.RSYN__BKR_TMMS, oldBkrTmms, bkrTmms));
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case LNGroupRPackage.RSYN__RHZ:
				if (resolve) return getRHz();
				return basicGetRHz();
			case LNGroupRPackage.RSYN__LHZ:
				if (resolve) return getLHz();
				return basicGetLHz();
			case LNGroupRPackage.RSYN__RV:
				if (resolve) return getRV();
				return basicGetRV();
			case LNGroupRPackage.RSYN__LV:
				if (resolve) return getLV();
				return basicGetLV();
			case LNGroupRPackage.RSYN__REL:
				if (resolve) return getRel();
				return basicGetRel();
			case LNGroupRPackage.RSYN__VLND:
				if (resolve) return getVlnd();
				return basicGetVlnd();
			case LNGroupRPackage.RSYN__ANG_IND:
				if (resolve) return getAngInd();
				return basicGetAngInd();
			case LNGroupRPackage.RSYN__HZ_IND:
				if (resolve) return getHzInd();
				return basicGetHzInd();
			case LNGroupRPackage.RSYN__SYN_PRG:
				if (resolve) return getSynPrg();
				return basicGetSynPrg();
			case LNGroupRPackage.RSYN__DIF_VCLC:
				if (resolve) return getDifVClc();
				return basicGetDifVClc();
			case LNGroupRPackage.RSYN__DIF_ANG_CLC:
				if (resolve) return getDifAngClc();
				return basicGetDifAngClc();
			case LNGroupRPackage.RSYN__DIF_V:
				if (resolve) return getDifV();
				return basicGetDifV();
			case LNGroupRPackage.RSYN__DIF_HZ:
				if (resolve) return getDifHz();
				return basicGetDifHz();
			case LNGroupRPackage.RSYN__DIF_ANG:
				if (resolve) return getDifAng();
				return basicGetDifAng();
			case LNGroupRPackage.RSYN__LIV_DEA_MOD:
				if (resolve) return getLivDeaMod();
				return basicGetLivDeaMod();
			case LNGroupRPackage.RSYN__DEA_LIN_VAL:
				if (resolve) return getDeaLinVal();
				return basicGetDeaLinVal();
			case LNGroupRPackage.RSYN__LIV_LIN_VAL:
				if (resolve) return getLivLinVal();
				return basicGetLivLinVal();
			case LNGroupRPackage.RSYN__DEA_BUS_VAL:
				if (resolve) return getDeaBusVal();
				return basicGetDeaBusVal();
			case LNGroupRPackage.RSYN__PLS_TMMS:
				if (resolve) return getPlsTmms();
				return basicGetPlsTmms();
			case LNGroupRPackage.RSYN__BKR_TMMS:
				if (resolve) return getBkrTmms();
				return basicGetBkrTmms();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case LNGroupRPackage.RSYN__RHZ:
				setRHz((SPC)newValue);
				return;
			case LNGroupRPackage.RSYN__LHZ:
				setLHz((SPC)newValue);
				return;
			case LNGroupRPackage.RSYN__RV:
				setRV((SPC)newValue);
				return;
			case LNGroupRPackage.RSYN__LV:
				setLV((SPC)newValue);
				return;
			case LNGroupRPackage.RSYN__REL:
				setRel((SPS)newValue);
				return;
			case LNGroupRPackage.RSYN__VLND:
				setVlnd((SPS)newValue);
				return;
			case LNGroupRPackage.RSYN__ANG_IND:
				setAngInd((SPS)newValue);
				return;
			case LNGroupRPackage.RSYN__HZ_IND:
				setHzInd((SPS)newValue);
				return;
			case LNGroupRPackage.RSYN__SYN_PRG:
				setSynPrg((SPS)newValue);
				return;
			case LNGroupRPackage.RSYN__DIF_VCLC:
				setDifVClc((MV)newValue);
				return;
			case LNGroupRPackage.RSYN__DIF_ANG_CLC:
				setDifAngClc((MV)newValue);
				return;
			case LNGroupRPackage.RSYN__DIF_V:
				setDifV((ASG)newValue);
				return;
			case LNGroupRPackage.RSYN__DIF_HZ:
				setDifHz((ASG)newValue);
				return;
			case LNGroupRPackage.RSYN__DIF_ANG:
				setDifAng((ASG)newValue);
				return;
			case LNGroupRPackage.RSYN__LIV_DEA_MOD:
				setLivDeaMod((ING)newValue);
				return;
			case LNGroupRPackage.RSYN__DEA_LIN_VAL:
				setDeaLinVal((ASG)newValue);
				return;
			case LNGroupRPackage.RSYN__LIV_LIN_VAL:
				setLivLinVal((ASG)newValue);
				return;
			case LNGroupRPackage.RSYN__DEA_BUS_VAL:
				setDeaBusVal((ASG)newValue);
				return;
			case LNGroupRPackage.RSYN__PLS_TMMS:
				setPlsTmms((ING)newValue);
				return;
			case LNGroupRPackage.RSYN__BKR_TMMS:
				setBkrTmms((ING)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case LNGroupRPackage.RSYN__RHZ:
				setRHz((SPC)null);
				return;
			case LNGroupRPackage.RSYN__LHZ:
				setLHz((SPC)null);
				return;
			case LNGroupRPackage.RSYN__RV:
				setRV((SPC)null);
				return;
			case LNGroupRPackage.RSYN__LV:
				setLV((SPC)null);
				return;
			case LNGroupRPackage.RSYN__REL:
				setRel((SPS)null);
				return;
			case LNGroupRPackage.RSYN__VLND:
				setVlnd((SPS)null);
				return;
			case LNGroupRPackage.RSYN__ANG_IND:
				setAngInd((SPS)null);
				return;
			case LNGroupRPackage.RSYN__HZ_IND:
				setHzInd((SPS)null);
				return;
			case LNGroupRPackage.RSYN__SYN_PRG:
				setSynPrg((SPS)null);
				return;
			case LNGroupRPackage.RSYN__DIF_VCLC:
				setDifVClc((MV)null);
				return;
			case LNGroupRPackage.RSYN__DIF_ANG_CLC:
				setDifAngClc((MV)null);
				return;
			case LNGroupRPackage.RSYN__DIF_V:
				setDifV((ASG)null);
				return;
			case LNGroupRPackage.RSYN__DIF_HZ:
				setDifHz((ASG)null);
				return;
			case LNGroupRPackage.RSYN__DIF_ANG:
				setDifAng((ASG)null);
				return;
			case LNGroupRPackage.RSYN__LIV_DEA_MOD:
				setLivDeaMod((ING)null);
				return;
			case LNGroupRPackage.RSYN__DEA_LIN_VAL:
				setDeaLinVal((ASG)null);
				return;
			case LNGroupRPackage.RSYN__LIV_LIN_VAL:
				setLivLinVal((ASG)null);
				return;
			case LNGroupRPackage.RSYN__DEA_BUS_VAL:
				setDeaBusVal((ASG)null);
				return;
			case LNGroupRPackage.RSYN__PLS_TMMS:
				setPlsTmms((ING)null);
				return;
			case LNGroupRPackage.RSYN__BKR_TMMS:
				setBkrTmms((ING)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case LNGroupRPackage.RSYN__RHZ:
				return rHz != null;
			case LNGroupRPackage.RSYN__LHZ:
				return lHz != null;
			case LNGroupRPackage.RSYN__RV:
				return rv != null;
			case LNGroupRPackage.RSYN__LV:
				return lv != null;
			case LNGroupRPackage.RSYN__REL:
				return rel != null;
			case LNGroupRPackage.RSYN__VLND:
				return vlnd != null;
			case LNGroupRPackage.RSYN__ANG_IND:
				return angInd != null;
			case LNGroupRPackage.RSYN__HZ_IND:
				return hzInd != null;
			case LNGroupRPackage.RSYN__SYN_PRG:
				return synPrg != null;
			case LNGroupRPackage.RSYN__DIF_VCLC:
				return difVClc != null;
			case LNGroupRPackage.RSYN__DIF_ANG_CLC:
				return difAngClc != null;
			case LNGroupRPackage.RSYN__DIF_V:
				return difV != null;
			case LNGroupRPackage.RSYN__DIF_HZ:
				return difHz != null;
			case LNGroupRPackage.RSYN__DIF_ANG:
				return difAng != null;
			case LNGroupRPackage.RSYN__LIV_DEA_MOD:
				return livDeaMod != null;
			case LNGroupRPackage.RSYN__DEA_LIN_VAL:
				return deaLinVal != null;
			case LNGroupRPackage.RSYN__LIV_LIN_VAL:
				return livLinVal != null;
			case LNGroupRPackage.RSYN__DEA_BUS_VAL:
				return deaBusVal != null;
			case LNGroupRPackage.RSYN__PLS_TMMS:
				return plsTmms != null;
			case LNGroupRPackage.RSYN__BKR_TMMS:
				return bkrTmms != null;
		}
		return super.eIsSet(featureID);
	}

} //RSYNImpl


text:
package com.cb.dao;

/**
 *
 * @author jgarcia
 */
public class SearchException extends RuntimeException {

    public SearchException(Throwable ex) {
        super(ex);
    }

}


text:
<?php

namespace App\Containers\AppSection\User\Data\Factories;

use App\Containers\AppSection\User\Models\User;
use App\Ship\Parents\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;

class UserFactory extends Factory
{
    protected $model = User::class;

    public function definition(): array
    {
        static $password;

        return [
            'name' => $this->faker->name,
            'email' => $this->faker->unique()->safeEmail,
            'password' => $password ?: $password = Hash::make('testing-password'),
            'email_verified_at' => now(),
            'remember_token' => Str::random(10),
            'is_admin' => false,
        ];
    }

    public function admin(): UserFactory
    {
        return $this->state(function () {
            return [
                'is_admin' => true,
            ];
        });
    }

    public function unverified(): UserFactory
    {
        return $this->state(function () {
            return [
                'email_verified_at' => null,
            ];
        });
    }
}


text:
package org.hibernate.test.cache.infinispan.tm;

import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;

import org.hibernate.TransactionException;
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
import org.hibernate.service.jta.platform.spi.JtaPlatform;

/**
 * @author Steve Ebersole
 */
public class JtaPlatformImpl implements JtaPlatform {
	@Override
	public TransactionManager retrieveTransactionManager() {
		return XaTransactionManagerImpl.getInstance();
	}

	@Override
	public UserTransaction retrieveUserTransaction() {
		throw new TransactionException( "UserTransaction not used in these tests" );
	}

	@Override
	public Object getTransactionIdentifier(Transaction transaction) {
		return transaction;
	}

	@Override
	public boolean canRegisterSynchronization() {
		return JtaStatusHelper.isActive( XaTransactionManagerImpl.getInstance() );
	}

	@Override
	public void registerSynchronization(Synchronization synchronization) {
		try {
			XaTransactionManagerImpl.getInstance().getTransaction().registerSynchronization( synchronization );
		}
		catch (Exception e) {
			throw new TransactionException( "Could not obtain transaction from TM" );
		}
	}

	@Override
	public int getCurrentStatus() throws SystemException {
		return JtaStatusHelper.getStatus( XaTransactionManagerImpl.getInstance() );
	}
}


text:
Moje pierwsze repozytorium
test
test 2


text:
package mekanism.common.tile.component;

import io.netty.buffer.ByteBuf;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.gas.GasStack;
import mekanism.api.gas.GasTank;
import mekanism.api.gas.GasTransmission;
import mekanism.api.transmitters.TransmissionType;
import mekanism.common.SideData;
import mekanism.common.base.IEjector;
import mekanism.common.base.ILogisticalTransporter;
import mekanism.common.base.ISideConfiguration;
import mekanism.common.base.ITankManager;
import mekanism.common.base.ITileComponent;
import mekanism.common.base.ITransporterTile;
import mekanism.common.content.transporter.TransporterManager;
import mekanism.common.tile.TileEntityContainerBlock;
import mekanism.common.util.InventoryUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.PipeUtils;
import mekanism.common.util.TransporterUtils;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;

public class TileComponentEjector implements ITileComponent, IEjector
{
	public TileEntityContainerBlock tileEntity;

	public boolean strictInput;

	public EnumColor outputColor;

	public EnumColor[] inputColors = new EnumColor[] {null, null, null, null, null, null};

	public int tickDelay = 0;

	public Map<TransmissionType, SideData> sideData = new HashMap<TransmissionType, SideData>();

	public Map<TransmissionType, int[]> trackers = new HashMap<TransmissionType, int[]>();

	public static final int GAS_OUTPUT = 256;
	public static final int FLUID_OUTPUT = 256;

	public TileComponentEjector(TileEntityContainerBlock tile)
	{
		tileEntity = tile;

		tile.components.add(this);
	}

	public TileComponentEjector setOutputData(TransmissionType type, SideData data)
	{
		sideData.put(type, data);
		trackers.put(type, new int[data.availableSlots.length]);

		return this;
	}

	public void readFrom(TileComponentEjector ejector)
	{
		strictInput = ejector.strictInput;
		outputColor = ejector.outputColor;
		inputColors = ejector.inputColors;
		tickDelay = ejector.tickDelay;
		sideData = ejector.sideData;
	}

	private List<ForgeDirection> getTrackedOutputs(TransmissionType type, int index, List<ForgeDirection> dirs)
	{
		List<ForgeDirection> sides = new ArrayList<ForgeDirection>();

		for(int i = trackers.get(type)[index]+1; i <= trackers.get(type)[index]+6; i++)
		{
			for(ForgeDirection side : dirs)
			{
				if(ForgeDirection.getOrientation(i%6) == side)
				{
					sides.add(side);
				}
			}
		}

		return sides;
	}

	@Override
	public void tick()
	{
		if(tickDelay == 0)
		{
			if(sideData.get(TransmissionType.ITEM) != null)
			{
				outputItems();
			}
		}
		else {
			tickDelay--;
		}

		if(!tileEntity.getWorldObj().isRemote)
		{
			if(sideData.get(TransmissionType.GAS) != null && getEjecting(TransmissionType.GAS))
			{
				SideData data = sideData.get(TransmissionType.GAS);
				List<ForgeDirection> outputSides = getOutputSides(TransmissionType.GAS, data);

				GasTank tank = (GasTank)((ITankManager)tileEntity).getTanks()[data.availableSlots[0]];

				if(tank.getStored() > 0)
				{
					GasStack toEmit = tank.getGas().copy().withAmount(Math.min(GAS_OUTPUT, tank.getStored()));
					int emit = GasTransmission.emit(outputSides, toEmit, tileEntity);
					tank.draw(emit, true);
				}
			}

			if(sideData.get(TransmissionType.FLUID) != null && getEjecting(TransmissionType.FLUID))
			{
				SideData data = sideData.get(TransmissionType.FLUID);
				List<ForgeDirection> outputSides = getOutputSides(TransmissionType.FLUID, data);

				FluidTank tank = (FluidTank)((ITankManager)tileEntity).getTanks()[data.availableSlots[0]];

				if(tank.getFluidAmount() > 0)
				{
					FluidStack toEmit = new FluidStack(tank.getFluid().getFluid(), Math.min(FLUID_OUTPUT, tank.getFluidAmount()));
					int emit = PipeUtils.emit(outputSides, toEmit, tileEntity);
					tank.drain(emit, true);
				}
			}
		}
	}

	public List<ForgeDirection> getOutputSides(TransmissionType type, SideData data)
	{
		List<ForgeDirection> outputSides = new ArrayList<ForgeDirection>();

		ISideConfiguration configurable = (ISideConfiguration)tileEntity;

		for(int i = 0; i < configurable.getConfig().getConfig(type).length; i++)
		{
			if(configurable.getConfig().getConfig(type)[i] == configurable.getConfig().getOutputs(type).indexOf(data))
			{
				outputSides.add(ForgeDirection.getOrientation(MekanismUtils.getBaseOrientation(i, tileEntity.facing)));
			}
		}

		return outputSides;
	}

	@Override
	public void outputItems()
	{
		if(!getEjecting(TransmissionType.ITEM) || tileEntity.getWorldObj().isRemote)
		{
			return;
		}

		SideData data = sideData.get(TransmissionType.ITEM);
		List<ForgeDirection> outputSides = getOutputSides(TransmissionType.ITEM, data);

		for(int index = 0; index < sideData.get(TransmissionType.ITEM).availableSlots.length; index++)
		{
			int slotID = sideData.get(TransmissionType.ITEM).availableSlots[index];

			if(tileEntity.inventory[slotID] == null)
			{
				continue;
			}

			ItemStack stack = tileEntity.inventory[slotID];
			List<ForgeDirection> outputs = getTrackedOutputs(TransmissionType.ITEM, index, outputSides);

			for(ForgeDirection side : outputs)
			{
				TileEntity tile = Coord4D.get(tileEntity).getFromSide(side).getTileEntity(tileEntity.getWorldObj());
				ItemStack prev = stack.copy();

				if(tile instanceof IInventory && !(tile instanceof ITransporterTile))
				{
					stack = InventoryUtils.putStackInInventory((IInventory)tile, stack, side.ordinal(), false);
				}
				else if(tile instanceof ITransporterTile)
				{
					ItemStack rejects = TransporterUtils.insert(tileEntity, ((ITransporterTile)tile).getTransmitter(), stack, outputColor, true, 0);

					if(TransporterManager.didEmit(stack, rejects))
					{
						stack = rejects;
					}
				}

				if(stack == null || prev.stackSize != stack.stackSize)
				{
					trackers.get(TransmissionType.ITEM)[index] = side.ordinal();
				}

				if(stack == null)
				{
					break;
				}
			}

			tileEntity.inventory[slotID] = stack;
			tileEntity.markDirty();
		}

		tickDelay = 20;
	}

	@Override
	public boolean hasStrictInput()
	{
		return strictInput;
	}

	@Override
	public void setStrictInput(boolean strict)
	{
		strictInput = strict;
		MekanismUtils.saveChunk(tileEntity);
	}

	@Override
	public void setOutputColor(EnumColor color)
	{
		outputColor = color;
		MekanismUtils.saveChunk(tileEntity);
	}

	@Override
	public EnumColor getOutputColor()
	{
		return outputColor;
	}

	@Override
	public void setInputColor(ForgeDirection side, EnumColor color)
	{
		inputColors[side.ordinal()] = color;
		MekanismUtils.saveChunk(tileEntity);
	}

	@Override
	public EnumColor getInputColor(ForgeDirection side)
	{
		return inputColors[side.ordinal()];
	}

	@Override
	public void read(NBTTagCompound nbtTags)
	{
		strictInput = nbtTags.getBoolean("strictInput");

		if(nbtTags.hasKey("ejectColor"))
		{
			outputColor = TransporterUtils.colors.get(nbtTags.getInteger("ejectColor"));
		}

		for(TransmissionType type : sideData.keySet())
		{
			for(int i = 0; i < sideData.get(type).availableSlots.length; i++)
			{
				trackers.get(type)[i] = nbtTags.getInteger("tracker" + type.getTransmission() + i);
			}
		}

		for(int i = 0; i < 6; i++)
		{
			if(nbtTags.hasKey("inputColors" + i))
			{
				int inC = nbtTags.getInteger("inputColors" + i);

				if(inC != -1)
				{
					inputColors[i] = TransporterUtils.colors.get(inC);
				}
				else {
					inputColors[i] = null;
				}
			}
		}
	}

	@Override
	public void read(ByteBuf dataStream)
	{
		strictInput = dataStream.readBoolean();

		int c = dataStream.readInt();

		if(c != -1)
		{
			outputColor = TransporterUtils.colors.get(c);
		}
		else {
			outputColor = null;
		}

		for(int i = 0; i < 6; i++)
		{
			int inC = dataStream.readInt();

			if(inC != -1)
			{
				inputColors[i] = TransporterUtils.colors.get(inC);
			}
			else {
				inputColors[i] = null;
			}
		}
	}

	@Override
	public void write(NBTTagCompound nbtTags)
	{
		nbtTags.setBoolean("strictInput", strictInput);

		if(outputColor != null)
		{
			nbtTags.setInteger("ejectColor", TransporterUtils.colors.indexOf(outputColor));
		}

		for(TransmissionType type : sideData.keySet())
		{
			for(int i = 0; i < sideData.get(type).availableSlots.length; i++)
			{
				nbtTags.setInteger("tracker" + type.getTransmission() + i, trackers.get(type)[i]);
			}
		}

		for(int i = 0; i < 6; i++)
		{
			if(inputColors[i] == null)
			{
				nbtTags.setInteger("inputColors" + i, -1);
			}
			else {
				nbtTags.setInteger("inputColors" + i, TransporterUtils.colors.indexOf(inputColors[i]));
			}
		}
	}

	@Override
	public void write(ArrayList data)
	{
		data.add(strictInput);

		if(outputColor != null)
		{
			data.add(TransporterUtils.colors.indexOf(outputColor));
		}
		else {
			data.add(-1);
		}

		for(int i = 0; i < 6; i++)
		{
			if(inputColors[i] == null)
			{
				data.add(-1);
			}
			else {
				data.add(TransporterUtils.colors.indexOf(inputColors[i]));
			}
		}
	}

	private boolean getEjecting(TransmissionType type)
	{
		return ((ISideConfiguration)tileEntity).getConfig().isEjecting(type);
	}
}


text:
.PHONY: release bugfix

release:
	python3 scripts/release.py


text:
def up(cursor, bot):
    # Useful query for deleting duplicate games:
    # DELETE FROM hsbet_game a WHERE a.ctid <> (SELECT min(b.ctid) FROM hsbet_game b WHERE a.internal_id = b.internal_id);

    # hsbet_game.internal_id -> trackobot_id, +UNIQUE, -NOT NULL
    cursor.execute("ALTER TABLE hsbet_game RENAME COLUMN internal_id TO trackobot_id")
    cursor.execute("ALTER TABLE hsbet_game ALTER COLUMN trackobot_id DROP NOT NULL")
    cursor.execute("ALTER TABLE hsbet_game ADD UNIQUE(trackobot_id)")

    # new: hsbet_game.bet_deadline
    cursor.execute("ALTER TABLE hsbet_game ADD COLUMN bet_deadline TIMESTAMPTZ")

    # hsbet_game.outcome: -NOT NULL
    cursor.execute("ALTER TABLE hsbet_game ALTER COLUMN outcome DROP NOT NULL")

    # hsbet_game: Check that either both trackobot_id and outcome are NULL, or both are not.
    cursor.execute(
        "ALTER TABLE hsbet_game ADD CHECK ((trackobot_id IS NULL AND outcome is NULL) OR (trackobot_id IS NOT NULL AND outcome is NOT NULL))"
    )

    # hsbet_game.game_id: add ON DELETE CASCADE
    cursor.execute("ALTER TABLE hsbet_bet DROP CONSTRAINT hsbet_bet_game_id_fkey")
    cursor.execute("ALTER TABLE hsbet_bet ADD FOREIGN KEY (game_id) REFERENCES hsbet_game(id) ON DELETE CASCADE")

    # hsbet_game: Remove id column, add combined primary key
    cursor.execute("ALTER TABLE hsbet_bet DROP CONSTRAINT hsbet_bet_pkey")
    cursor.execute("ALTER TABLE hsbet_bet DROP COLUMN id")
    cursor.execute("ALTER TABLE hsbet_bet ADD PRIMARY KEY (game_id, user_id)")

    # hsbet_game.profit: -NOT NULL
    cursor.execute("ALTER TABLE hsbet_bet ALTER COLUMN profit DROP NOT NULL")


text:
package com.jdon.async.disruptor;

import java.util.concurrent.TimeUnit;

import com.jdon.async.EventResultHandler;
import com.lmax.disruptor.RingBuffer;
import com.lmax.disruptor.TimeoutBlockingWaitStrategy;

public class EventResultHandlerImp implements EventResultHandler {

	// MILLISECONDS default is one seconds
	protected ValueEventProcessor valueEventProcessor;

	public EventResultHandlerImp(int timeoutforeturnResult) {
		super();
		RingBuffer ringBuffer = RingBuffer.createSingleProducer(new EventResultFactory(), 1, new TimeoutBlockingWaitStrategy(timeoutforeturnResult,
				TimeUnit.MILLISECONDS));
		this.valueEventProcessor = new ValueEventProcessor(ringBuffer);

	}

	/**
	 * send event result
	 *
	 */
	public void send(Object result) {
		valueEventProcessor.send(result);
	}

	public Object get() {
		Object result = null;
		EventResultDisruptor ve = valueEventProcessor.waitFor();
		if (ve != null) {
			result = ve.getValue();
			ve.clear();
			// clear();
		}
		return result;

	}

	public Object getBlockedValue() {
		Object result = null;
		EventResultDisruptor ve = valueEventProcessor.waitForBlocking();
		if (ve != null) {
			result = ve.getValue();
			ve.clear();
			// clear();
		}
		return result;
	}

	public void clear() {
		valueEventProcessor.clear();
	}

	/**
	 * deprecated since 6.6.8
	 */
	public void setWaitforTimeout(int timeoutforeturnResult) {
		System.err.print("deprecated since 6.6.8");
	}

}


text:
<bill session="115" type="h" number="3552" updated="2017-10-04T07:16:29Z">
  <state datetime="2017-07-28">REFERRED</state>
  <status>
    <introduced datetime="2017-07-28"/>
  </status>
  <introduced datetime="2017-07-28"/>
  <titles>
    <title type="short" as="introduced">Cady Housh and Jason Flatt Teen Suicide Prevention Act of 2017</title>
    <title type="short" as="introduced">Cady Housh and Jason Flatt Teen Suicide Prevention Act of 2017</title>
    <title type="official" as="introduced">To amend the Elementary and Secondary Education Act of 1965 to require that teachers, principals, counselors, and other school leaders receive youth suicide awareness and prevention training.</title>
    <title type="display">Cady Housh and Jason Flatt Teen Suicide Prevention Act of 2017</title>
  </titles>
  <sponsor bioguide_id="C001061"/>
  <cosponsors>
    <cosponsor bioguide_id="B001273" joined="2017-09-13"/>
    <cosponsor bioguide_id="J000288" joined="2017-10-03"/>
    <cosponsor bioguide_id="M001137" joined="2017-09-27"/>
    <cosponsor bioguide_id="N000147" joined="2017-10-03"/>
    <cosponsor bioguide_id="Y000063" joined="2017-07-28"/>
  </cosponsors>
  <actions>
    <action datetime="2017-07-28">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-07-28" state="REFERRED">
      <text>Referred to the House Committee on Education and the Workforce.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSED" name="House Education and the Workforce" activity="Referral"/>
  </committees>
  <relatedbills/>
  <subjects>
    <term name="Education"/>
  </subjects>
  <amendments/>
  <committee-reports/>
</bill>


text:
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIView *topView;
@property (weak, nonatomic) IBOutlet UIView *middleView;
@property (weak, nonatomic) IBOutlet UIView *bottomView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Sample
    _topView.backgroundColor = [UIColor colorWithColorCode:@"FF00FF" alpha:1.0f];
    _middleView.backgroundColor = [UIColor colorWithColorCode:@"00FFFF" alpha:1.0f];
    _bottomView.backgroundColor = [UIColor colorWithColorCode:@"FFFF00" alpha:1.0f];
    self.view.backgroundColor = [UIColor colorWithImageName:@"wallpaper.jpg"];
}

@end


text:
import { test } from 'qunit';
import moduleForAcceptance from 'kube-admin/tests/helpers/module-for-acceptance';
import Mirage from 'ember-cli-mirage';

moduleForAcceptance('Acceptance | replicationcontroller details');

test('it scales a replication controller', function(assert) {
  assert.expect(1);
  let rc = server.create('replicationcontroller'),
      newReplicas = rc.status.replicas + 2,
      url = `/namespaces/${rc.metadata.namespace}/replication-controllers/${rc.metadata.name}`;

  let done = assert.async();
  server.put(`/namespaces/${rc.metadata.namespace}/replicationcontrollers/${rc.metadata.name}`, (db, request) => {
    let replicas = JSON.parse(request.requestBody).spec.replicas;
    assert.equal(replicas, newReplicas);
    done();
  });

  visit(url);
  fillIn('[data-id=rc-scale] input', newReplicas);
  click('[data-id=rc-scale] button');
});

test('it shows error message if scale request failed', function(assert) {
  assert.expect(2);
  let rc = server.create('replicationcontroller'),
      newReplicas = rc.status.replicas + 2,
      url = `/namespaces/${rc.metadata.namespace}/replication-controllers/${rc.metadata.name}`;
  server.put(`/namespaces/${rc.metadata.namespace}/replicationcontrollers/${rc.metadata.name}`, () => {
    let data = {
      code: 406,
      kind: 'Status',
      message: 'some fake error msg',
      metadata: {},
      reason: 'Reason',
      status: 'Failure'
    };
    return new Mirage.Response(406, {}, data);
  });

  visit(url);
  fillIn('[data-id=rc-scale] input', newReplicas);
  click('[data-id=rc-scale] button');
  andThen(function() {
    assert.equal(find('.ui.negative.message').length, 1);
    assert.equal(find('.ui.negative.message').text().trim(), 'some fake error msg');
  });
});


text:
package net.minidev.ovh.api.dedicatedcloud.host;

/**
 * All states a Dedicated Cloud Host can be in
 */
public enum OvhStateEnum {
	adding("adding"),
	delivered("delivered"),
	error("error"),
	removing("removing"),
	unknown("unknown");

	final String value;

	OvhStateEnum(String s) {
		this.value = s;
	}

	public String toString() {
		return this.value;
	}
}


text:
; if (typeof dnn === "undefined" || dnn === null) { dnn = {}; }; //var dnn = dnn || {};

// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
(function ($, window, document, undefined) {
    "use strict";

    // undefined is used here as the undefined global variable in ECMAScript 3 is
    // mutable (ie. it can be changed by someone else). undefined isn't really being
    // passed in so we can ensure the value of it is truly undefined. In ES5, undefined
    // can no longer be modified.

    // window and document are passed through as local variables rather than globals
    // as this (slightly) quickens the resolution process and can be more efficiently
    // minified (especially when both are regularly referenced in your plugin).

    // The actual plugin constructor
    var PageUrl = this.PageUrl = function (options) {
        this.options = options;
        this.init();
    };

    PageUrl.prototype = {
        constructor: PageUrl,

        init: function () {

            this.options = $.extend({}, PageUrl.defaults(), this.options);
            this.$this = $(this);
            this._serviceUrl = $.dnnSF().getServiceRoot("InternalServices");

            // Select a Page to Test section:
            this._$pageUrlContainer = $("#" + this.options.pageUrlContainerId);
            this._$pageUrlInputInput = $("#" + this.options.pageUrlInputId);
            this._$pageUrlInputInput.prefixInput({ prefix: "/" });
        },

        makeUpdatable: function() {
            var $button = $("<a href='javascript:void(0);' class='dnnSecondaryAction' />")
                .text($.htmlEncode(this.options.updateUrlButtonCaption))
                .prop("title", this.options.updateUrlButtonTooltip);
            var savePageUrlHandler = $.proxy(this._savePageUrl, this);
            $button.on("click", savePageUrlHandler);
            this._$pageUrlInputInput.onEnter(savePageUrlHandler);
            this._$pageUrlContainer.append($button);
            this._$pageUrlContainer.removeClass().addClass("um-page-url-container-updatable");
        },

        _savePageUrl: function () {

            var path = this._$pageUrlInputInput.val();

            var postData = this.options.updateUrlDto;
            postData.Path = path;

            if (!this._updateCustomUrlServiceSettings) {
                this._updateCustomUrlServiceSettings = {
                    beforeSend: $.dnnSF().setModuleHeaders,
                    url: this._serviceUrl + "PageService/UpdateCustomUrl",
                    type: "POST",
                    async: true,
                    success: $.proxy(this._onUpdateUrl, this),
                    error: $.onAjaxError
                };
            }
            var serviceSettings = this._updateCustomUrlServiceSettings;
            serviceSettings.data = postData;
            $.ajax(serviceSettings);
        },

        _onUpdateUrl: function (data, textStatus, jqXhr) {
            if (data.Success) {
                this.$this.trigger("onUpdateUrl");
                this._$pageUrlInputInput.quickHighlight();
            }
            else {
                $.dnnAlert({ title: this.options.errorTitle || "Error", text: data.ErrorMessage || "Unknown error" });
                if (data.SuggestedUrlPath) {
                    this._$pageUrlInputInput.val(data.SuggestedUrlPath);
                }
            }
        }

    };

    PageUrl._defaults = {};

    PageUrl.defaults = function (settings) {
        if (typeof settings !== "undefined") {
            $.extend(PageUrl._defaults, settings);
        }
        return PageUrl._defaults;
    };

}).apply(dnn, [jQuery, window, document]);

dnn.createPageUrl = function (options) {
    $(document).ready(function () {
        var instance = new dnn.PageUrl(options);
        dnn.PageUrlSynchronizer.getInstance().setPageUrl(instance);
    });
};

(function ($, window, document, undefined) {
    "use strict";

    // undefined is used here as the undefined global variable in ECMAScript 3 is
    // mutable (ie. it can be changed by someone else). undefined isn't really being
    // passed in so we can ensure the value of it is truly undefined. In ES5, undefined
    // can no longer be modified.

    // window and document are passed through as local variables rather than globals
    // as this (slightly) quickens the resolution process and can be more efficiently
    // minified (especially when both are regularly referenced in your plugin).

    var PageUrlSynchronizer = this.PageUrlSynchronizer = dnn.singletonify(PageUrlSynchronizerInternal);

    function PageUrlSynchronizerInternal() {
        this.init();
    };

    PageUrlSynchronizerInternal.prototype = {
        constructor: PageUrlSynchronizerInternal,

        init: function () {
            this._$urlManagementInstance = null;
            this._$pageUrlInstance = null;
        },

        setPageUrl: function (instance) {
            if (!instance) {
                return;
            }
            this._$pageUrlInstance = $(instance);
            this._$pageUrlInstance.on("onUpdateUrl", $.proxy(this._onUpdateUrl, this));
            //if (this._urlManagementInstance) {
            instance.makeUpdatable();
            //}
        },

        _onUpdateUrl: function() {
            if (this._urlManagementInstance) {
                this._urlManagementInstance.refreshView();
            }
        },

        setUrlManagement: function (instance) {
            if (!instance) {
                return;
            }
            this._urlManagementInstance = instance;
            //if (this._$pageUrlInstance.length > 0) {
            //    this._$pageUrlInstance[0].makeUpdatable();
            //}
        }

    };

}).apply(dnn, [jQuery, window, document]);


text:
//
//  SecondViewController.m
//  timeAlertT
//
//  Created by mac on 15-11-3小郎.
//  Copyright © 2015年 wh. All rights reserved.
//

#import "SecondViewController.h"
#import "SecondView.h"
#import "Model.h"

@interface SecondViewController ()
{
    SecondView *_secV;

    Model *_model;
}

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    _secV = [[[NSBundle mainBundle] loadNibNamed:@"SecondView" owner:nil options:nil] lastObject];

    _addBtn = _secV.addButton;

    [self.view addSubview:_secV];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package helloworld;
import java.io.IOException;

/**
 *
 * @author Asad
 */
public class HelloWorld {

    /**
     * @param s the command line arguments
     * @throws java.io.IOException
     */
    public static void main(String[] s) throws IOException {
        // TODO code application logic here
        Mark[] marks;
        if (s.length>0)
        {
            marks=new Mark[s.length];
            for (int i=0;i<s.length;i++)
                marks[i]=new Mark(Integer.parseInt(s[0]));
        }
        else
        {
            marks=new Mark[3];
            Mark.scanMarks(marks, 3);
        }
        for (Mark mark : marks) {
            if (mark.mark <=30) {
                System.out.println("Poor Performanec work hard");
            }
            else if (mark.mark > 30 && mark.mark <= 45 ) {
                System.out.println("Passed with C Grade");
            }
            else if (mark.mark > 45 && mark.mark <= 60 ) {
                System.out.println("Passed with B Grade");
            }
            else if (mark.mark > 60) {
                System.out.println("Passed with A grade");
            }else{
                System.out.println("Invaild Input");
            }
        }
    }

}


text:
var constants = require('../../../../constants');

module.exports = function(Client){
	return Client.sub({
		getOrderHandlingFee :Client.method({
			method: constants.verbs.GET,
			url: '{+tenantPod}api/commerce/settings/shipping/orderhandlingfee?responseFields={responseFields}'
		}),
		createOrderHandlingFee :Client.method({
			method: constants.verbs.POST,
			url: '{+tenantPod}api/commerce/settings/shipping/orderhandlingfee?responseFields={responseFields}'
		}),
		updateOrderHandlingFee :Client.method({
			method: constants.verbs.PUT,
			url: '{+tenantPod}api/commerce/settings/shipping/orderhandlingfee?responseFields={responseFields}'
		})
	});
};


text:
module Bamboo
  module Client
    module Http
      class Abstract
        attr_reader :uri

        def initialize(url)
          @uri = URI.parse url
        end

        private

        # argument is only an uri if its coming from a result set.
        # in this case, we don't need to prefix the path anymore.
        def uri_for(uri_or_path, params = nil)
          if uri_or_path.kind_of? URI
            u = uri_or_path.dup

            u.host   = @uri.host
            u.port   = @uri.port
            u.scheme = @uri.scheme
          else
            u = uri.dup
            u.path = File.join(uri.path, uri_or_path)
          end

          u.query = query_string_for(params) if params
          u.to_s
        end

        def query_string_for(params)
          params.map { |k, v| "#{k.to_s}=#{CGI.escape(v.to_s)}" }.join('&')
        end

      end # Abstract
    end # Http
  end # Client
end # Bamboo


text:
* Your contributions here

### 3.2.0 (February 24, 2017)

* [#176](https://github.com/alexa-js/alexa-app/pull/176): Express integration now requires either `expressApp` or `router`, but not both - [@bgjehu](https://github.com/bgjehu).
* [#174](https://github.com/alexa-js/alexa-app/pull/174): Always enforce strict header checking - [@tejashah88](https://github.com/tejashah88).
* [#182](https://github.com/alexa-js/alexa-app/issues/182): Fixed user-defined error handler to automatically resolve unresolved responses - [@rickwargo](https://github.com/rickwargo).
* [#184](https://github.com/alexa-js/alexa-app/pull/184): Implemented slot defaults without exceptions - [@rickwargo](https://github.com/rickwargo).

### 3.1.0 (February 13, 2017)

* [#162](https://github.com/alexa-js/alexa-app/issues/162): Fix: do not generate empty slots in schema - [@dblock](https://github.com/dblock).
* [#134](https://github.com/alexa-js/alexa-app/pull/134): Adding deprecation notices for plan to use Promises for async functionality - [ajcrites](https://github.com/ajcrites).

### 3.0.0 (February 6, 2017)

* [#152](https://github.com/alexa-js/alexa-app/issues/152): Mounted a JSON body-parser after verifier middleware and removed `bodyParser.urlencoded` in Express integration - [@dblock](https://github.com/dblock).
* [#150](https://github.com/alexa-js/alexa-app/pull/150): Added `preRequest` and `postRequest` to express integration - [@dblock](https://github.com/dblock).
* [#150](https://github.com/alexa-js/alexa-app/pull/150): Dump schema and utterances in debug mode - [@dblock](https://github.com/dblock).
* [#144](https://github.com/alexa-js/alexa-app/pull/144): Simplified and refactored the `express` interface - [@mreinstein](https://github.com/mreinstein).
* [#141](https://github.com/alexa-js/alexa-app/pull/141): Fail the response on exception in case of AudioPlayer request - [@fremail](https://github.com/fremail).
* [#139](https://github.com/alexa-js/alexa-app/pull/139): Compatibility with Node.js v0.12 - v7 - [@tejashah88](https://github.com/tejashah88).
* [#125](https://github.com/alexa-js/alexa-app/pull/125): Force new when instantiating alexa.app - [@OpenDog](https://github.com/OpenDog).
* [#119](https://github.com/alexa-js/alexa-app/pull/119): Moved to the [alexa-js organization](https://github.com/alexa-js) - [@dblock](https://github.com/dblock).
* [#118](https://github.com/matt-kruse/alexa-app/pull/118), [#117](https://github.com/matt-kruse/alexa-app/issues/117): Prevent updating session attributes directly - [@ajcrites](https://github.com/ajcrites).
* [#133](https://github.com/matt-kruse/alexa-app/pull/133), [#71](https://github.com/matt-kruse/alexa-app/issues/71): Support asynchronous patterns in request handlers - [@ajcrites](https://github.com/ajcrites).
* [#159](https://github.com/alexa-js/alexa-app/pull/159), [#157](https://github.com/alexa-js/alexa-app/issues/157): Fixed `SessionEndedRequest` hangs without a defined `sessionEndedFunc` - [@dblock](https://github.com/dblock).

### 2.4.0 (January 5, 2017)

* [#76](https://github.com/alexa-js/alexa-app/pull/76): `response.clear()` now sets the default `outputSpeech` to SSML - [@rickwargo](https://github.com/rickwargo).
* [#90](https://github.com/alexa-js/alexa-app/pull/90): Added [Danger](http://danger.systems), PR linter - [@dblock](https://github.com/dblock).
* [#91](https://github.com/alexa-js/alexa-app/pull/91): Fixed "Cannot read property 'new' of undefined" init error - [@fremail](https://github.com/fremail).
* [#88](https://github.com/alexa-js/alexa-app/pull/88), [#92](https://github.com/alexa-js/alexa-app/pull/92): AudioPlayer functionality - [@wschaeferiii](https://github.com/wschaeferiii) and [@fremail](https://github.com/fremail).
* [#101](https://github.com/alexa-js/alexa-app/pull/101): Added `request.context` - [@trayburn](https://github.com/trayburn).

### 2.3.4 (May 23, 2016)

* [#68](https://github.com/alexa-js/alexa-app/pull/68): Added support for custom slot types - [@mutexkid](https://github.com/mutexkid).

### 2.3.3 (May 7, 2016)

* [#59](https://github.com/alexa-js/alexa-app/pull/59): Added full card type support - [@doapp-ryanp](https://github.com/doapp-ryanp).

### 2.3.2 (Jan 11, 2016)

* [#47](https://github.com/alexa-js/alexa-app/pull/47): Fixed number output in SSML tags back to being digits - [@rickwargo](https://github.com/rickwargo).
* [#60](https://github.com/alexa-js/alexa-app/pull/60): Added automated tests for SSML - [@mutexkid](https://github.com/mutexkid).
* [#57](https://github.com/alexa-js/alexa-app/pull/57): Removed support for no longer used card subtitle - [@rickwargo](https://github.com/rickwargo).

### 2.3.0 (Jan 8, 2016)

* [#46](https://github.com/alexa-js/alexa-app/pull/46): Added "numbered" to the depencies list in package.json - [@mreinstein](https://github.com/mreinstein).

### 2.3.0 (Jan 4, 2016)

* [#31](https://github.com/alexa-js/alexa-app/pull/31): Added support for SSML - [@rickwargo](https://github.com/rickwargo).
* [#38](https://github.com/alexa-js/alexa-app/pull/38): Added `.linkAccount()` method to return Link Account card - [@christianewillman](https://github.com/christianewillman).
* [#37](https://github.com/alexa-js/alexa-app/pull/37): Added `request.sessionDetails.accessToken` for skills using account linking - [@christianewillman](https://github.com/christianewillman).
* Added MIT license file - [@matt-kruse](https://github.com/matt-kruse).

### 2.2.0 (Oct 26, 2015)

* Bumped alexa-utterances to version 0.1.0 - [@matt-kruse](https://github.com/matt-kruse).
* [#27](https://github.com/alexa-js/alexa-app/issues/27): Added support for the `exhaustiveUtterances` option in alexa-utterances - [@matt-kruse](https://github.com/matt-kruse).
* By default, alexa-app utterances now avoid the cartesian product of all slot values - [@matt-kruse](https://github.com/matt-kruse).

### 2.1.5 (Oct 25, 2015)

* [#26](https://github.com/alexa-js/alexa-app/issues/26): Externalized the generation of utterances to the new alexa-utterances module - [@matt-kruse](https://github.com/matt-kruse).

### 2.1.4 (Sep 14, 2015)

* [#17](https://github.com/alexa-js/alexa-app/issues/17): Remove hyphen from generated numbers in utterances - [@matt-kruse](https://github.com/matt-kruse).
* [#18](https://github.com/alexa-js/alexa-app/issues/18): Collapse multiple whitespaces to one space in utterances - [@matt-kruse](https://github.com/matt-kruse).


text:
package org.elasticsearch.index.engine;

import org.elasticsearch.index.shard.ShardId;

/**
 *
 */
public class RecoveryEngineException extends EngineException {

    private final int phase;

    public RecoveryEngineException(ShardId shardId, int phase, String msg, Throwable cause) {
        super(shardId, "Phase[" + phase + "] " + msg, cause);
        this.phase = phase;
    }

    public int phase() {
        return phase;
    }
}