text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#F9F9F9"
    android:orientation="vertical">

    <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
        android:id="@+id/text_card_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="2dp"
        android:layout_marginLeft="4dp"
        android:layout_marginRight="4dp"
        android:layout_marginTop="2dp"
        android:background="@color/cardview_light_background"
        card_view:cardCornerRadius="2dp"
        card_view:cardElevation="4dp"
        card_view:cardUseCompatPadding="true">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:paddingBottom="16dp"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:paddingTop="24dp">

            <TextView
                android:id="@+id/text_view_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="#000000"
                android:textSize="24sp" />

            <TextView
                android:id="@+id/text_view_date"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="#BDBDBD"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/text_view_body"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="#000000"
                android:textSize="14sp" />
        </LinearLayout>
    </android.support.v7.widget.CardView>

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
<META http-equiv="content-type" content="text/html;charset=iso-8859-9"/><meta name="viewport" content="width=device-width, initial-scale=1"><title>ac</title> <link rel="stylesheet"  href="css/jquery.mobile-1.2.0.css" />

NESEVÝ

Geri

Evliyanýn büyüklerinden. Ýsmi Muhammed bin Aliyyan'dýr. Bisme ilinin önde gelen
alimlerinden idi. Ebu Osman Hayri ve Cüneyd-i Baðdadi'nin sohbetlerinde bulundu ve
onlardan ders aldý. Muhammed bin Aliyyan, marifet ehlinin imamý idi. Himmeti yüksek ve
kerametleri açýk bir alim idi. Kerametlerini hiç gizlemezdi. Muhammed bin Aliyyan'ýn

doðum ve vefat tarihleri bilinmemekle beraber, onuncu asýrda yaþamýþtýr.

Þöyle anlatýlýr: "Birgün aklýna bir sual geldi. Düþündü taþýndý, buna bir türlü cevap bulamadý.
Bu sualin cevabýný hoca Ebu Osman Hayri'den baþka kimse halledemez dedi. Bulunduðu
yerden sualine cevap almak için Niþabur'a gitti. Sualinin cevabýný alýncaya kadar yolda hiçbir
þey yemedi ve içmedi."

Muhammed bin Aliyyan buyurdu ki: "Harama düþerim korkusuyla mübahlarýn çoðunu terk
etmek, ahiret arzusunun anahtarýdýr."

"Gözünün gördüðü nimetleri senden esirgemeyeni nasýl sevmezsin? Yine O'na uymadýðýn
halde, O'nu sevdiðini nasýl iddia edersin?"

"Allahü tealanýn kulundan razý olmasýnýn alameti nedir?" diye sorulunca, buyurdu ki:
"Ýbadetlerin tatlý ve rahat, günahlarýn zehir ve aðýr gelmesidir."

"Cömert, cömertliðini küçük görmedikçe ve onu kabul edeni kendinden üstün
görmedikçe sofi olamaz."

"Fakirlerle sohbet eden kimse, onlarla; sýrrýn selameti, nefsin cömertliði, gönlün geniþliði,
nimetlerle mihnetin kabulü hususunda sohbet etsin."

"Fakirlerin en fakiri, kendisini gani edecek kimseye (Allahü tealaya) ulaþamayan (hidayet
bulamayan) dýr."

"Ýyilik ve mürüvvet, dinin muhafýzý, insanýn koruyucusu, müminin bekçisidir."

"Mevcut olan þeyde cömertlik, kendisinde olan her türlü iþleri kusurlu görmektir."

"Allahü tealaya sevap umarak veya azabýndan korkarak hizmet eden, tamahýný ve hasisliðini
ortaya koyar. Kulun efendisine bir bedel (menfaat) karþýlýðý hizmet etmesi ne kötü þeydir."

"Bu yolun baþlangýcýnda iken, nefsin afetlerini görür ve onun gizlendiði yerleri bilir vaziyete
gelmiþtim. Ona karþý kalbimde daimi surette bir kin vardý. Bir gün boðazýmdan tilki
yavrusunun çýkardýðý ses gibi bir þey çýktý. Allahü teala beni, onu tanýr hale getirdi. Anladým
ki o, nefsdir, ayaklarýmýn altýna aldým, çiðnemeye baþladým, ama her tekme atýþýmda daha da
büyüyordu. Ona; "Hey sana ne oluyor, herþey döðmek ve sýkýntý çekmekle helak oluyor. Sen
ise daha da fazlalaþýyorsun?" dedim. Bana dedi ki: "Benim yaratýlýþým terstir. Bir þeye sýkýntý
ve üzüntü veren bir þey, bana rahat ve zevk verir. Diðer þeylere rahatlýk temin eden birþey,
bana meþakkat getirir."

"Mürüvvet; dinini korumak ve nefsini tanýmak, müminlere hürmet etmek, kendi kusurlarýný
görmektir."

1) Tabakat-üs-Sufiyye; s.417

2) Tabakat-ül-Kübra; c.1, s.116

3) Hilyet-ül-Evliya c.10, s.376

4) Ýslam Alimleri Ansiklopedisi; c.4, s.222


text:
$(document).on('click', '.completed', function ( event )
{
	event.preventDefault();
	event.stopImmediatePropagation();

	var num_sections = $('.quiz-section').length;
	var section_index = $('.quiz-section').index( $(this).closest('.quiz-section') );
	if ( section_index < num_sections - 1 )
	{
		$('.section-tile').eq(section_index).addClass('complete');
		$('.section-tile').eq(section_index + 1).trigger('click');
	}
	else
	{
		// Build the quiz

		// Clear existing questions
		$('.quiz form > ol > li:not(.quiz-question-template)').remove();
		// Create clean templates
		var $template = $('.quiz-question-template').clone().removeClass('quiz-question-template');
		var $answer_template = $template.find('li').clone();
		$template.find('ul').empty();

		// Loop over module questions
		var module = $('#education-center-body')[0].className.replace('quiz_', '');
		var questions = quizzes[module]['questions'];
		for ( var key in questions )
		{
			// Skip loop if the property is from prototype
			if ( ! questions.hasOwnProperty(key) || key.length == 0 )
			{
				continue;
			}

			var question_id = key;
			var question = questions[key];
			var answers = question['answers'];

			// Create question and answer html and data
			var $question = $template.clone();
			$question.find('span').html( question.content );
			var $question_answer_list = $question.find('ul');

			for ( var key in answers )
			{
				// Skip loop if the property is from prototype
				if ( ! answers.hasOwnProperty(key) || key.length == 0 )
				{
					continue;
				}

				var answer_id = key;
				var answer = answers[key];

				var $answer = $answer_template.clone();
				$answer
				.find('input').attr({
					'name' : question_id,
					'value' : encodeURIComponent(answer.content),
					'data-answer_id' : answer_id
				}).end()
				.find('span').html( answer.content );
				$question_answer_list.append( $answer );
			}

			$('.quiz form > ol').append( $question );
		}

		// Scroll to content
		$('html,body').animate({
			scrollTop : $('#education-center-body').offset().top
		},
		fade_interval,
		function ()
		{
			// Toggle quiz forms
			$('.modules').hide();
			$('.quiz').fadeIn();
		});
	}
});


text:
require_relative "action_controller/crud_additions"
require_relative "action_controller/crud_admin_additions"

module HasCrud
  module ActionController
    def self.included(base)
      base.send :extend, ClassMethods
      base.send :include, InstanceMethods
      base.send :helper_method, :has_crud?
    end

    module ClassMethods
      def has_crud(options = {})
        options ||= {}
        send :include, HasCrud::ActionController::CrudAdditions
        send :include, HasCrud::ActionController::CrudAdminAdditions if options[:admin]
      end
    end

    module InstanceMethods
      def has_crud?
        false
      end
    end
  end
end


text:
@class NSDate;

MEDIAPLAYER_EXPORT_CLASS
@interface MPMediaLibrary : NSObject <NSSecureCoding>

+ (MPMediaLibrary*)defaultMediaLibrary STUB_METHOD;

@property (readonly, nonatomic) NSDate* lastModifiedDate STUB_PROPERTY;

- (void)beginGeneratingLibraryChangeNotifications STUB_METHOD;
- (void)endGeneratingLibraryChangeNotifications STUB_METHOD;

@end


text:
(function(){
  'use strict';

  angular
    .module('shareMark', ['ngMessages', 'ui.router', 'templates', 'ngclipboard', 'ngTagsInput'])

    .config(['$httpProvider', '$urlRouterProvider', '$stateProvider', '$locationProvider', function ($httpProvider, $urlRouterProvider, $stateProvider, $locationProvider) {

      $httpProvider.useApplyAsync(true);
      $urlRouterProvider.otherwise('/');

      // NOTE: Use the HTML5 History API
      $locationProvider.html5Mode(true);

      $stateProvider
      .state('home', {
        url: "/",
        template: "<home></home>"
      })

      .state('new', {
        url: '/new',
        template: '<new></new>'
      })

      .state('tagList', {
        url: "/tags",
        template: "<tag-list></tag-list>"
      })

      .state('search', {
          url: '/search',
          template: '<search></search>'
      })

      .state('tagBookmarkList', {
        url: "/tags/:tagName",
        template: "<tag-bookmark-list></tag-bookmark-list>"
      })

      .state('show', {
        url: '/bookmarks/:id',
        template: '<show></show>'
      })

    }]);//end config

}());


text:
import Popover from './src/popover.vue'

Popover.install = function (Vue) {
  Vue.component(Popover.name, Popover)
}

export default Popover


text:
package ozmi.lambda_core

import org.kiama.rewriting.Strategy
import org.kiama.rewriting.Rewriter._

package object lib {

    abstract class Operator (val symbol : Id) extends EvalRules {
        def evalRules: Strategy = fail
    }

    abstract class NullaryOp (symbol : String) extends Operator (symbol) {

        def apply () : Expr =
            Lookup (symbol)

        def unapply (expr : Expr) : Boolean = expr match {
            case Lookup (`symbol`) => true
            case _                 => false
        }

    }

    abstract class UnaryOp (symbol : Id) extends Operator (symbol) {

        def apply (arg : Expr) : Expr =
            Apply (Lookup (symbol), arg)

        def unapply (expr : Expr) : Option[Expr] = Some (expr) collect {
            case Apply (Lookup (`symbol`), arg) => arg
        }

    }

    abstract class BinaryOp (symbol : String) extends Operator (symbol) {

        def apply (arg1 : Expr, arg2 : Expr) : Expr =
            Apply (Lookup (symbol), arg1, arg2)

        def unapply (expr : Expr) : Option[(Expr, Expr)] = Some (expr) collect {
            case Apply (Lookup (`symbol`), arg1, arg2) => (arg1, arg2)
        }

    }

    abstract class MultiaryOp (symbol : Id) extends Operator (symbol) {

        def apply (exprs : Expr*) : Expr =
            Apply (Lookup (symbol) +: exprs : _*)

        def unapplySeq (expr : Expr) : Option[Seq[Expr]] = Some (expr) collect {
            case Apply (Lookup (fun), args @ _*) => args
        }

    }

}


text:
import { Assert, UnitTest } from '@ephox/bedrock-client';

import { createFile } from 'ephox/agar/api/Files';
import * as Logger from 'ephox/agar/api/Logger';
import { Pipeline } from 'ephox/agar/api/Pipeline';
import { Step } from 'ephox/agar/api/Step';
import { readBlobAsText } from 'ephox/agar/test/BlobReader';

UnitTest.asynctest('FilesTest', (success, failure) => {
  Pipeline.async({}, [
    Logger.t('Create file', Step.sync(() => {
      const file = createFile('test.txt', 1234, new Blob([ '123' ], { type: 'text/plain' }));

      Assert.eq('Should have expected file name', 'test.txt', file.name);
      Assert.eq('Should have expected size', 3, file.size);
      Assert.eq('Should have expected date', 1234, file.lastModified);
      Assert.eq('Should be expected file', 'text/plain', file.type);
    })),

    Logger.t('Create file and read blob data', Step.async((next, die) => {
      const file = createFile('test.txt', 1234, new Blob([ '123' ], { type: 'text/plain' }));

      readBlobAsText(file).get((result) => {
        result.fold(
          failure,
          (text) => {
            try {
              Assert.eq('Should be the expected blob contents', '123', text);
              next();
            } catch (e) {
              die(e);
            }
          }
        );
      });
    }))
  ], () => success(), failure);
});


text:
function BaseMenu() { }

BaseMenu.prototype.keydown = function(code) {
    switch (code) {
    case 'down':
	this.selected++;
	if (this.selected >= this.count)
	    this.selected = 0;
	sfxPlay('menu_click');
	break;

    case 'up':
	this.selected--;
	if (this.selected < 0)
	    this.selected = this.count - 1;
	sfxPlay('menu_click');
	break;

    case 'enter':
	this.do_action();
	sfxPlay('menu_click');
	break;

    case 'esc':
	this.obj.menu_pop();
	break;
    }
}

function Menu(obj, items, x, y, width) {
    this.obj = obj
    this.items = items;
    this.x = x;
    this.y = y;
    this.width = width;
    this.selected = 0;
    this.active = true;
    this.lines = [];
    this.reload();
}

Menu.prototype = new BaseMenu();

Menu.prototype.draw = function(active) {
    drawTextBox(this.x, this.y, this.width,
		this.lines, active ? this.selected : null);
}

Menu.prototype.do_action = function() {
    var idx = this.selected;
    for (var i = 0; i < this.items.length; i++) {
	var item = this.items[i];
	if ('hidden' in item)
	    continue;
	if (!idx--) {
	    item.action.call(this.obj);
	    return;
	}
    }
}

Menu.prototype.reload = function() {
    this.lines = [];
    this.idxs = [];
    for (var i = 0; i < this.items.length; i++) {
	var item = this.items[i];
	if (!('hidden' in item)) {
	    this.lines.push(item.title);
	    this.idxs.push(i);
	}
    }
    if (this.selected >= this.lines.length)
	this.selected = this.lines.length - 1;
    this.count = this.lines.length;
}

Menu.prototype.hide_item = function(idx, flag) {
    if (flag) {
	if ('hidden' in this.items[idx])
	    return;
	this.items[idx].hidden = true;
    } else {
	if (!('hidden' in this.items[idx]))
	    return;
	delete this.items[idx].hidden;
    }
    this.reload();
}

Menu.prototype.set_item_name = function(idx, name) {
    this.items[idx].title = name;
    this.reload();
}

function BSTransitionMenu(target, reverse) {
    this.target = target;
    this.reverse = reverse;
}

BSTransitionMenu.prototype.keydown = function(code) {
    if (code == 'enter')
	main.screen = new Transition(main.screen, this.target, this.reverse);
}

BSTransitionMenu.prototype.draw = function(active) { }


text:
var async = require('async');
var vhost = require('vhost');
var config = require('./../config');
var app_manager = require('../lib/app_manager');
module.exports = function(app){
    app.param('app', function(req, res, next, id){
        req.app = app_manager.get(id);
        return next();
    })
    app.all('/apps', require('./app_list')(app));
    app.all('/apps/:app/deploy', require('./app_deploy')(app));
}


text:
/**
 * @author mrdoob / http://mrdoob.com/
 */

Sidebar.Object = function ( editor ) {

	var signals = editor.signals;

	var container = new UI.Panel();
	container.setBorderTop( '0' );
	container.setPaddingTop( '20px' );
	container.setDisplay( 'none' );

	// Actions

	var objectActions = new UI.Select().setPosition( 'absolute' ).setRight( '8px' ).setFontSize( '11px' );
	objectActions.setOptions( {

		'Actions': 'Actions',
		'Reset Position': 'Reset Position',
		'Reset Rotation': 'Reset Rotation',
		'Reset Scale': 'Reset Scale'

	} );
	objectActions.onClick( function ( event ) {

		event.stopPropagation(); // Avoid panel collapsing

	} );
	objectActions.onChange( function ( event ) {

		var object = editor.selected;

		switch ( this.getValue() ) {

			case 'Reset Position':
				editor.execute( new SetPositionCommand( object, new THREE.Vector3( 0, 0, 0 ) ) );
				break;

			case 'Reset Rotation':
				editor.execute( new SetRotationCommand( object, new THREE.Euler( 0, 0, 0 ) ) );
				break;

			case 'Reset Scale':
				editor.execute( new SetScaleCommand( object, new THREE.Vector3( 1, 1, 1 ) ) );
				break;

		}

		this.setValue( 'Actions' );

	} );
	// container.addStatic( objectActions );

	// type

	var objectTypeRow = new UI.Row();
	var objectType = new UI.Text();

	objectTypeRow.add( new UI.Text( 'Type' ).setWidth( '90px' ) );
	objectTypeRow.add( objectType );

	container.add( objectTypeRow );

	// uuid

	var objectUUIDRow = new UI.Row();
	var objectUUID = new UI.Input().setWidth( '102px' ).setFontSize( '12px' ).setDisabled( true );
	var objectUUIDRenew = new UI.Button( 'New' ).setMarginLeft( '7px' ).onClick( function () {

		objectUUID.setValue( THREE.Math.generateUUID() );

		editor.execute( new SetUuidCommand( editor.selected, objectUUID.getValue() ) );

	} );

	objectUUIDRow.add( new UI.Text( 'UUID' ).setWidth( '90px' ) );
	objectUUIDRow.add( objectUUID );
	objectUUIDRow.add( objectUUIDRenew );

	container.add( objectUUIDRow );

	// name

	var objectNameRow = new UI.Row();
	var objectName = new UI.Input().setWidth( '150px' ).setFontSize( '12px' ).onChange( function () {

		editor.execute( new SetValueCommand( editor.selected, 'name', objectName.getValue() ) );

	} );

	objectNameRow.add( new UI.Text( 'Name' ).setWidth( '90px' ) );
	objectNameRow.add( objectName );

	container.add( objectNameRow );

	// position

	var objectPositionRow = new UI.Row();
	var objectPositionX = new UI.Number().setWidth( '50px' ).onChange( update );
	var objectPositionY = new UI.Number().setWidth( '50px' ).onChange( update );
	var objectPositionZ = new UI.Number().setWidth( '50px' ).onChange( update );

	objectPositionRow.add( new UI.Text( 'Position' ).setWidth( '90px' ) );
	objectPositionRow.add( objectPositionX, objectPositionY, objectPositionZ );

	container.add( objectPositionRow );

	// rotation

	var objectRotationRow = new UI.Row();
	var objectRotationX = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
	var objectRotationY = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );
	var objectRotationZ = new UI.Number().setStep( 10 ).setUnit( '°' ).setWidth( '50px' ).onChange( update );

	objectRotationRow.add( new UI.Text( 'Rotation' ).setWidth( '90px' ) );
	objectRotationRow.add( objectRotationX, objectRotationY, objectRotationZ );

	container.add( objectRotationRow );

	// scale

	var objectScaleRow = new UI.Row();
	var objectScaleLock = new UI.Checkbox( true ).setPosition( 'absolute' ).setLeft( '75px' );
	var objectScaleX = new UI.Number( 1 ).setRange( 0.01, Infinity ).setWidth( '50px' ).onChange( updateScaleX );
	var objectScaleY = new UI.Number( 1 ).setRange( 0.01, Infinity ).setWidth( '50px' ).onChange( updateScaleY );
	var objectScaleZ = new UI.Number( 1 ).setRange( 0.01, Infinity ).setWidth( '50px' ).onChange( updateScaleZ );

	objectScaleRow.add( new UI.Text( 'Scale' ).setWidth( '90px' ) );
	objectScaleRow.add( objectScaleLock );
	objectScaleRow.add( objectScaleX, objectScaleY, objectScaleZ );

	container.add( objectScaleRow );

	// fov

	var objectFovRow = new UI.Row();
	var objectFov = new UI.Number().onChange( update );

	objectFovRow.add( new UI.Text( 'Fov' ).setWidth( '90px' ) );
	objectFovRow.add( objectFov );

	container.add( objectFovRow );

	// near

	var objectNearRow = new UI.Row();
	var objectNear = new UI.Number().onChange( update );

	objectNearRow.add( new UI.Text( 'Near' ).setWidth( '90px' ) );
	objectNearRow.add( objectNear );

	container.add( objectNearRow );

	// far

	var objectFarRow = new UI.Row();
	var objectFar = new UI.Number().onChange( update );

	objectFarRow.add( new UI.Text( 'Far' ).setWidth( '90px' ) );
	objectFarRow.add( objectFar );

	container.add( objectFarRow );

	// intensity

	var objectIntensityRow = new UI.Row();
	var objectIntensity = new UI.Number().setRange( 0, Infinity ).onChange( update );

	objectIntensityRow.add( new UI.Text( 'Intensity' ).setWidth( '90px' ) );
	objectIntensityRow.add( objectIntensity );

	container.add( objectIntensityRow );

	// color

	var objectColorRow = new UI.Row();
	var objectColor = new UI.Color().onChange( update );

	objectColorRow.add( new UI.Text( 'Color' ).setWidth( '90px' ) );
	objectColorRow.add( objectColor );

	container.add( objectColorRow );

	// ground color

	var objectGroundColorRow = new UI.Row();
	var objectGroundColor = new UI.Color().onChange( update );

	objectGroundColorRow.add( new UI.Text( 'Ground color' ).setWidth( '90px' ) );
	objectGroundColorRow.add( objectGroundColor );

	container.add( objectGroundColorRow );

	// distance

	var objectDistanceRow = new UI.Row();
	var objectDistance = new UI.Number().setRange( 0, Infinity ).onChange( update );

	objectDistanceRow.add( new UI.Text( 'Distance' ).setWidth( '90px' ) );
	objectDistanceRow.add( objectDistance );

	container.add( objectDistanceRow );

	// angle

	var objectAngleRow = new UI.Row();
	var objectAngle = new UI.Number().setPrecision( 3 ).setRange( 0, Math.PI / 2 ).onChange( update );

	objectAngleRow.add( new UI.Text( 'Angle' ).setWidth( '90px' ) );
	objectAngleRow.add( objectAngle );

	container.add( objectAngleRow );

	// penumbra

	var objectPenumbraRow = new UI.Row();
	var objectPenumbra = new UI.Number().setRange( 0, 1 ).onChange( update );

	objectPenumbraRow.add( new UI.Text( 'Penumbra' ).setWidth( '90px' ) );
	objectPenumbraRow.add( objectPenumbra );

	container.add( objectPenumbraRow );

	// decay

	var objectDecayRow = new UI.Row();
	var objectDecay = new UI.Number().setRange( 0, Infinity ).onChange( update );

	objectDecayRow.add( new UI.Text( 'Decay' ).setWidth( '90px' ) );
	objectDecayRow.add( objectDecay );

	container.add( objectDecayRow );

	// shadow

	var objectShadowRow = new UI.Row();

	objectShadowRow.add( new UI.Text( 'Shadow' ).setWidth( '90px' ) );

	var objectCastShadow = new UI.THREE.Boolean( false, 'cast' ).onChange( update );
	objectShadowRow.add( objectCastShadow );

	var objectReceiveShadow = new UI.THREE.Boolean( false, 'receive' ).onChange( update );
	objectShadowRow.add( objectReceiveShadow );

	var objectShadowRadius = new UI.Number( 1 ).onChange( update );
	objectShadowRow.add( objectShadowRadius );

	container.add( objectShadowRow );

	// visible

	var objectVisibleRow = new UI.Row();
	var objectVisible = new UI.Checkbox().onChange( update );

	objectVisibleRow.add( new UI.Text( 'Visible' ).setWidth( '90px' ) );
	objectVisibleRow.add( objectVisible );

	container.add( objectVisibleRow );

	// user data

	var timeout;

	var objectUserDataRow = new UI.Row();
	var objectUserData = new UI.TextArea().setWidth( '150px' ).setHeight( '40px' ).setFontSize( '12px' ).onChange( update );
	objectUserData.onKeyUp( function () {

		try {

			JSON.parse( objectUserData.getValue() );

			objectUserData.dom.classList.add( 'success' );
			objectUserData.dom.classList.remove( 'fail' );

		} catch ( error ) {

			objectUserData.dom.classList.remove( 'success' );
			objectUserData.dom.classList.add( 'fail' );

		}

	} );

	objectUserDataRow.add( new UI.Text( 'User data' ).setWidth( '90px' ) );
	objectUserDataRow.add( objectUserData );

	container.add( objectUserDataRow );

	//

	function updateScaleX() {

		var object = editor.selected;

		if ( objectScaleLock.getValue() === true ) {

			var scale = objectScaleX.getValue() / object.scale.x;

			objectScaleY.setValue( objectScaleY.getValue() * scale );
			objectScaleZ.setValue( objectScaleZ.getValue() * scale );

		}

		update();

	}

	function updateScaleY() {

		var object = editor.selected;

		if ( objectScaleLock.getValue() === true ) {

			var scale = objectScaleY.getValue() / object.scale.y;

			objectScaleX.setValue( objectScaleX.getValue() * scale );
			objectScaleZ.setValue( objectScaleZ.getValue() * scale );

		}

		update();

	}

	function updateScaleZ() {

		var object = editor.selected;

		if ( objectScaleLock.getValue() === true ) {

			var scale = objectScaleZ.getValue() / object.scale.z;

			objectScaleX.setValue( objectScaleX.getValue() * scale );
			objectScaleY.setValue( objectScaleY.getValue() * scale );

		}

		update();

	}

	function update() {

		var object = editor.selected;

		if ( object !== null ) {

			var newPosition = new THREE.Vector3( objectPositionX.getValue(), objectPositionY.getValue(), objectPositionZ.getValue() );
			if ( object.position.distanceTo( newPosition ) >= 0.01 ) {

				editor.execute( new SetPositionCommand( object, newPosition ) );

			}

			var newRotation = new THREE.Euler( objectRotationX.getValue() * THREE.Math.DEG2RAD, objectRotationY.getValue() * THREE.Math.DEG2RAD, objectRotationZ.getValue() * THREE.Math.DEG2RAD );
			if ( object.rotation.toVector3().distanceTo( newRotation.toVector3() ) >= 0.01 ) {

				editor.execute( new SetRotationCommand( object, newRotation ) );

			}

			var newScale = new THREE.Vector3( objectScaleX.getValue(), objectScaleY.getValue(), objectScaleZ.getValue() );
			if ( object.scale.distanceTo( newScale ) >= 0.01 ) {

				editor.execute( new SetScaleCommand( object, newScale ) );

			}

			if ( object.fov !== undefined && Math.abs( object.fov - objectFov.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'fov', objectFov.getValue() ) );
				object.updateProjectionMatrix();

			}

			if ( object.near !== undefined && Math.abs( object.near - objectNear.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'near', objectNear.getValue() ) );

			}

			if ( object.far !== undefined && Math.abs( object.far - objectFar.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'far', objectFar.getValue() ) );

			}

			if ( object.intensity !== undefined && Math.abs( object.intensity - objectIntensity.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'intensity', objectIntensity.getValue() ) );

			}

			if ( object.color !== undefined && object.color.getHex() !== objectColor.getHexValue() ) {

				editor.execute( new SetColorCommand( object, 'color', objectColor.getHexValue() ) );

			}

			if ( object.groundColor !== undefined && object.groundColor.getHex() !== objectGroundColor.getHexValue() ) {

				editor.execute( new SetColorCommand( object, 'groundColor', objectGroundColor.getHexValue() ) );

			}

			if ( object.distance !== undefined && Math.abs( object.distance - objectDistance.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'distance', objectDistance.getValue() ) );

			}

			if ( object.angle !== undefined && Math.abs( object.angle - objectAngle.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'angle', objectAngle.getValue() ) );

			}

			if ( object.penumbra !== undefined && Math.abs( object.penumbra - objectPenumbra.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'penumbra', objectPenumbra.getValue() ) );

			}

			if ( object.decay !== undefined && Math.abs( object.decay - objectDecay.getValue() ) >= 0.01 ) {

				editor.execute( new SetValueCommand( object, 'decay', objectDecay.getValue() ) );

			}

			if ( object.visible !== objectVisible.getValue() ) {

				editor.execute( new SetValueCommand( object, 'visible', objectVisible.getValue() ) );

			}

			if ( object.castShadow !== undefined && object.castShadow !== objectCastShadow.getValue() ) {

				editor.execute( new SetValueCommand( object, 'castShadow', objectCastShadow.getValue() ) );

			}

			if ( object.receiveShadow !== undefined && object.receiveShadow !== objectReceiveShadow.getValue() ) {

				editor.execute( new SetValueCommand( object, 'receiveShadow', objectReceiveShadow.getValue() ) );
				object.material.needsUpdate = true;

			}

			if ( object.shadow !== undefined ) {

				if ( object.shadow.radius !== objectShadowRadius.getValue() ) {

					editor.execute( new SetValueCommand( object.shadow, 'radius', objectShadowRadius.getValue() ) );

				}

			}

			try {

				var userData = JSON.parse( objectUserData.getValue() );
				if ( JSON.stringify( object.userData ) != JSON.stringify( userData ) ) {

					editor.execute( new SetValueCommand( object, 'userData', userData ) );

				}

			} catch ( exception ) {

				console.warn( exception );

			}

		}

	}

	function updateRows( object ) {

		var properties = {
			'fov': objectFovRow,
			'near': objectNearRow,
			'far': objectFarRow,
			'intensity': objectIntensityRow,
			'color': objectColorRow,
			'groundColor': objectGroundColorRow,
			'distance' : objectDistanceRow,
			'angle' : objectAngleRow,
			'penumbra' : objectPenumbraRow,
			'decay' : objectDecayRow,
			'castShadow' : objectShadowRow,
			'receiveShadow' : objectReceiveShadow,
			'shadow': objectShadowRadius
		};

		for ( var property in properties ) {

			properties[ property ].setDisplay( object[ property ] !== undefined ? '' : 'none' );

		}

	}

	function updateTransformRows( object ) {

		if ( object instanceof THREE.Light ||
		   ( object instanceof THREE.Object3D && object.userData.targetInverse ) ) {

			objectRotationRow.setDisplay( 'none' );
			objectScaleRow.setDisplay( 'none' );

		} else {

			objectRotationRow.setDisplay( '' );
			objectScaleRow.setDisplay( '' );

		}

	}

	// events

	signals.objectSelected.add( function ( object ) {

		if ( object !== null ) {

			container.setDisplay( 'block' );

			updateRows( object );
			updateUI( object );

		} else {

			container.setDisplay( 'none' );

		}

	} );

	signals.objectChanged.add( function ( object ) {

		if ( object !== editor.selected ) return;

		updateUI( object );

	} );

	signals.refreshSidebarObject3D.add( function ( object ) {

		if ( object !== editor.selected ) return;

		updateUI( object );

	} );

	function updateUI( object ) {

		objectType.setValue( object.type );

		objectUUID.setValue( object.uuid );
		objectName.setValue( object.name );

		objectPositionX.setValue( object.position.x );
		objectPositionY.setValue( object.position.y );
		objectPositionZ.setValue( object.position.z );

		objectRotationX.setValue( object.rotation.x * THREE.Math.RAD2DEG );
		objectRotationY.setValue( object.rotation.y * THREE.Math.RAD2DEG );
		objectRotationZ.setValue( object.rotation.z * THREE.Math.RAD2DEG );

		objectScaleX.setValue( object.scale.x );
		objectScaleY.setValue( object.scale.y );
		objectScaleZ.setValue( object.scale.z );

		if ( object.fov !== undefined ) {

			objectFov.setValue( object.fov );

		}

		if ( object.near !== undefined ) {

			objectNear.setValue( object.near );

		}

		if ( object.far !== undefined ) {

			objectFar.setValue( object.far );

		}

		if ( object.intensity !== undefined ) {

			objectIntensity.setValue( object.intensity );

		}

		if ( object.color !== undefined ) {

			objectColor.setHexValue( object.color.getHexString() );

		}

		if ( object.groundColor !== undefined ) {

			objectGroundColor.setHexValue( object.groundColor.getHexString() );

		}

		if ( object.distance !== undefined ) {

			objectDistance.setValue( object.distance );

		}

		if ( object.angle !== undefined ) {

			objectAngle.setValue( object.angle );

		}

		if ( object.penumbra !== undefined ) {

			objectPenumbra.setValue( object.penumbra );

		}

		if ( object.decay !== undefined ) {

			objectDecay.setValue( object.decay );

		}

		if ( object.castShadow !== undefined ) {

			objectCastShadow.setValue( object.castShadow );

		}

		if ( object.receiveShadow !== undefined ) {

			objectReceiveShadow.setValue( object.receiveShadow );

		}

		if ( object.shadow !== undefined ) {

			objectShadowRadius.setValue( object.shadow.radius );

		}

		objectVisible.setValue( object.visible );

		try {

			objectUserData.setValue( JSON.stringify( object.userData, null, '  ' ) );

		} catch ( error ) {

			console.log( error );

		}

		objectUserData.setBorderColor( 'transparent' );
		objectUserData.setBackgroundColor( '' );

		updateTransformRows( object );

	}

	return container;

};


text:
package upload

import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"

import bytes "bytes"

import strings "strings"
import reflect "reflect"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

import io "io"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package

// BytesMessage contains a chunk of byte data
type BytesMessage struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

func (m *BytesMessage) Reset()      { *m = BytesMessage{} }
func (*BytesMessage) ProtoMessage() {}
func (*BytesMessage) Descriptor() ([]byte, []int) {
	return fileDescriptor_upload_0898dc79ebc86e9c, []int{0}
}
func (m *BytesMessage) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *BytesMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_BytesMessage.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalTo(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (dst *BytesMessage) XXX_Merge(src proto.Message) {
	xxx_messageInfo_BytesMessage.Merge(dst, src)
}
func (m *BytesMessage) XXX_Size() int {
	return m.Size()
}
func (m *BytesMessage) XXX_DiscardUnknown() {
	xxx_messageInfo_BytesMessage.DiscardUnknown(m)
}

var xxx_messageInfo_BytesMessage proto.InternalMessageInfo

func (m *BytesMessage) GetData() []byte {
	if m != nil {
		return m.Data
	}
	return nil
}

func init() {
	proto.RegisterType((*BytesMessage)(nil), "moby.upload.v1.BytesMessage")
}
func (this *BytesMessage) Equal(that interface{}) bool {
	if that == nil {
		return this == nil
	}

	that1, ok := that.(*BytesMessage)
	if !ok {
		that2, ok := that.(BytesMessage)
		if ok {
			that1 = &that2
		} else {
			return false
		}
	}
	if that1 == nil {
		return this == nil
	} else if this == nil {
		return false
	}
	if !bytes.Equal(this.Data, that1.Data) {
		return false
	}
	return true
}
func (this *BytesMessage) GoString() string {
	if this == nil {
		return "nil"
	}
	s := make([]string, 0, 5)
	s = append(s, "&upload.BytesMessage{")
	s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n")
	s = append(s, "}")
	return strings.Join(s, "")
}
func valueToGoStringUpload(v interface{}, typ string) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// UploadClient is the client API for Upload service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type UploadClient interface {
	Pull(ctx context.Context, opts ...grpc.CallOption) (Upload_PullClient, error)
}

type uploadClient struct {
	cc *grpc.ClientConn
}

func NewUploadClient(cc *grpc.ClientConn) UploadClient {
	return &uploadClient{cc}
}

func (c *uploadClient) Pull(ctx context.Context, opts ...grpc.CallOption) (Upload_PullClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Upload_serviceDesc.Streams[0], "/moby.upload.v1.Upload/Pull", opts...)
	if err != nil {
		return nil, err
	}
	x := &uploadPullClient{stream}
	return x, nil
}

type Upload_PullClient interface {
	Send(*BytesMessage) error
	Recv() (*BytesMessage, error)
	grpc.ClientStream
}

type uploadPullClient struct {
	grpc.ClientStream
}

func (x *uploadPullClient) Send(m *BytesMessage) error {
	return x.ClientStream.SendMsg(m)
}

func (x *uploadPullClient) Recv() (*BytesMessage, error) {
	m := new(BytesMessage)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// UploadServer is the server API for Upload service.
type UploadServer interface {
	Pull(Upload_PullServer) error
}

func RegisterUploadServer(s *grpc.Server, srv UploadServer) {
	s.RegisterService(&_Upload_serviceDesc, srv)
}

func _Upload_Pull_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(UploadServer).Pull(&uploadPullServer{stream})
}

type Upload_PullServer interface {
	Send(*BytesMessage) error
	Recv() (*BytesMessage, error)
	grpc.ServerStream
}

type uploadPullServer struct {
	grpc.ServerStream
}

func (x *uploadPullServer) Send(m *BytesMessage) error {
	return x.ServerStream.SendMsg(m)
}

func (x *uploadPullServer) Recv() (*BytesMessage, error) {
	m := new(BytesMessage)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var _Upload_serviceDesc = grpc.ServiceDesc{
	ServiceName: "moby.upload.v1.Upload",
	HandlerType: (*UploadServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Pull",
			Handler:       _Upload_Pull_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "upload.proto",
}

func (m *BytesMessage) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalTo(dAtA)
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *BytesMessage) MarshalTo(dAtA []byte) (int, error) {
	var i int
	_ = i
	var l int
	_ = l
	if len(m.Data) > 0 {
		dAtA[i] = 0xa
		i++
		i = encodeVarintUpload(dAtA, i, uint64(len(m.Data)))
		i += copy(dAtA[i:], m.Data)
	}
	return i, nil
}

func encodeVarintUpload(dAtA []byte, offset int, v uint64) int {
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return offset + 1
}
func (m *BytesMessage) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Data)
	if l > 0 {
		n += 1 + l + sovUpload(uint64(l))
	}
	return n
}

func sovUpload(x uint64) (n int) {
	for {
		n++
		x >>= 7
		if x == 0 {
			break
		}
	}
	return n
}
func sozUpload(x uint64) (n int) {
	return sovUpload(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *BytesMessage) String() string {
	if this == nil {
		return "nil"
	}
	s := strings.Join([]string{`&BytesMessage{`,
		`Data:` + fmt.Sprintf("%v", this.Data) + `,`,
		`}`,
	}, "")
	return s
}
func valueToStringUpload(v interface{}) string {
	rv := reflect.ValueOf(v)
	if rv.IsNil() {
		return "nil"
	}
	pv := reflect.Indirect(rv).Interface()
	return fmt.Sprintf("*%v", pv)
}
func (m *BytesMessage) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowUpload
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: BytesMessage: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: BytesMessage: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowUpload
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return ErrInvalidLengthUpload
			}
			postIndex := iNdEx + byteLen
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
			if m.Data == nil {
				m.Data = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipUpload(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if skippy < 0 {
				return ErrInvalidLengthUpload
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipUpload(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowUpload
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowUpload
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
			return iNdEx, nil
		case 1:
			iNdEx += 8
			return iNdEx, nil
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowUpload
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			iNdEx += length
			if length < 0 {
				return 0, ErrInvalidLengthUpload
			}
			return iNdEx, nil
		case 3:
			for {
				var innerWire uint64
				var start int = iNdEx
				for shift := uint(0); ; shift += 7 {
					if shift >= 64 {
						return 0, ErrIntOverflowUpload
					}
					if iNdEx >= l {
						return 0, io.ErrUnexpectedEOF
					}
					b := dAtA[iNdEx]
					iNdEx++
					innerWire |= (uint64(b) & 0x7F) << shift
					if b < 0x80 {
						break
					}
				}
				innerWireType := int(innerWire & 0x7)
				if innerWireType == 4 {
					break
				}
				next, err := skipUpload(dAtA[start:])
				if err != nil {
					return 0, err
				}
				iNdEx = start + next
			}
			return iNdEx, nil
		case 4:
			return iNdEx, nil
		case 5:
			iNdEx += 4
			return iNdEx, nil
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
	}
	panic("unreachable")
}

var (
	ErrInvalidLengthUpload = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowUpload   = fmt.Errorf("proto: integer overflow")
)

func init() { proto.RegisterFile("upload.proto", fileDescriptor_upload_0898dc79ebc86e9c) }

var fileDescriptor_upload_0898dc79ebc86e9c = []byte{
	// 179 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x2d, 0xc8, 0xc9,
	0x4f, 0x4c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcb, 0xcd, 0x4f, 0xaa, 0xd4, 0x83,
	0x0a, 0x95, 0x19, 0x2a, 0x29, 0x71, 0xf1, 0x38, 0x55, 0x96, 0xa4, 0x16, 0xfb, 0xa6, 0x16, 0x17,
	0x27, 0xa6, 0xa7, 0x0a, 0x09, 0x71, 0xb1, 0xa4, 0x24, 0x96, 0x24, 0x4a, 0x30, 0x2a, 0x30, 0x6a,
	0xf0, 0x04, 0x81, 0xd9, 0x46, 0x01, 0x5c, 0x6c, 0xa1, 0x60, 0x0d, 0x42, 0x6e, 0x5c, 0x2c, 0x01,
	0xa5, 0x39, 0x39, 0x42, 0x32, 0x7a, 0xa8, 0xc6, 0xe8, 0x21, 0x9b, 0x21, 0x85, 0x57, 0x56, 0x83,
	0xd1, 0x80, 0xd1, 0xc9, 0xe6, 0xc2, 0x43, 0x39, 0x86, 0x1b, 0x0f, 0xe5, 0x18, 0x3e, 0x3c, 0x94,
	0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e,
	0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2, 0x91, 0x1c, 0xc3, 0x87, 0x47, 0x72, 0x8c, 0x13,
	0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x14, 0x1b, 0xc4, 0xc4,
	0x24, 0x36, 0xb0, 0x57, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x12, 0xf2, 0xfc, 0xb4, 0xda,
	0x00, 0x00, 0x00,
}


text:
NOTE: This is a guide for GitLab developers.

# **7 workdays before release - Code Freeze & Release Manager**

### **1. Stop merging in code, except for important bug fixes**

### **2. Release Manager**

A release manager is selected that coordinates the entire release of this version. The release manager has to make sure all the steps below are done and delegated where necessary. This person should also make sure this document is kept up to date and issues are created and updated.

### **3. Create an overall issue**

Create issue for GitLab CE project(internal). Name it "Release x.x.x" for easier searching.
Replace the dates with actual dates based on the number of workdays before the release.

```
Xth:

* Update the changelog (#LINK)
* Triage the omnibus-gitlab milestone

Xth:

* Merge CE in to EE (#LINK)
* Close the omnibus-gitlab milestone

Xth:

* Create x.x.0.rc1 (#LINK)
* Build package for GitLab.com (https://dev.gitlab.org/cookbooks/chef-repo/blob/master/doc/administration.md#build-a-package)

Xth:

* Update GitLab.com with rc1 (#LINK) (https://dev.gitlab.org/cookbooks/chef-repo/blob/master/doc/administration.md#deploy-the-package)
* Regression issue and tweet about rc1 (#LINK)
* Start blog post (#LINK)

Xth:

* Do QA and fix anything coming out of it (#LINK)

22nd:

* Release CE and EE (#LINK)

Xth:

* * Deploy to GitLab.com (#LINK)

```

### **4. Update changelog**

Any changes not yet added to the changelog are added by lead developer and in that merge request the complete team is asked if there is anything missing.

### **5. Take weekend and vacations into account**

Ensure that there is enough time to incorporate the findings of the release candidate, etc.

# **6 workdays before release- Merge the CE into EE**

Do this via a merge request.

# **5 workdays before release - Create RC1**

The RC1 release comes with the task to update the installation and upgrade docs. Be mindful that there might already be merge requests for this on GitLab or GitHub.

### **1. Update the installation guide**

1. Check if it references the correct branch `x-x-stable` (doesn't exist yet, but that is okay)
1. Check the [GitLab Shell version](/lib/tasks/gitlab/check.rake#L782)
1. Check the [Git version](/lib/tasks/gitlab/check.rake#L794)
1. There might be other changes. Ask around.

### **2. Create update guides**

1. Create: CE update guide from previous version. Like `7.3-to-7.4.md`
1. Create: CE to EE update guide in EE repository for latest version.
1. Update: `6.x-or-7.x-to-7.x.md` to latest version.

It's best to copy paste the previous guide and make changes where necessary.
The typical steps are listed below with any points you should specifically look at.

#### 0. Any major changes?

List any major changes here, so the user is aware of them before starting to upgrade. For instance:

- Database updates
- Web server changes
- File structure changes

#### 1. Make backup

#### 2. Stop server

#### 3. Do users need to update dependencies like `git`?

- Check if the [GitLab Shell version](/lib/tasks/gitlab/check.rake#L782) changed since the last release.

- Check if the [Git version](/lib/tasks/gitlab/check.rake#L794) changed since the last release.

#### 4. Get latest code

#### 5. Does GitLab shell need to be updated?

#### 6. Install libs, migrations, etc.

#### 7. Any config files updated since last release?

Check if any of these changed since last release:

- [lib/support/nginx/gitlab](/lib/support/nginx/gitlab)
- [lib/support/nginx/gitlab-ssl](/lib/support/nginx/gitlab-ssl)
- <https://gitlab.com/gitlab-org/gitlab-shell/commits/master/config.yml.example>
- [config/gitlab.yml.example](/config/gitlab.yml.example)
- [config/unicorn.rb.example](/config/unicorn.rb.example)
- [config/database.yml.mysql](/config/database.yml.mysql)
- [config/database.yml.postgresql](/config/database.yml.postgresql)
- [config/initializers/rack_attack.rb.example](/config/initializers/rack_attack.rb.example)
- [config/resque.yml.example](/config/resque.yml.example)

#### 8. Need to update init script?

Check if the `init.d/gitlab` script changed since last release: [lib/support/init.d/gitlab](/lib/support/init.d/gitlab)

#### 9. Start application

#### 10. Check application status

### **3. Code quality indicators**

Make sure the code quality indicators are green / good.

- [![Build status](http://ci.gitlab.org/projects/1/status.png?ref=master)](http://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)

- [![Build Status](https://semaphoreapp.com/api/v1/projects/2f1a5809-418b-4cc2-a1f4-819607579fe7/243338/badge.png)](https://semaphoreapp.com/gitlabhq/gitlabhq) (master branch)

- [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq)

- [![Dependency Status](https://gemnasium.com/gitlabhq/gitlabhq.png)](https://gemnasium.com/gitlabhq/gitlabhq) this button can be yellow (small updates are available) but must not be red (a security fix or an important update is available)

- [![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.png?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq)

### **4. Run release tool**

**Make sure EE `master` has latest changes from CE `master`**

Get release tools

```
git clone git@dev.gitlab.org:gitlab/release-tools.git
cd release-tools
```

Release candidate creates stable branch from master.
So we need to sync master branch between all CE remotes. Also do same for EE.

```
bundle exec rake sync
```

Create release candidate and stable branch:

```
bundle exec rake release["x.x.0.rc1"]
```

Now developers can use master for merging new features.
So you should use stable branch for future code chages related to release.

# **4 workdays before release - Release RC1**

### **1. Determine QA person

Notify person of QA day.

### **2. Update GitLab.com**

Merge the RC1 EE code into GitLab.com.
Once the build is green, create a package.
If there are big database migrations consider testing them with the production db on a VM.
Try to deploy in the morning.
It is important to do this as soon as possible, so we can catch any errors before we release the full version.

### **3. Prepare the blog post**

- Start with a complete copy of the [release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/release_blog_template.md) and fill it out.
- Check the changelog of CE and EE for important changes.
- Create a WIP MR for the blog post
- Ask Dmitriy to add screenshots to the WIP MR.
- Decide with team who will be the MVP user.
- Create WIP MR for adding MVP to MVP page on website
- Add a note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible.
- Create a merge request on [GitLab.com](https://gitlab.com/gitlab-com/www-gitlab-com/tree/master)
- Assign to one reviewer who will fix spelling issues by editing the branch (can use the online editor)
- After the reviewer is finished the whole team will be mentioned to give their suggestions via line comments

### **4. Create a regressions issue**

On [the GitLab CE issue tracker on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues/) create an issue titled "GitLab X.X regressions" add the following text:

This is a meta issue to discuss possible regressions in this monthly release and any patch versions.
Please do not raise issues directly in this issue but link to issues that might warrant a patch release.
The decision to create a patch release or not is with the release manager who is assigned to this issue.
The release manager will comment here about the plans for patch releases.

Assign the issue to the release manager and /cc all the core-team members active on the issue tracker. If there are any known bugs in the release add them immediately.

### **4. Tweet**

Tweet about the RC release:

> GitLab x.x.0.rc1 is out. This release candidate is only suitable for testing. Please link regressions issues from LINK_TO_REGRESSION_ISSUE

# **1 workdays before release - Preparation**

### **1. Pre QA merge**

Merge CE into EE before doing the QA.

### **2. QA**

Create issue on dev.gitlab.org `gitlab` repository, named "GitLab X.X QA" in order to keep track of the progress.

Use the omnibus packages of Enterprise Edition using [this guide](https://dev.gitlab.org/gitlab/gitlab-ee/blob/master/doc/release/manual_testing.md).

**NOTE** Upgrader can only be tested when tags are pushed to all repositories. Do not forget to confirm it is working before releasing. Note that in the issue.

### **3. Fix anything coming out of the QA**

Create an issue with description of a problem, if it is quick fix fix it yourself otherwise contact the team for advice.

**NOTE** If there is a problem that cannot be fixed in a timely manner, reverting the feature is an option! If the feature is reverted,
create an issue about it in order to discuss the next steps after the release.

# **22nd - Release CE and EE**

**Make sure EE `x-x-stable-ee` has latest changes from CE `x-x-stable`**

### **1. Release code**

Get release tools

```
git clone git@dev.gitlab.org:gitlab/release-tools.git
cd release-tools
```

Bump version, create release tag and push to remotes:

```
bundle exec rake release["x.x.0"]
```

### **2. Update installation.md**

Update [installation.md](/doc/install/installation.md) to the newest version in master.

### **3. Build the Omnibus packages**

Follow the [release doc in the Omnibus repository](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md).
This can happen before tagging because Omnibus uses tags in its own repo and SHA1's to refer to the GitLab codebase.

### **4. Publish packages for new release**

Update `downloads/index.html` and `downloads/archive/index.html` in `www-gitlab-com` repository.

### **5. Publish blog for new release**

Merge the [blog merge request](#1-prepare-the-blog-post) in `www-gitlab-com` repository.

### **6. Tweet to blog**

Send out a tweet to share the good news with the world.
List the most important features and link to the blog post.

Proposed tweet for CE "GitLab X.X is released! It brings *** <link-to-blogpost>"

# **1 workday after release - Update GitLab.com**

- Build a package for gitlab.com based on the official release instead of RC1
- Deploy the package

# **25th - Release GitLab CI**

- Create the update guid `doc/x.x-to-x.x.md`.
- Update CHANGELOG
- Bump version
- Create annotated tags `git tag -a vx.x.0 -m 'Version x.x.0' xxxxx`
- Create stable branch `x-x-stable`
- Create GitHub release post
- Post to blog about release
- Post to twitter


text:
Purpose: calculating the weight for each crystal/interface sites

version3
Merge the gaussian distribution fitting and the weight calculation together.
The algorithm always got wrong weight. ( >1 or  <0)

version 33
Normalize the sample first.
Fitting both A and w with constraint. A ~ (0,1]; w ~ (0,1.5)

version4
Using total atom number to determine the A. Then fit the weight.


text:
package com.codingpan.leetcode.todo;

import com.codingpan.leetcode.util.TreeNode;

import java.util.LinkedList;
import java.util.List;

public class LC257BinaryTreePaths {
    public static List<String> binaryTreePaths(TreeNode root) {
        LinkedList<LinkedList<String>> res = new LinkedList<LinkedList<String>>();
        LinkedList<String> ans = new LinkedList<String>();

        if (root == null) {
            return convertRes(res);
        }

        ans.add(String.valueOf(root.val));
        helper(root, ans, res);
        //        Stack<TreeNode> stk = new Stack<TreeNode>();
        //        stk.push(root);
        //
        //        while (!stk.isEmpty()) {
        //            TreeNode nd = stk.peek();
        //            if (nd.left == null && nd.right == null) {
        //                sb.append(nd.val);
        //            	stk.pop();
        //                res.add(sb.toString());
        //            	sb.deleteCharAt(sb.length()-1);
        //            } else {
        //                if (nd.left != null) {
        //                    stk.push(nd.left);
        //                    sb.append(nd.val);
        //                    nd.left = null;
        //                } else {
        //                    if (nd.right != null) {
        //                        stk.push(nd.right);
        //                        sb.append(nd.val);
        //                        nd.right = null;
        //                    }
        //                }
        //            }
        //        }

        return convertRes(res);
    }

    private static List<String> convertRes(List<LinkedList<String>> res) {
        List<String> result = new LinkedList<String>();

        for (LinkedList<String> ans : res) {
            StringBuilder sb = new StringBuilder();
            for (String s : ans) {
                sb.append(s);
                sb.append("->");
            }
            sb.deleteCharAt(sb.length() - 1);
            sb.deleteCharAt(sb.length() - 1);
            result.add(sb.toString());
        }

        return result;
    }

    private static void helper(
            TreeNode root, LinkedList<String> ans, LinkedList<LinkedList<String>> res) {
        if (root.left == null && root.right == null) {
            res.add(new LinkedList<String>(ans));
        } else {
            if (root.left != null) {
                ans.add(String.valueOf(root.left.val));
                helper(root.left, ans, res);
                ans.remove(ans.size() - 1);
            }

            if (root.right != null) {
                ans.add(String.valueOf(root.right.val));
                helper(root.right, ans, res);
                ans.remove(ans.size() - 1);
            }
        }
    }

    public static void main(String[] args) {
        TreeNode root = new TreeNode(1);
        root.left = new TreeNode(27);
        root.right = new TreeNode(43);
        root.left.right = new TreeNode(65);

        System.out.println(binaryTreePaths(root));
    }
}


text:
package com.exxeta.iss.sonar.esql.check;

import java.io.File;

import org.junit.jupiter.api.Test;

import com.exxeta.iss.sonar.esql.api.EsqlCheck;
import com.exxeta.iss.sonar.esql.checks.verifier.EsqlCheckVerifier;

/**
 * This Test class is created to check the cyclomatic complexity of the code.
 *
 * @author sapna singh
 */
class CyclomaticComplexityCheckTest {

    @Test
    void test() {
        EsqlCheck check = new CyclomaticComplexityCheck();
        EsqlCheckVerifier.issues(check, new File("src/test/resources/CyclomaticComplexity.esql"))
                .next().atLine(2).withMessage("Refactor this function to reduce its Cognitive Complexity from 12 to the 10 allowed.")
                .next().atLine(33).withMessage("Refactor this procedure to reduce its Cognitive Complexity from 33 to the 10 allowed.")
                .noMore();
    }

}


text:
import expect from 'expect.js';
import { handleRequest, makeRequest } from '../src/Request';

describe('Request', () => {
	describe('makeRequest', () => {
		it('should produce a request object', () => {
			const request = makeRequest({
				header: {
					resource: 'get.students.grades',
					parameters: 1,
					queryParameters: 2
				},
				body: 3
			});

			expect(request.resource).to.be('students.grades');
			expect(request.method).to.be('get');
			expect(request.body).to.be(3);
			expect(request.parameters).to.be(1);
			expect(request.query).to.be(2);
    });

		it('should calculate resource and method', () => {
			const requestPut = makeRequest({
				header: {
					resource: 'put.students.grades'
				}
			});
			expect(requestPut.resource).to.be('students.grades');
			expect(requestPut.method).to.be('put');

			const requestDelete = makeRequest({
				header: {
					resource: 'delete.students.grades'
				}
			});
			expect(requestDelete.resource).to.be('students.grades');
			expect(requestDelete.method).to.be('delete');

			const requestLong = makeRequest({
				header: {
					resource: 'post.students.grades.other.stuff'
				}
			});
			expect(requestLong.resource).to.be('students.grades.other.stuff');
			expect(requestLong.method).to.be('post');
		});
  });
});


text:
using Agent.Sdk;
using Agent.Sdk.Knob;
using Microsoft.TeamFoundation.DistributedTask.WebApi;
using Microsoft.VisualStudio.Services.Agent.Util;
using System;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Services.WebApi;

namespace Microsoft.VisualStudio.Services.Agent.Listener
{
    [ServiceLocator(Default = typeof(SelfUpdater))]
    public interface ISelfUpdater : IAgentService
    {
        Task<bool> SelfUpdate(AgentRefreshMessage updateMessage, IJobDispatcher jobDispatcher, bool restartInteractiveAgent, CancellationToken token);
    }

    public class SelfUpdater : AgentService, ISelfUpdater
    {
        private static string _packageType = BuildConstants.AgentPackage.PackageType;
        private static string _platform = BuildConstants.AgentPackage.PackageName;
        private static UpdaterKnobValueContext _knobContext = new UpdaterKnobValueContext();

        private PackageMetadata _targetPackage;
        private ITerminal _terminal;
        private IAgentServer _agentServer;
        private int _poolId;
        private int _agentId;

        public override void Initialize(IHostContext hostContext)
        {
            ArgUtil.NotNull(hostContext, nameof(hostContext));
            base.Initialize(hostContext);

            _terminal = hostContext.GetService<ITerminal>();
            _agentServer = HostContext.GetService<IAgentServer>();
            var configStore = HostContext.GetService<IConfigurationStore>();
            var settings = configStore.GetSettings();
            _poolId = settings.PoolId;
            _agentId = settings.AgentId;
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA2000:Dispose objects before losing scope", MessageId = "invokeScript")]
        public async Task<bool> SelfUpdate(AgentRefreshMessage updateMessage, IJobDispatcher jobDispatcher, bool restartInteractiveAgent, CancellationToken token)
        {
            ArgUtil.NotNull(updateMessage, nameof(updateMessage));
            ArgUtil.NotNull(jobDispatcher, nameof(jobDispatcher));
            if (!await UpdateNeeded(updateMessage.TargetVersion, token))
            {
                Trace.Info($"Can't find available update package.");
                return false;
            }

            Trace.Info($"An update is available.");

            // Print console line that warn user not shutdown agent.
            await UpdateAgentUpdateStateAsync(StringUtil.Loc("UpdateInProgress"));
            await UpdateAgentUpdateStateAsync(StringUtil.Loc("DownloadAgent", _targetPackage.Version));

            await DownloadLatestAgent(token);
            Trace.Info($"Download latest agent and unzip into agent root.");

            // wait till all running job finish
            await UpdateAgentUpdateStateAsync(StringUtil.Loc("EnsureJobFinished"));

            await jobDispatcher.WaitAsync(token);
            Trace.Info($"All running jobs have exited.");

            // delete agent backup
            DeletePreviousVersionAgentBackup(token);
            Trace.Info($"Delete old version agent backup.");

            // generate update script from template
            await UpdateAgentUpdateStateAsync(StringUtil.Loc("GenerateAndRunUpdateScript"));

            string updateScript = GenerateUpdateScript(restartInteractiveAgent);
            Trace.Info($"Generate update script into: {updateScript}");

            // kick off update script
            Process invokeScript = new Process();
            if (PlatformUtil.RunningOnWindows)
            {
                invokeScript.StartInfo.FileName = WhichUtil.Which("cmd.exe", trace: Trace);
                invokeScript.StartInfo.Arguments = $"/c \"{updateScript}\"";
            }
            else
            {
                invokeScript.StartInfo.FileName = WhichUtil.Which("bash", trace: Trace);
                invokeScript.StartInfo.Arguments = $"\"{updateScript}\"";
            }
            invokeScript.Start();
            Trace.Info($"Update script start running");

            await UpdateAgentUpdateStateAsync(StringUtil.Loc("AgentExit"));

            return true;
        }

        private async Task<bool> UpdateNeeded(string targetVersion, CancellationToken token)
        {
            // when talk to old version tfs server, always prefer latest package.
            // old server won't send target version as part of update message.
            if (string.IsNullOrEmpty(targetVersion))
            {
                var packages = await _agentServer.GetPackagesAsync(_packageType, _platform, 1, token);
                if (packages == null || packages.Count == 0)
                {
                    Trace.Info($"There is no package for {_packageType} and {_platform}.");
                    return false;
                }

                _targetPackage = packages.FirstOrDefault();
            }
            else
            {
                _targetPackage = await _agentServer.GetPackageAsync(_packageType, _platform, targetVersion, token);
                if (_targetPackage == null)
                {
                    Trace.Info($"There is no package for {_packageType} and {_platform} with version {targetVersion}.");
                    return false;
                }
            }

            Trace.Info($"Version '{_targetPackage.Version}' of '{_targetPackage.Type}' package available in server.");
            PackageVersion serverVersion = new PackageVersion(_targetPackage.Version);
            Trace.Info($"Current running agent version is {BuildConstants.AgentPackage.Version}");
            PackageVersion agentVersion = new PackageVersion(BuildConstants.AgentPackage.Version);

            if (serverVersion.CompareTo(agentVersion) > 0)
            {
                return true;
            }

            if (AgentKnobs.DisableAgentDowngrade.GetValue(_knobContext).AsBoolean())
            {
                Trace.Info("Agent downgrade disabled, skipping update");
                return false;
            }

            // Always return true for newer agent versions unless they're exactly equal to enable auto rollback (this feature was introduced after 2.165.0)
            if (serverVersion.CompareTo(agentVersion) != 0)
            {
                _terminal.WriteLine(StringUtil.Loc("AgentDowngrade"));
                return true;
            }

            return false;
        }

        /// <summary>
        /// _work
        ///     \_update
        ///            \bin
        ///            \externals
        ///            \run.sh
        ///            \run.cmd
        ///            \package.zip //temp download .zip/.tar.gz
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        private async Task DownloadLatestAgent(CancellationToken token)
        {
            string latestAgentDirectory = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Work), Constants.Path.UpdateDirectory);
            IOUtil.DeleteDirectory(latestAgentDirectory, token);
            Directory.CreateDirectory(latestAgentDirectory);

            int agentSuffix = 1;
            string archiveFile = null;
            bool downloadSucceeded = false;

            try
            {
                // Download the agent, using multiple attempts in order to be resilient against any networking/CDN issues
                for (int attempt = 1; attempt <= Constants.AgentDownloadRetryMaxAttempts; attempt++)
                {
                    // Generate an available package name, and do our best effort to clean up stale local zip files
                    while (true)
                    {
                        if (_targetPackage.Platform.StartsWith("win"))
                        {
                            archiveFile = Path.Combine(latestAgentDirectory, $"agent{agentSuffix}.zip");
                        }
                        else
                        {
                            archiveFile = Path.Combine(latestAgentDirectory, $"agent{agentSuffix}.tar.gz");
                        }

                        try
                        {
                            // delete .zip file
                            if (!string.IsNullOrEmpty(archiveFile) && File.Exists(archiveFile))
                            {
                                Trace.Verbose("Deleting latest agent package zip '{0}'", archiveFile);
                                IOUtil.DeleteFile(archiveFile);
                            }

                            break;
                        }
                        catch (Exception ex)
                        {
                            // couldn't delete the file for whatever reason, so generate another name
                            Trace.Warning("Failed to delete agent package zip '{0}'. Exception: {1}", archiveFile, ex);
                            agentSuffix++;
                        }
                    }

                    // Allow a 15-minute package download timeout, which is good enough to update the agent from a 1 Mbit/s ADSL connection.
                    var timeoutSeconds = AgentKnobs.AgentDownloadTimeout.GetValue(_knobContext).AsInt();

                    Trace.Info($"Attempt {attempt}: save latest agent into {archiveFile}.");

                    using (var downloadTimeout = new CancellationTokenSource(TimeSpan.FromSeconds(timeoutSeconds)))
                    using (var downloadCts = CancellationTokenSource.CreateLinkedTokenSource(downloadTimeout.Token, token))
                    {
                        try
                        {
                            Trace.Info($"Download agent: begin download");

                            //open zip stream in async mode
                            using (var handler = HostContext.CreateHttpClientHandler())
                            using (var httpClient = new HttpClient(handler))
                            using (var fs = new FileStream(archiveFile, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 4096, useAsync: true))
                            using (var result = await httpClient.GetStreamAsync(_targetPackage.DownloadUrl))
                            {
                                //81920 is the default used by System.IO.Stream.CopyTo and is under the large object heap threshold (85k).
                                await result.CopyToAsync(fs, 81920, downloadCts.Token);
                                await fs.FlushAsync(downloadCts.Token);
                            }

                            Trace.Info($"Download agent: finished download");
                            downloadSucceeded = true;
                            break;
                        }
                        catch (OperationCanceledException) when (token.IsCancellationRequested)
                        {
                            Trace.Info($"Agent download has been canceled.");
                            throw;
                        }
                        catch (Exception ex)
                        {
                            if (downloadCts.Token.IsCancellationRequested)
                            {
                                Trace.Warning($"Agent download has timed out after {timeoutSeconds} seconds");
                            }

                            Trace.Warning($"Failed to get package '{archiveFile}' from '{_targetPackage.DownloadUrl}'. Exception {ex}");
                        }
                    }
                }

                if (!downloadSucceeded)
                {
                    throw new TaskCanceledException($"Agent package '{archiveFile}' failed after {Constants.AgentDownloadRetryMaxAttempts} download attempts");
                }

                // If we got this far, we know that we've successfully downloadeded the agent package
                if (archiveFile.EndsWith(".zip", StringComparison.OrdinalIgnoreCase))
                {
                    ZipFile.ExtractToDirectory(archiveFile, latestAgentDirectory);
                }
                else if (archiveFile.EndsWith(".tar.gz", StringComparison.OrdinalIgnoreCase))
                {
                    string tar = WhichUtil.Which("tar", trace: Trace);

                    if (string.IsNullOrEmpty(tar))
                    {
                        throw new NotSupportedException($"tar -xzf");
                    }

                    // tar -xzf
                    using (var processInvoker = HostContext.CreateService<IProcessInvoker>())
                    {
                        processInvoker.OutputDataReceived += new EventHandler<ProcessDataReceivedEventArgs>((sender, args) =>
                        {
                            if (!string.IsNullOrEmpty(args.Data))
                            {
                                Trace.Info(args.Data);
                            }
                        });

                        processInvoker.ErrorDataReceived += new EventHandler<ProcessDataReceivedEventArgs>((sender, args) =>
                        {
                            if (!string.IsNullOrEmpty(args.Data))
                            {
                                Trace.Error(args.Data);
                            }
                        });

                        int exitCode = await processInvoker.ExecuteAsync(latestAgentDirectory, tar, $"-xzf \"{archiveFile}\"", null, token);
                        if (exitCode != 0)
                        {
                            throw new NotSupportedException($"Can't use 'tar -xzf' extract archive file: {archiveFile}. return code: {exitCode}.");
                        }
                    }
                }
                else
                {
                    throw new NotSupportedException($"{archiveFile}");
                }

                Trace.Info($"Finished getting latest agent package at: {latestAgentDirectory}.");
            }
            finally
            {
                try
                {
                    // delete .zip file
                    if (!string.IsNullOrEmpty(archiveFile) && File.Exists(archiveFile))
                    {
                        Trace.Verbose("Deleting latest agent package zip: {0}", archiveFile);
                        IOUtil.DeleteFile(archiveFile);
                    }
                }
                catch (Exception ex)
                {
                    //it is not critical if we fail to delete the .zip file
                    Trace.Warning("Failed to delete agent package zip '{0}'. Exception: {1}", archiveFile, ex);
                }
            }

            // copy latest agent into agent root folder
            // copy bin from _work/_update -> bin.version under root
            string binVersionDir = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"{Constants.Path.BinDirectory}.{_targetPackage.Version}");
            Directory.CreateDirectory(binVersionDir);
            Trace.Info($"Copy {Path.Combine(latestAgentDirectory, Constants.Path.BinDirectory)} to {binVersionDir}.");
            IOUtil.CopyDirectory(Path.Combine(latestAgentDirectory, Constants.Path.BinDirectory), binVersionDir, token);

            // copy externals from _work/_update -> externals.version under root
            string externalsVersionDir = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"{Constants.Path.ExternalsDirectory}.{_targetPackage.Version}");
            Directory.CreateDirectory(externalsVersionDir);
            Trace.Info($"Copy {Path.Combine(latestAgentDirectory, Constants.Path.ExternalsDirectory)} to {externalsVersionDir}.");
            IOUtil.CopyDirectory(Path.Combine(latestAgentDirectory, Constants.Path.ExternalsDirectory), externalsVersionDir, token);

            // copy and replace all .sh/.cmd files
            Trace.Info($"Copy any remaining .sh/.cmd files into agent root.");
            foreach (FileInfo file in new DirectoryInfo(latestAgentDirectory).GetFiles() ?? new FileInfo[0])
            {
                // Copy and replace the file.
                file.CopyTo(Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), file.Name), true);
            }

            // for windows service back compat with old windows agent, we need make sure the servicehost.exe is still the old name
            // if the current bin folder has VsoAgentService.exe, then the new agent bin folder needs VsoAgentService.exe as well
            if (PlatformUtil.RunningOnWindows)
            {
                if (File.Exists(Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Bin), "VsoAgentService.exe")))
                {
                    Trace.Info($"Make a copy of AgentService.exe, name it VsoAgentService.exe");
                    File.Copy(Path.Combine(binVersionDir, "AgentService.exe"), Path.Combine(binVersionDir, "VsoAgentService.exe"), true);
                    File.Copy(Path.Combine(binVersionDir, "AgentService.exe.config"), Path.Combine(binVersionDir, "VsoAgentService.exe.config"), true);

                    Trace.Info($"Make a copy of Agent.Listener.exe, name it VsoAgent.exe");
                    File.Copy(Path.Combine(binVersionDir, "Agent.Listener.exe"), Path.Combine(binVersionDir, "VsoAgent.exe"), true);
                    File.Copy(Path.Combine(binVersionDir, "Agent.Listener.dll"), Path.Combine(binVersionDir, "VsoAgent.dll"), true);

                    // in case of we remove all pdb file from agent package.
                    if (File.Exists(Path.Combine(binVersionDir, "AgentService.pdb")))
                    {
                        File.Copy(Path.Combine(binVersionDir, "AgentService.pdb"), Path.Combine(binVersionDir, "VsoAgentService.pdb"), true);
                    }

                    if (File.Exists(Path.Combine(binVersionDir, "Agent.Listener.pdb")))
                    {
                        File.Copy(Path.Combine(binVersionDir, "Agent.Listener.pdb"), Path.Combine(binVersionDir, "VsoAgent.pdb"), true);
                    }
                }
            }
        }

        private void DeletePreviousVersionAgentBackup(CancellationToken token)
        {
            // delete previous backup agent (back compat, can be remove after serval sprints)
            // bin.bak.2.99.0
            // externals.bak.2.99.0
            foreach (string existBackUp in Directory.GetDirectories(HostContext.GetDirectory(WellKnownDirectory.Root), "*.bak.*"))
            {
                Trace.Info($"Delete existing agent backup at {existBackUp}.");
                try
                {
                    IOUtil.DeleteDirectory(existBackUp, token);
                }
                catch (Exception ex) when (!(ex is OperationCanceledException))
                {
                    Trace.Error(ex);
                    Trace.Info($"Catch exception during delete backup folder {existBackUp}, ignore this error try delete the backup folder on next auto-update.");
                }
            }

            // delete old bin.2.99.0 folder, only leave the current version and the latest download version
            var allBinDirs = Directory.GetDirectories(HostContext.GetDirectory(WellKnownDirectory.Root), "bin.*");
            if (allBinDirs.Length > 2)
            {
                // there are more than 2 bin.version folder.
                // delete older bin.version folders.
                foreach (var oldBinDir in allBinDirs)
                {
                    if (string.Equals(oldBinDir, Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"bin"), StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(oldBinDir, Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"bin.{BuildConstants.AgentPackage.Version}"), StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(oldBinDir, Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"bin.{_targetPackage.Version}"), StringComparison.OrdinalIgnoreCase))
                    {
                        // skip for current agent version
                        continue;
                    }

                    Trace.Info($"Delete agent bin folder's backup at {oldBinDir}.");
                    try
                    {
                        IOUtil.DeleteDirectory(oldBinDir, token);
                    }
                    catch (Exception ex) when (!(ex is OperationCanceledException))
                    {
                        Trace.Error(ex);
                        Trace.Info($"Catch exception during delete backup folder {oldBinDir}, ignore this error try delete the backup folder on next auto-update.");
                    }
                }
            }

            // delete old externals.2.99.0 folder, only leave the current version and the latest download version
            var allExternalsDirs = Directory.GetDirectories(HostContext.GetDirectory(WellKnownDirectory.Root), "externals.*");
            if (allExternalsDirs.Length > 2)
            {
                // there are more than 2 externals.version folder.
                // delete older externals.version folders.
                foreach (var oldExternalDir in allExternalsDirs)
                {
                    if (string.Equals(oldExternalDir, Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"externals"), StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(oldExternalDir, Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"externals.{BuildConstants.AgentPackage.Version}"), StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(oldExternalDir, Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Root), $"externals.{_targetPackage.Version}"), StringComparison.OrdinalIgnoreCase))
                    {
                        // skip for current agent version
                        continue;
                    }

                    Trace.Info($"Delete agent externals folder's backup at {oldExternalDir}.");
                    try
                    {
                        IOUtil.DeleteDirectory(oldExternalDir, token);
                    }
                    catch (Exception ex) when (!(ex is OperationCanceledException))
                    {
                        Trace.Error(ex);
                        Trace.Info($"Catch exception during delete backup folder {oldExternalDir}, ignore this error try delete the backup folder on next auto-update.");
                    }
                }
            }
        }

        private string GenerateUpdateScript(bool restartInteractiveAgent)
        {
            int processId = Process.GetCurrentProcess().Id;
            string updateLog = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Diag), $"SelfUpdate-{DateTime.UtcNow.ToString("yyyyMMdd-HHmmss")}.log");
            string agentRoot = HostContext.GetDirectory(WellKnownDirectory.Root);

            string templateName = "update.sh.template";
            if (PlatformUtil.RunningOnWindows)
            {
                templateName = "update.cmd.template";
            }

            string templatePath = Path.Combine(agentRoot, $"bin.{_targetPackage.Version}", templateName);
            string template = File.ReadAllText(templatePath);

            template = template.Replace("_PROCESS_ID_", processId.ToString());
            template = template.Replace("_AGENT_PROCESS_NAME_", $"Agent.Listener{IOUtil.ExeExtension}");
            template = template.Replace("_ROOT_FOLDER_", agentRoot);
            template = template.Replace("_EXIST_AGENT_VERSION_", BuildConstants.AgentPackage.Version);
            template = template.Replace("_DOWNLOAD_AGENT_VERSION_", _targetPackage.Version);
            template = template.Replace("_UPDATE_LOG_", updateLog);
            template = template.Replace("_RESTART_INTERACTIVE_AGENT_", restartInteractiveAgent ? "1" : "0");

            string scriptName = "_update.sh";
            if (PlatformUtil.RunningOnWindows)
            {
                scriptName = "_update.cmd";
            }

            string updateScript = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Work), scriptName);
            if (File.Exists(updateScript))
            {
                IOUtil.DeleteFile(updateScript);
            }

            File.WriteAllText(updateScript, template);
            return updateScript;
        }

        private async Task UpdateAgentUpdateStateAsync(string currentState)
        {
            _terminal.WriteLine(currentState);

            try
            {
                await _agentServer.UpdateAgentUpdateStateAsync(_poolId, _agentId, currentState);
            }
            catch (VssResourceNotFoundException)
            {
                // ignore VssResourceNotFoundException, this exception means the agent is configured against a old server that doesn't support report agent update detail.
                Trace.Info($"Catch VssResourceNotFoundException during report update state, ignore this error for backcompat.");
            }
            catch (Exception ex)
            {
                Trace.Error(ex);
                Trace.Info($"Catch exception during report update state, ignore this error and continue auto-update.");
            }
        }
    }

    public class UpdaterKnobValueContext : IKnobValueContext
    {
        public string GetVariableValueOrDefault(string variableName)
        {
            return null;
        }

        public IScopedEnvironment GetScopedEnvironment()
        {
            return new SystemEnvironment();
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Sporonema corbariense Durrieu

### Remarks
null


text:
title: "HDFS Connector"
nav-title: Rolling File Sink
nav-parent_id: connectors
nav-pos: 5
---

此连接器提供了一个槽(Sink),将分区文件写入Hadoop文件系统(Hadoop FileSystem)支持的任何文件系统。要使用此连接器,请将以下依赖项添加到您的项目中:

{% highlight xml %}
<dependency>
  <groupId>org.apache.flink</groupId>
  <artifactId>flink-connector-filesystem{{ site.scala_version_suffix }}</artifactId>
  <version>{{site.version}}</version>
</dependency>
{% endhighlight %}

请注意,流(Streaming)连接器当前不是二进制分发的一部分。有关如何将程序与程序库打包以进行集群执行的信息,请参阅
[here]({{site.baseurl}}/dev/linking.html)。

#### 分桶(Bucketing)文件槽(Sink)

分桶(Bucketing)行为以及写入操作均可被配置,我们稍后将会介绍。此处将了解如何创建一个分桶的槽(bucketing sink),默认情况下,会将槽(sink)配置到按时间分割的滚动文件:

{% highlight java %}
DataStream<String> input = ...;

input.addSink(new BucketingSink<String>("/base/path"));

{% endhighlight %}

{% highlight scala %}
val input: DataStream[String] = ...

input.addSink(new BucketingSink[String]("/base/path"))

{% endhighlight %}

唯一必需的参数是存储桶(buckets)的基本路径。可以通过指定自定义的bucketer,writer和batch大小来进一步配置槽(sink)。

默认情况下,当有元素写入(elements arrive)时,分桶的槽(bucketing sink)将根据当前的系统时间分离,并使用日期时间格式`"yyyy-MM-dd--HH"`来命名这些桶(buckets)。此格式将传递给具有当前系统时间的`SimpleDateFormat`以形成桶(bucket)路径。每当出现新的日期时,都会创建一个新的桶(bucket)。例如,如果您有一个包含以分钟作为最细粒度的格式,您将每分钟获得一个新的桶(bucket)。每个桶(bucket)本身是一个包含几个局部(part)文件的目录:每个并行实例的槽(sink)将创建自己的局部(part)文件,当局部(part)文件变得太大时,槽(sink)将在其他局部(part)文件旁边再创建一个新的局部(part)文件。当桶(bucket)变得不活跃时,被打开的局部(part)文件将被刷新并关闭。当最近没有写入操作时,桶(bucket)将被视为不活跃。默认情况下,槽(sink)每分钟检查一次不活跃的桶(bucket),并关闭一分钟内没有写入操作的所有桶(bucket)。可以在`BucketingSink`上使用`setInactiveBucketCheckInterval()`和`setInactiveBucketThreshold()`。

您也可以使用`BucketingSink`上的`setBucketer()`指定自定义的bucketer。 如果需要,bucketer可以使用元素(element)或元组(tuple)的属性来确定桶(bucket)目录。

默认的writer是`StringWriter`。这将在传入的元素(elements)上调用`toString()`,并将它们写入局部(part)文件,用换行符分隔。 要在`BucketingSink`上指定一个自定义的writer,请使用`setWriter()`。如果要编写Hadoop序列文件(Hadoop SequenceFiles),可以使用系统提供的`SequenceFileWriter`其可被配置为使用压缩(compression)。

最后一个配置选项是批量大小。 这指定何时应该关闭局部(part)文件并启动一个新的局部(part)文件。 (默认局部(part)文件大小为384 MB)。

示例:

{% highlight java %}
DataStream<Tuple2<IntWritable,Text>> input = ...;

BucketingSink<String> sink = new BucketingSink<String>("/base/path");
sink.setBucketer(new DateTimeBucketer<String>("yyyy-MM-dd--HHmm"));
sink.setWriter(new SequenceFileWriter<IntWritable, Text>());
sink.setBatchSize(1024 * 1024 * 400); // this is 400 MB,

input.addSink(sink);

{% endhighlight %}

{% highlight scala %}
val input: DataStream[Tuple2[IntWritable, Text]] = ...

val sink = new BucketingSink[String]("/base/path")
sink.setBucketer(new DateTimeBucketer[String]("yyyy-MM-dd--HHmm"))
sink.setWriter(new SequenceFileWriter[IntWritable, Text]())
sink.setBatchSize(1024 * 1024 * 400) // this is 400 MB,

input.addSink(sink)

{% endhighlight %}

将创建一个写入到遵循该模式(schema)的桶(bucket)文件的槽(sink):

```
/base/path/{date-time}/part-{parallel-task}-{count}
```

其中`date-time`是从日期/时间格式获取的字符串,`parallel-task`是并行槽(sink)实例的索引,`count`是根据批量大小而创建的局部(part)文件的运行数。

更多详细信息,请参阅 JavaDoc for
[BucketingSink](http://flink.apache.org/docs/latest/api/java/org/apache/flink/streaming/connectors/fs/bucketing/BucketingSink.html).


text:
package qa.project.bugify.tests;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import qa.project.bugify.models.Issue;

import java.io.IOException;
import java.util.Set;

/**
 * Created by user on 03.06.2016.
 */
public class RestTests  extends TestBase {

    @BeforeMethod
    public void verifyFilter() throws IOException {
        app.filter().loginBugify();
        if(!app.filter().isFilter()){
            //создание фильтра по зарытым репортам в Bugify
            app.filter().createFilterByClosedIssues();
        }
    }

    @Test
    public void testNotFixedIssue() throws IOException {
        Set<Issue> issues = app.issue().getIssues();
        Issue issue = issues.iterator().next();
        skipIfNotFixed(issue.getId());
    }

    @Test
    public void testFixedIssue() throws IOException {
        skipIfNotFixed(8);
        System.out.println("Issue is resolved!");
    }
}


text:
// Copyright (c) Pavel Bakshy, Valeriy Ogiy. All rights reserved. See License.txt in the project root for license information.

using FluentAssertions;

using NUnit.Framework;

using OpenQA.Selenium;

using Rhino.Mocks;

using Selenol.Validation.Element;

namespace Selenol.Tests.Validation.Element
{
    [TestFixture]
    public class TestNotInputAttribute
    {
        [Test]
        [TestCase("div")]
        [TestCase("p")]
        [TestCase("span")]
        public void ValidateCorrectElement(string tagName)
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return(tagName);

            var element = new ElementForTest(webElement);
            var attribute = new NotInputAttribute();
            attribute.Validate(element).Should().BeTrue();
        }

        [Test]
        [TestCase("input")]
        [TestCase("textarea")]
        [TestCase("select")]
        [TestCase("button")]
        [TestCase("option")]
        public void ValidateInCorrectElement(string tagName)
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return(tagName);

            var element = new ElementForTest(webElement);
            var attribute = new NotInputAttribute();
            attribute.Validate(element).Should().BeFalse();
        }

        [Test]
        public void GetErrorMessage()
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return("input");

            var element = new ElementForTest(webElement);
            var attribute = new NotInputAttribute();
            attribute.GetErrorMessage(element).Should().Be("Expected tag not in set of input, textarea, select, button, option. But was 'input'.");
        }
    }
}


text:
<?php

namespace VideoGamesRecords\CoreBundle\Service;

use Doctrine\ORM\ORMException;
use ProjetNormandie\UserBundle\Service\UserService;
use VideoGamesRecords\CoreBundle\Repository\DataRepository;

class DataService
{
    private DataRepository $dataRepository;
    private UserService $userService;

    public function __construct(
        DataRepository $dataRepository,
        UserService $userService
    )
    {
        $this->dataRepository = $dataRepository;
        $this->userService = $userService;
    }

    /**
     * @throws ORMException
     */
    public function majUserRecordConnexion()
    {
        $date = new \DateTime();

        $list = $this->userService->getLoggedToday($date);
        $nb = count($list);

        $oDataAllDate = $this->dataRepository->findOneBy(array('category' => 'USER_RECORD_CONNEXION', 'label' => 'DATE', 'version' => 'ALL'));
        $oDataAllNb = $this->dataRepository->findOneBy(array('category' => 'USER_RECORD_CONNEXION', 'label' => 'NB', 'version' => 'ALL'));
        $oDataV7Date = $this->dataRepository->findOneBy(array('category' => 'USER_RECORD_CONNEXION', 'label' => 'DATE', 'version' => 'V7'));
        $oDataV7Nb = $this->dataRepository->findOneBy(array('category' => 'USER_RECORD_CONNEXION', 'label' => 'NB', 'version' => 'V7'));

        // MAJ V7
        if ($nb > $oDataV7Nb->getValue()) {
            $oDataV7Date->setValue($date->format('d/m/Y'));
            $oDataV7Nb->setValue($nb);
        }
        // MAJ ALL
        if ($nb > $oDataAllNb->getValue()) {
            $oDataAllDate->setValue($date->format('d/m/Y'));
            $oDataAllNb->setValue($nb);
        }
        $this->dataRepository->flush();
    }
}


text:
template <typename T>
T StringToNumber (const std::string &Text ) {
  //character array as argument
  std::stringstream ss(Text);
  T result;
  return ss >> result ? result : 0;
}

void BoundaryPressure::read(const std::string &filename) {
  std::ifstream ifile(filename.c_str());
  std::string line;

  const std::string& whitespace = " \t";
  if (ifile.is_open()) {
    while (std::getline (ifile,line)) {

      size_t strBegin = line.find_first_not_of(whitespace);
      if (strBegin == std::string::npos) // empty line
        continue;

      if (line[strBegin] == '~' || line[strBegin] == 'F' || line[strBegin] == 'E')
        continue;

      std::stringstream stream(line);
      std::string realStr, imStr;
      std::string junk;
      stream >> junk; // index
      stream >> junk; // open paren
      stream >> realStr;
      stream >> imStr;

      double realD = StringToNumber<double>(realStr);
      double imD = StringToNumber<double>(imStr);

      std::cout << realD << "   " << imD << std::endl;

      _cpressures.push_back(std::complex<double>(realD, imD));

    }
    ifile.close();
  }

  computeModuli();
}

void BoundaryPressure::visualize(const TriangleMesh &combined) const {

  vdb_frame();

  float span = _moduli.maxCoeff() - _moduli.minCoeff();

  for (size_t i = 0; i < combined.size(); i++) {
    Triangle t = combined.triangle(i);
    Vector3d c = t.centroid();

    float r = (_moduli(i) - _moduli.minCoeff()) / span;
    float g = 0.0;
    float b = 1.0 - r;

    vdb_color(r,g,b);
    vdb_point(c.x(), c.y(), c.z());
  }

}


text:
We were unable to communicate with the server. Please wait a few minutes and try again.

If the problem persists, please contact {{ productName }} Support.

          UI     v{{ guiVersion }} {{ guiBuildDate | date:'yyyy-MM-dd HH:mm' }}

          API   v{{ apiVersion }}

            All rights reserved.

              2017 Board of Trustees of the
              University of Illinois.


text:
var config = require('../data/config.json')

module.exports = function (client, message, info) {
  // Define prefixes
  info.prefixes = config.prefixes
  if (info.prefixes.includes('mention')) {
    info.prefixes[info.prefixes.indexOf('mention')] = `<@${client.user.id}> `
  }

  info.prefix = false
  for (var thisPrefix of info.prefixes) {
    if (message.content.startsWith(thisPrefix)) {
      info.prefix = thisPrefix
    }
  }

  if (!info.prefix) return

  // // Test if there is the prefix
  // if (!message.content.startsWith(info.prefix)) return

  return require('./ArgsAndCommand.js')(client, message, info)
}


text:
'use strict';

var api = require('./controllers/api'),
    index = require('./controllers');

/**
 * Application routes
 */
module.exports = function(app) {

  // Server API Routes
  app.route('/api/awesomeThings')
    .get(api.awesomeThings);

  // All undefined api routes should return a 404
  app.route('/api/*')
    .get(function(req, res) {
      res.send(404);
    });

  // All other routes to use Angular routing in app/scripts/app.js
  app.route('/partials/*')
    .get(index.partials);
  app.route('/*')
    .get( index.index);
};


text:
package org.gedcomx.record.types;

import org.codehaus.enunciate.qname.XmlQNameEnum;
import org.codehaus.enunciate.qname.XmlUnknownQNameEnumValue;
import org.gedcomx.record.URI;

/**
 * Enumeration of standard alternate id types.
 *
 * @author Ryan Heaton
 */
@XmlQNameEnum (
  base = XmlQNameEnum.BaseType.URI
)
public enum AlternateIdType {

  Forwarded,

  @XmlUnknownQNameEnumValue
  OTHER;

  /**
   * Return the QName value for this enum.
   *
   * @return The QName value for this enum.
   */
  public URI toQNameURI() {
    return URI.create(org.codehaus.enunciate.XmlQNameEnumUtil.toURIValue(this));
  }

  /**
   * Get the enumeration from the QName.
   *
   * @param qname The qname.
   * @return The enumeration.
   */
  public static AlternateIdType fromQNameURI(URI qname) {
    return org.codehaus.enunciate.XmlQNameEnumUtil.fromURIValue(qname.toString(), AlternateIdType.class);
  }

}