text:
/*
 * This file is part of COMPASS. It is subject to the license terms in
 * the LICENSE file found in the top-level directory of this distribution.
 * (Also available at http://www.apache.org/licenses/LICENSE-2.0.txt)
 * You may not use this file except in compliance with the License.
 */
package de.dfki.asr.compass.model;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import de.dfki.asr.compass.model.resource.Image;
import java.io.Serializable;
import java.util.Comparator;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.eclipse.persistence.oxm.annotations.XmlInverseReference;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

@Entity
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@JsonAutoDetect(fieldVisibility = Visibility.NONE,getterVisibility = Visibility.NONE,setterVisibility = Visibility.NONE)
@Table(uniqueConstraints = @UniqueConstraint(columnNames = { "project_id", "name" }))
@ApiModel //the mixins change the data references, so that only ids or lists of ids will be delivered
public class Scenario extends AbstractCompassEntity implements Serializable {

	private static final long serialVersionUID = 1226510924828828152L;

	@Id
	@XmlTransient
	@JsonProperty
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@ApiModelProperty("Id")
	private long id;

	@NotNull(message = "Scenario must have a name.")
	@XmlElement
	@JsonProperty
	@Column(length = 128)
	@Size(min = 1, max = 128, message = "Maximum Prefab Set name length is ${max} characters.")
	@Pattern(regexp = "^(?!\\s)[-\\w :.()]+(?<!\\s)$", message = "Scenario name can only contain letters, dashes, braces, colons and dots. No leading or trailing spaces.")
	@ApiModelProperty("Name")
	private String name;

	@XmlElement
	@JsonProperty
	@OneToOne(cascade = CascadeType.ALL)
	@ApiModelProperty(value = "Preview image id", dataType = "long")
	private Image preview;

	@NotNull(message = "Scenario must have a root scene node.")
	@XmlElement
	@JsonProperty
	@OneToOne(cascade = CascadeType.ALL)
	@ApiModelProperty(value = "Id of the root scene node", dataType = "long")
	private SceneNode root;

	@NotNull(message = "Scenario must reference a project.")
	@ManyToOne
	@JsonProperty
	@XmlInverseReference(mappedBy = "scenarios")
	@JoinColumn(name = "project_id")
	@ApiModelProperty(value = "Id of the parent project", dataType = "long")
	private Project project;

	public Scenario() {
		name = "";
		root = new SceneNode("Root");
	}

	@Override
	public long getId() {
		return id;
	}

	@Override
	public void setId(final long id) {
		this.id = id;
	}

	@Override
	public void forceEagerFetch() {
		root.forceEagerFetch();
		if (preview != null) {
			preview.forceEagerFetch();
		}
	}

	@Override
	public void clearIdsAfterDeepCopy() {
		setId(0);
		if (root != null) {
			root.clearIdsAfterDeepCopy();
		}
		if (preview != null) {
			preview.clearIdsAfterDeepCopy();
		}
	}

	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public Image getPreview() {
		return preview;
	}

	public void setPreview(final Image preview) {
		this.preview = preview;
	}

	public SceneNode getRoot() {
		return root;
	}

	public void setRoot(final SceneNode root) {
		this.root = root;
	}

	public void setProject(final Project project) {
		if (this.project == project) {
			return;
		}

		Project oldProject = this.project;
		this.project = project;

		if (oldProject != null) {
			oldProject.removeScenario(this);
		}

		if (project != null) {
			try {
				project.addScenario(this);
			} catch (IllegalArgumentException e) {
				throw new IllegalStateException("Should never reach this point.", e);
			}
		}
	}

	public Project getProject() {
		return project;
	}

	@Override
	public String toString() {
		return "Scenario [id=" + id + "]" + " (" + name + ")";
	}

	public static class Comparators {

		public static final Comparator<Scenario> NAME = new Comparator<Scenario>() {

			@Override
			public int compare(final Scenario o1, final Scenario o2) {
				return o1.name.toLowerCase().compareTo(o2.name.toLowerCase());
			}
		};
	}

}


text:
#import "MSServiceAbstract.h"

NS_ASSUME_NONNULL_BEGIN

/**
 * Mobile Center analytics service.
 */
@interface MSAnalytics : MSServiceAbstract

/**
 * Track an event.
 *
 * @param eventName  event name.
 */
+ (void)trackEvent:(NSString *)eventName;

/**
 * Track an event.
 *
 * @param eventName  event name.
 * @param properties dictionary of properties.
 */
+ (void)trackEvent:(NSString *)eventName withProperties:(nullable NSDictionary<NSString *, NSString *> *)properties;

@end

NS_ASSUME_NONNULL_END

redpajama_set_name: RedPajamaGithub


text:
(function(root, factory) {

  // Set up Utensils appropriately for the environment. Start with AMD.
  if (typeof define === 'function' && define.amd) {
    define(['underscore', 'q', 'exports'], function(_, Q, exports) {
      // Export global even in AMD case in case this script is loaded with
      // others that may still expect a global Utensils.
      root.Utensils = factory(root, exports, _, Q);
    });

  // Next for Node.js or CommonJS.
  } else if (typeof exports !== 'undefined') {
    var _ = require('underscore');
    var Q = require('q');
    factory(root, exports, _, Q);

  // Finally, as a browser global.
  } else {
    root.Utensils = factory(root, {}, root._, root.Q);
  }

}(this, function(root, Utensils, _, Q) {

  // Initial Setup
  // -------------

  // Save the previous value of the `Utensils` variable, so that it can be
  // restored later on, if `noConflict` is used.
  var previousUtensils = root.Utensils;

  // Current version of the library. Keep in sync with `package.json`.
  Utensils.VERSION = '0.1.0';

  // Runs Utensils.js in *noConflict* mode, returning the `Utensils` variable
  // to its previous owner. Returns a reference to this Utensils object.
  Utensils.noConflict = function() {
    root.Utensils = previousUtensils;
    return this;
  };

  var Base = Utensils.Base = function() {
    var self = this;
    var args = _.toArray( arguments );

    // cast .argumentName String to .argumentNames Array
    var argumentName = _.result( this, 'argumentName' );
    if ( _.isString( argumentName ) && _.isUndefined( this.argumentNames )) {
      this.argumentNames = [ argumentName ];
    }

    // store the original arguments Array on the instance
    // and prevent make it immutable to preserve raw input
    this.arguments = _.object( this.argumentNames, args );
    Object.freeze( this.arguments );

    // attach arguments to the instance
    // with defined names if names are defined
    if ( this.argumentNames ) {
      _.each( args, function(value, index) {
        self[self.argumentNames[index]] = value;
      });
    }
  };

  Base.extend = extend;

  // Value
  // ---------------

  var Value = Utensils.Value = Base.extend({

    argumentName: 'value',

    // special method in JavaScript, is used for
    // all comparators except equality, by default
    // returns the same value as was passed
    // into the constructor
    valueOf: function() {
      return this[ this.argumentName ];
    }

  });

  // Functional equality utility method
  Value.isEqualTo = function( a, b ) {
    return a.valueOf() === b.valueOf();
  };

  // Functional inequality utility method
  Value.isNotEqualTo = function( a, b ) {
    return a.valueOf() !== b.valueOf();
  };

  // List of methods that are applied directly to the constructor
  // as static methods to offer a functional style, but
  // should be offered as partially applied versions
  // on the prototype.
  var methodsToScopeToPrototype = [ 'isEqualTo', 'isNotEqualTo' ];

  // Scope the methods to the prototype,
  // pre-filling the first method with the instance
  _.each( methodsToScopeToPrototype, function( fnName ) {
    Value.prototype[fnName] = function() {
      return _.partial( Value[ fnName ], this ).apply( this, arguments );
    };
  });

  // Service
  // ---------------

  var Service = Utensils.Service = Base.extend({

    constructor: function() {
      Base.prototype.constructor.apply( this, arguments );

      // if only one method is defined on the extended object
      // use that one method for the procedure, meaning this.procedure
      // doesn't need to be defined explicitly if only one method is defined
      var protoPropFunctionKeys = _.without( _.functions( this.constructor.__protoProps__ ), 'error' );
      if ( protoPropFunctionKeys.length === 1 ) {
        this.procedure = protoPropFunctionKeys;
      }

      // if a procedure is either not defined or cannot be extrapolated,
      // throw error.
      if (_.isUndefined( this.procedure )) {
        throw new Error('Service object must have a defined procedure');
      }

      this.procedureMethods = prepareProcedureMethods(this.procedure, this);
    },

    run: function(initialValue) {
      var self = this;
      var deferred = Q.defer();

      promiseSequence.call( this, this.procedureMethods, initialValue)
        .then(function(resp) {
          if ( self.success ) self.success.call(self, resp);
          deferred.resolve(resp);
        })
        .fail(function(err) {
          if ( self.error ) self.error.call(self, err);
          deferred.reject(err);
        });

      return deferred.promise;
    }

  });

  // Form
  // ---------------

  var Form = Utensils.Form = Base.extend({

    argumentName: 'data',

    // default procedure for a form object
    // is to first validate the input and then
    // process the form
    procedure: [
      'validate',
      'process'
    ],

    constructor: function() {
      var self = this;

      Base.prototype.constructor.apply( this, arguments );

      // if a constructor is defined on .validator,
      // overwrite #validate with a promise-wrapped
      // function returning a new instance of the constructor
      if ( this.validator ) {
        var Validator = ( isPattern( this.validator, 'Validator' ) ) ? this.validator : _.result( this, 'validator' );
        this.validate = function() { return new Validator( self[ self.argumentNames[0] ] ).run(); };
      }

      // if a constructor is defined on .processor,
      // overwrite #process with a promise-wrapped
      // function returning a new instance of the constructor
      if ( this.processor ) {
        var Processor = ( isPattern( this.processor, 'Service' ) ) ? this.processor : _.result( this, 'processor' );
        this.process = function() { return new Processor( self[ self.argumentNames[0] ] ).run(); };
      }

      // a process method must be defined, otherwise nothing is
      // happening with this form object.
      if ( _.isUndefined( this.process ) ) { throw new Error('A `process` method must be defined'); }

      this.procedureMethods = prepareProcedureMethods( this.procedure, this );
    },

    run: function() {
      return promiseSequence( this.procedureMethods );
    }

  });

  // Validator
  // ---------------

  var Validator = Utensils.Validator = Base.extend({

    argumentName: 'data',

    constructor: function() {
      Base.prototype.constructor.apply( this, arguments );

      this.procedureMethods = this.prepareProcedureMethods( _.functions( this.constructor.__protoProps__ ), this );
    },

    // map #run for expressive API
    validate: function() {
      return this.run.apply( this, arguments );
    },

    run: function() {
      var procedureMethodPromises = returnArrayOfResultsFromExecutedFunctions( this.procedureMethods );
      return Q.allSettled( procedureMethodPromises )
        .then( this.parseResults );
    },

    prepareProcedureMethods: function( procedureMethodKeys, context ) {
      var procedureMethods;

      procedureMethods = getObjectMethodsByName( procedureMethodKeys, context );
      procedureMethods = wrapAnySyncFunctionsWithBooleanPromiseHandling( procedureMethods, context );
      procedureMethods = wrapAnySequenceFunctionsThatRequestedPromises( procedureMethods, context, {
        sequence: false,
        reject: function( fn, reject ) {
          return function( error ) {
            return reject({ name: fn._name, error: error });
          };
        }
      });
      procedureMethods = returnBoundObjectMethods( procedureMethods, context );

      return procedureMethods;
    },

    parseResults: function( results ) {
      var deferred = Q.defer();
      var errors = _.chain(results)
        .filter( function( result ) { return result.state === 'rejected'; })
        .map( function( error ) { return error.reason; })
        .value();

      if ( errors.length > 0 ) {
        deferred.reject( errors );
      } else {
        deferred.resolve();
      }

      return deferred.promise;
    }

  });

  // Query
  // ---------------

  var Query = Utensils.Query = Base.extend({

    constructor: function() {
      Base.prototype.constructor.apply( this, arguments );

      if ( _.isUndefined( this.process ) ) { throw new Error('A procedure must be defined'); }

      this.procedureMethods = prepareProcedureMethods( _.functions( this.constructor.__protoProps__ ), this );
    },

    // map #run for expressive API
    perform: function() {
      return this.run.apply( this, arguments );
    },

    run: function() {
      var self = this;

      return this.setup()
        .then(function() {
          return promiseSequence( procedureMethods )
            .then(self.success)
            .fail(self.error);
        });
    },

    setup: function() {
      var self = this;

      return this.db()
        .then(function( db ) {
          return db;
        })
        .then(function( db ) {
          return self.buildCollections( db );
        });
    },

    // attach all collections to the object
    // context with the name of the collection
    // and "Collection", so for the "accounts" collection,
    // the collection would be scoped to the
    // context as "accountsCollection"
    buildCollections: function( db ) {
      var self = this;

      // var foo = 'accounts';
      // Q.ninvoke( db, 'collection', foo )
      //   .then(function( collection ) { console.log( collection ); });
      this.collections = {};
      var collectionPromises = _.map( this.collectionNames, function( collectionName ) {
        return Q.ninvoke( db, 'collection', collectionName )
          .then(function( collection ) {
            self.collections[ collectionName ] = collection;
          });
      });

      return Q.all( collectionPromises );
    }

  });

  // Presenter/View
  // -------------

  var Presenter = Utensils.Presenter = Utensils.View = Base.extend({

    constructor: function( data ) {
      // ensure the argument is cast into an array
      this.data = ( _.isArray( data ) ) ? data : [ data ];

      // freeze the original data
      _.each( this.data, Object.freeze );
    },

    // map #run for expressive API
    present: function() {
      return this.run.apply( this, arguments );
    },

    run: function( returnKeys ) {
      var self = this;

      this.returnKeys = returnKeys;

      _.bindAll( this,
        'results',

        '_whitelist',
        '_blacklist',
        '_propertyMap',
        '_customAttributes'
      );

      // execute the presenter methods on all items
      var presentPromises = _.map( this.data, function( item ) {
        return new Q( self.runOne( item ) );
      });

      // return a promise representing the state
      // of all items being presented
      return Q.all( presentPromises )
        .then( this.results );
    },

    runOne: function( item ) {
      var self = this;
      var result = _.clone(item);
      var deferred = Q.defer();

      result = _.compose(
        deferred.resolve,
        function( result ) {
          return _.extend( result, self._customAttributes( item ) );
        },
        this._propertyMap,
        this._blacklist,
        this._whitelist
      )( result );

      return deferred.promise;
    },

    results: function( results ) {
      var self = this;

      // if a specific set of return keys was specified
      // filter the results to just those properties
      if ( this.returnKeys ) {
        results = _.map( results, function( result ) {
          return _.pick.call( null, result, self.returnKeys );
        });
      }

      if ( _.isArray( this.data ) ) {
        return results;
      } else {
        return results[0];
      }
    },

    // whitelist keys
    _whitelist: function( item ) {
      if ( !this.whitelist ) { return item; }

      return _.pick.call( null, item, this.whitelist );
    },

    // blacklist keys
    _blacklist: function( item ) {
      if ( !this.blacklist ) { return item; }

      return _.omit.call( null, item, this.blacklist );
    },

    // rename properties
    _propertyMap: function( item ) {
      if ( !this.propertyMap ) { return item; }

      _.each( this.propertyMap, function( value, key ) {
        item[ value ] = item[ key ];
        delete item[ key ];
      });

      return item;
    },

    _customAttributes: function( item ) {
      var result = {};

      var customAttributeFunctions = prepareProcedureMethods( _.functions( this.constructor.__protoProps__ ), item );

      _.each( customAttributeFunctions, function( fn ) {
        result[ fn._name ] = fn();
      });

      return result;
    }

  });

  // Policy
  // ---------------

  var Policy = Utensils.Policy = Base.extend({

    // map #run for expressive API
    analyze: function() {
      return this.run.apply( this, arguments );
    },

    run: function() {
      // returns an object of all functions defined on the
      // implementation of the Validator constructor
      // or, rather, is the object passed into Validator.extend
      var context = _.pick.call( null, this, this.argumentNames );
      var procedureMethods = this.prepareProcedureMethods( _.functions( this.constructor.__protoProps__ ), context );

      // call all methods simultaneously, returning
      // all results
      var procedureMethodPromises = returnArrayOfResultsFromExecutedFunctions( procedureMethods );
      return Q.allSettled( procedureMethodPromises )
        .then( this.parseResults );
    },

    prepareProcedureMethods: function( procedureMethodKeys, context, options ) {
      options = ( options || {} );
      var procedureMethods;

      procedureMethods = getObjectMethodsByName( procedureMethodKeys, this );
      procedureMethods = wrapAnySyncFunctionsWithBooleanPromiseHandling( procedureMethods, context, options );
      procedureMethods = wrapAnySequenceFunctionsThatRequestedPromises( procedureMethods, context, {
        sequence: false,
        reject: function( fn, reject ) {
          return function( error ) {
            return reject({ name: fn._name, error: error });
          };
        }
      });
      procedureMethods = returnBoundObjectMethods( procedureMethods, options.context || this );

      return procedureMethods;
    },

    parseResults: function( results ) {
      var deferred = Q.defer();
      var errors = _.chain(results)
        .filter( function( result ) { return result.state === 'rejected'; })
        .map( function( error ) { return error.reason; })
        .value();

      if ( errors.length > 0 ) {
        deferred.reject( errors );
      } else {
        deferred.resolve( this.arguments );
      }

      return deferred.promise;
    }

  });

  // Decorator
  // -------------

  var Decorator = Utensils.Decorator = Base.extend({

    constructor: function( obj ) {
      if ( arguments.length === 0 ) { return; }

      var self = this;
      var sequence = self.returnSequence.bind( self )();
      var methodToDecorate = obj[ this.methodToDecorate ].bind( obj );
      var decoratedMethod = function() {
        return Q.when( methodToDecorate() )
          .then( sequence );
      };
      obj[ this.methodToDecorate ] = decoratedMethod;

      return obj;
    },

    returnSequence: function() {
      // if only one method is defined on the prototype
      // use that for the procedure, meaning this.procedure
      // doesn't need to be described with just one value
      if ( !this.procedure ) {
        var protoPropProcedureMethods = _.functions( this.constructor.__protoProps__ );
        if ( protoPropProcedureMethods.length === 1 ) {
          this.procedure = protoPropProcedureMethods;
        }
      }

      var procedureMethods = prepareProcedureMethods( this.procedure, this, {
        firstMethodTakesArgument: true
      });

      return function() {
        var args = [ procedureMethods ].concat( _.toArray( arguments ) );
        return promiseSequence.apply( null, args );
      };
    }

  });

  // Helpers
  // -------

  function extend(protoProps, staticProps) {
    var parent = this;
    var child;

    if (protoProps && _.has(protoProps, 'constructor')) {
      child = protoProps.constructor;
    } else {
      child = function(){ return parent.apply(this, arguments); };
    }

    _.extend(child, parent, staticProps);

    var Surrogate = function(){ this.constructor = child; };
    Surrogate.prototype = parent.prototype;
    child.prototype = new Surrogate();

    if (protoProps) { _.extend(child.prototype, protoProps); }

    child.__super__ = parent.prototype;
    child.__protoProps__ = protoProps;

    return child;
  }

  // Attach #extend to each of the base objects
  _.each([ 'Value', 'Service', 'Form', 'Validator', 'Query', 'Presenter', 'Policy', 'Decorator' ], function( CtorName ) {
    Utensils[CtorName].extend = extend;
    Utensils[CtorName].__pattern__ = CtorName;
  });

  function prepareProcedureMethods( procedureMethodKeys, context, options ) {
    options = ( options || {} );

    var procedureMethods;

    procedureMethods = getObjectMethodsByName( procedureMethodKeys, context );
    procedureMethods = wrapAnySequenceFunctionsThatRequestedPromises( procedureMethods, context, options );
    procedureMethods = returnBoundObjectMethods( procedureMethods, context, options );

    return procedureMethods;
  }

  function promiseSequence(fns, initialValue) {
    return fns.reduce(function (soFar, f) {
      return soFar.then(f);
    }, initialValue ? new Q(initialValue) : Q.when());
  }

  function wrapWithPromise( staticFn, args, context, options ) {
    options = ( options || {} );

    var promiseFn = _.wrap( staticFn, function( fn ) {
      var token = Q.defer();
      var resolve = ( options.resolve ) ? options.resolve( fn, token.resolve ) : token.resolve;
      var reject =  ( options.reject )  ? options.reject( fn, token.reject )   : token.reject;

      args = args.concat([resolve, reject]);
      fn.apply( context, args );
      return token.promise;
    });

    return promiseFn;
  }

  function wrapAnySyncFunctionsWithBooleanPromiseHandling( fns, context, options ) {
    options = ( options || {} );

    return _.chain( fns )
      .compact()
      .map(function( fn ) {
        if ( fn.length === 0 ) {
          return function() {
            var token = Q.defer();

            // if the function returns true, resolve the promise
            // otherwise, reject it
            if ( fn.call( context ) === true ) {
              token.resolve();
            } else {
              token.reject({ name: fn._name });
            }

            return token.promise;
          };
        } else {
          return fn;
        }
      })
      .value();
  }

  function scopeName( newFn, oldFn ) {
    newFn._name = oldFn._name;
  }

  function wrapAnySequenceFunctionsThatRequestedPromises( fns, context, options ) {
    options = ( options || {} );

    return _.chain( fns )
      .compact()
      .map(function(fn, index) {
        var newFn = function( res ) {
          var args = [];

          // if the operation is after the first,
          // meaning that it could accept a result from
          // a previous function, make
          // the first argument the result of the previous
          // function, even if it's undefined.
          if ( options.sequence !== false ) {
            args.push(res);
          }

          // if we're dealing with the first item in the sequence
          // which cannot have a value returned from a previous promise,
          // then any arguments means resolve and reject are requested
          // If we're in a subsequent chain link, it is possible that
          // a return value is requested, thusly, if only one argument is
          // specified, this means they only want the return value from the
          // previous promise, but if more than one is requested, they must want
          // at least the resolve fn, or both resolve and reject
          if (( index === 0 && options.firstMethodTakesArgument !== true && fn.length >= 1 ) || ( index >= 1 && fn.length >= 2 )) {
            fn = wrapWithPromise( fn, args, context, options );
          }

          // return the executed new function with the right args
          return fn.apply( context, args );
        };
        scopeName( newFn, fn );
        return newFn;
      })
      .value();
  }

  function returnArrayOfResultsFromExecutedFunctions( fns ) {
    return _.map(fns, function(fn) {
      return fn();
    });
  }

  function getObjectMethodsByName( fnNames, obj ) {
    return _.chain( fnNames )
      .map( function( fnName ) {
        var fn = obj[fnName];

        // if the function is found, scope the name of the function
        // to the function itself for later reference.
        // Uses _name since name is read-only
        if ( fn ) { fn._name = fnName; }

        return fn;
      })
      .compact()
      .value();
  }

  function returnBoundObjectMethods( fns, context ) {
    return _.map( fns, function(fn) {
      var boundFn = _.bind( fn, context );
      scopeName( boundFn, fn );
      return boundFn;
    });
  }

  function isPattern( Ctor, PatternName ) {
    return Ctor.prototype.constructor.__pattern__ === PatternName;
  }

  return Utensils;

}));


text:
namespace ebml
{
	typedef XMP_Int64 ebml_offset_t;
	typedef XMP_Uns64 ebml_size_t;
	typedef XMP_Uns64 ebml_id_t;
	typedef XMP_Uns64 ebml_date_t;
	typedef XMP_Uns64 ebml_unsigned_t;
	typedef XMP_Int64 ebml_signed_t;
	typedef std::string ebml_string_t;
	typedef std::string ebml_utf8_t;
	typedef double ebml_float_t;
	typedef XMP_Uns64 ebml_level_t;

	template<typename T>
	ebml_size_t size_for_int(T value)
	{
		ebml_size_t result(1); // always use at least one byte to represent integer value
		value >>= 8;
		while (value)
		{
			++result;
			value >>= 8;
		}
		return result;
	}

	typedef struct ebml_vint_t
	{
		explicit ebml_vint_t(ebml_size_t length, ebml_size_t value) : _length(length), _value(value) {}
		explicit ebml_vint_t(ebml_size_t value) : _length(size_for_int(value)), _value(value) {}
		ebml_size_t _length;
		ebml_size_t _value;
	}
	ebml_vint;

	typedef std::vector<XMP_Uns8> ebml_binary_t;

	enum class ebml_type_t : char
	{
		kEBMLTypeMaster = 'm',
		kEBMLTypeUnsigned = 'u',
		kEBMLTypeSigned = 'i',
		kEBMLTypeString = 's',
		kEBMLTypeUTF8 = '8',
		kEBMLTypeBinary = 'b',
		kEBMLTypeFloat = 'f',
		kEBMLTypeDate = 'd',
		kEBMLTypeUnknown = '?'
	};

	static const ebml_string_t kDocTypeMatroska = "matroska";
	static const ebml_string_t kDocTypeWebM = "webm";

	static const ebml_unsigned_t kEbmlInvalid = (std::numeric_limits<ebml_unsigned_t>::max)();

	typedef struct ebml_restrictions_t
	{
		ebml_unsigned_t max_id_length;
		ebml_unsigned_t max_size_length;
	}
	ebml_restrictions;

	class ebml_element_t;

	typedef std::function<bool(std::shared_ptr<ebml_element_t>)> on_element_t;

	void ReadEBMLMaster(XMP_IO * fileRef, std::shared_ptr<ebml_element_t> parent, ebml_restrictions_t & restrictions, ebml_level_t level, on_element_t callback);
}

#endif	// __EBML_Support_hpp__


text:
import policy
import hide_deactivated_images


text:
package com.pacinetes.dom.reportes;

import com.pacinetes.dom.persona.Persona;

public class ClientesActivosReporte extends Persona {

	private String clienteNombre;

	public String getClienteNombre() {
		return clienteNombre;
	}

	public void setClienteNombre(String clienteNombre) {
		this.clienteNombre = clienteNombre;
	}

	private String clienteApellido;

	public String getClienteApellido() {
		return clienteApellido;
	}

	public void setClienteApellido(String clienteApellido) {
		this.clienteApellido = clienteApellido;
	}

	public int clienteDni;

	public int getClienteDni() {
		return clienteDni;
	}

	public void setClienteDni(int clienteDni) {
		this.clienteDni = clienteDni;
	}

	private String clienteTipoDocumento;

	public String getClienteTipoDocumento() {
		return clienteTipoDocumento;
	}

	public void setClienteTipoDocumento(String clienteTipoDocumento) {
		this.clienteTipoDocumento = clienteTipoDocumento;
	}

    private String personaTelefono;

    public String getPersonaTelefono() {
		return personaTelefono;
	}
	public void setPersonaTelefono(String personaTelefono) {
		this.personaTelefono = personaTelefono;
	}
}


text:
<?php

namespace Afup\UserBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

/**
 * Description of RegistrationFormType
 *
 * @author Jérôme Desjardins <hello@jewome62.eu>
 */
class RegistrationFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('lastname', null, array(
            'label' => 'Nom'
        ));
        $builder->add('firstname', null, array(
            'label' => 'Prénom'
        ));

    }

    public function getParent()
    {
        return 'fos_user_registration';
    }

    public function getName()
    {
        return 'afup_user_registration';
    }
}


text:
import webob

from nova.api.openstack.compute import flavors as flavors_api
from nova.api.openstack.compute.views import flavors as flavors_view
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.compute import flavors
from nova import exception
from nova.i18n import _

authorize = extensions.extension_authorizer('compute', 'flavormanage')

class FlavorManageController(wsgi.Controller):
    """The Flavor Lifecycle API controller for the OpenStack API."""
    _view_builder_class = flavors_view.ViewBuilder

    def __init__(self):
        super(FlavorManageController, self).__init__()

    @wsgi.action("delete")
    def _delete(self, req, id):
        context = req.environ['nova.context']
        authorize(context)

        try:
            flavor = flavors.get_flavor_by_flavor_id(
                    id, ctxt=context, read_deleted="no")
        except exception.NotFound as e:
            raise webob.exc.HTTPNotFound(explanation=e.format_message())

        flavors.destroy(flavor['name'])

        return webob.Response(status_int=202)

    @wsgi.action("create")
    @wsgi.serializers(xml=flavors_api.FlavorTemplate)
    def _create(self, req, body):
        context = req.environ['nova.context']
        authorize(context)
        if not self.is_valid_body(body, 'flavor'):
            msg = _("Invalid request body")
            raise webob.exc.HTTPBadRequest(explanation=msg)
        vals = body['flavor']
        name = vals.get('name')
        flavorid = vals.get('id')
        memory = vals.get('ram')
        vcpus = vals.get('vcpus')
        root_gb = vals.get('disk')
        ephemeral_gb = vals.get('OS-FLV-EXT-DATA:ephemeral', 0)
        swap = vals.get('swap', 0)
        rxtx_factor = vals.get('rxtx_factor', 1.0)
        is_public = vals.get('os-flavor-access:is_public', True)

        try:
            flavor = flavors.create(name, memory, vcpus, root_gb,
                                    ephemeral_gb=ephemeral_gb,
                                    flavorid=flavorid, swap=swap,
                                    rxtx_factor=rxtx_factor,
                                    is_public=is_public)
            req.cache_db_flavor(flavor)
        except (exception.FlavorExists,
                exception.FlavorIdExists) as err:
            raise webob.exc.HTTPConflict(explanation=err.format_message())
        except exception.InvalidInput as exc:
            raise webob.exc.HTTPBadRequest(explanation=exc.format_message())

        return self._view_builder.show(req, flavor)

class Flavormanage(extensions.ExtensionDescriptor):
    """Flavor create/delete API support."""

    name = "FlavorManage"
    alias = "os-flavor-manage"
    namespace = ("http://docs.openstack.org/compute/ext/"
                 "flavor_manage/api/v1.1")
    updated = "2012-01-19T00:00:00Z"

    def get_controller_extensions(self):
        controller = FlavorManageController()
        extension = extensions.ControllerExtension(self, 'flavors', controller)
        return [extension]


text:
- You no longer use a `title` attribute, and there is no longer an `html` option. Instead, both of them have been streamlined into a single option called `content`.

- Remove arrowTransform option: Arrow transforms should be specified in CSS using a theme

- inertia + animation?


text:
package javax.xml.ws;

import java.lang.annotation.Documented;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;

/**
 *  Used to annotate the getPortName()
 *  methods of a generated service interface.
 *
 *
The information specified in this annotation is sufficient
 *  to uniquely identify a wsdl:port element
 *  inside a wsdl:service. The latter is
 *  determined based on the value of the WebServiceClient
 *  annotation on the generated service interface itself.
 *
 *  @since JAX-WS 2.0
 *
 *  @see javax.xml.ws.WebServiceClient
**/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface WebEndpoint {
  /**
   *  The local name of the endpoint.
  **/
  String name() default "";
}


text:
#!/bin/sh -e
#
# Stack installation script.
#
# This script is meant for quick & easy install via:
#   'curl -sSL https://get.haskellstack.org/ | sh'
# or:
#   'wget -qO- https://get.haskellstack.org/ | sh'
#
# By default, this installs 'stack' to '/usr/local/bin'.
#
# Arguments (use `... | sh -s - ARGUMENTS`)
#
# -q: reduce script's output
# -f: force over-write even if 'stack' already installed
# -d DESTDIR: change destination directory
#
# Make pull requests at:
# https://github.com/commercialhaskell/stack/blob/master/etc/scripts/get-stack.sh
#

STACK_VERSION="1.9.3"
HOME_LOCAL_BIN="$HOME/.local/bin"
DEFAULT_DEST="/usr/local/bin/stack"
DEST=""
QUIET=""
FORCE=""
STACK_TEMP_DIR=

# creates a temporary directory, which will be cleaned up automatically
# when the script finishes
make_temp_dir() {
  STACK_TEMP_DIR="$(mktemp -d 2>/dev/null || mktemp -d -t stack)"
}

# cleanup the temporary directory if it's been created.  called automatically
# when the script exits.
cleanup_temp_dir() {
  if [ -n "$STACK_TEMP_DIR" ] ; then
    rm -rf "$STACK_TEMP_DIR"
    STACK_TEMP_DIR=
  fi
}

# print a message to stderr and exit with error code
die() {
  echo "$@" >&2
  exit 1
}

# print a message to stdout unless '-q' passed to script
info() {
  if [ -z "$QUIET" ] ; then
    echo "$@"
  fi
}

# print a separator for post-install messages
post_install_separator() {
  info ""
  info "-------------------------------------------------------------------------------"
  info ""
}

# determines the the CPU's instruction set
get_isa() {
  if arch | grep -q armv7 ; then
    echo arm
  elif arch | grep -q aarch64 ; then
    echo aarch64
  else
    echo x86
  fi
}

# exits with code 0 if arm ISA is detected as described above
is_arm() {
  test "$(get_isa)" = arm
}

# exits with code 0 if aarch64 ISA is detected as described above
is_aarch64() {
  test "$(get_isa)" = aarch64
}

# determines 64- or 32-bit architecture
# if getconf is available, it will return the arch of the OS, as desired
# if not, it will use uname to get the arch of the CPU, though the installed
# OS could be 32-bits on a 64-bit CPU
get_arch() {
  if has_getconf ; then
    if getconf LONG_BIT | grep -q 64 ; then
      echo 64
    else
      echo 32
    fi
  else
    case "$(uname -m)" in
      *64)
        echo 64
        ;;
      *)
        echo 32
        ;;
    esac
  fi
}

# exits with code 0 if a 64-bit architecture is detected as described above
is_64_bit() {
  test "$(get_arch)" = 64
}

# prints a generic bindist notice
print_bindist_notice() {
  if [ -z "$1" ] ; then
    info ""
    info "Using generic bindist..."
    info ""
  else
    info ""
    info "Using generic $1 bindist..."
    info ""
  fi
}

# Adds a 'sudo' prefix if sudo is available to execute the given command
# If not, the given command is run as is
# When requesting root permission, always show the command and never re-use cached credentials.
sudocmd() {
  if command -v sudo >/dev/null; then
    echo "sudo $@"
    # -k: Disable cached credentials.
    sudo -k "$@"
  else
    "$@"
  fi
}

# Install dependencies for distros that use Apt
apt_install_dependencies() {
    info "Installing dependencies..."
    info ""
    apt_get_install_pkgs "$@"
}

# Attempts an install on Ubuntu via apt, if possible
# Expects the version (in Major.Minor format, with any sub-minor removed)
# as the first and only argument
# If the version of Ubuntu is unsupported, it attempts to copy the binary
# and install the necessary dependencies explicitly.
do_ubuntu_install() {

  install_dependencies() {
    apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg
  }

  if is_arm ; then
    install_dependencies
    print_bindist_notice
    install_arm_binary
  elif is_aarch64 ; then
    install_dependencies
    print_bindist_notice
    install_aarch64_binary
  elif is_64_bit ; then
    install_dependencies
    print_bindist_notice
    install_64bit_standard_binary
  else
    install_dependencies
    print_bindist_notice
    install_32bit_standard_binary
  fi

}

# Attempts an install on Debian.
# Expects the single-number version as the first and only argument
# If the version of Debian is unsupported, it attempts to copy the binary
# and install the necessary dependencies explicitly.
do_debian_install() {

  install_dependencies() {
    apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg
  }

  if is_arm ; then
    install_dependencies
    print_bindist_notice
    install_arm_binary
  elif is_aarch64 ; then
    install_dependencies
    print_bindist_notice
    install_aarch64_binary
  elif is_64_bit ; then
    install_dependencies
    print_bindist_notice
    install_64bit_standard_binary
  else
    install_dependencies
    print_bindist_notice
    install_32bit_standard_binary
  fi
}

# Attempts an install on Fedora.
# Expects the single-number version as the first and only argument
# If the version of Fedora is unsupported, it attempts to copy the binary
# and install the necessary dependencies explicitly.
do_fedora_install() {
  install_dependencies() {
    dnf_install_pkgs perl make automake gcc gmp-devel libffi zlib-devel xz tar git gnupg
  }

  if is_64_bit ; then
    install_dependencies "$1"
    print_bindist_notice
    install_64bit_standard_binary
  else
    install_dependencies "$1"
    print_bindist_notice
    install_32bit_standard_binary
  fi
}

# Attempts an install on CentOS.
# Expects the single-number version as the first and only argument
# If the version of CentOS is unsupported, it attempts to copy the binary
# and install the necessary dependencies explicitly.
do_centos_install() {
  install_dependencies() {
    yum_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar git gnupg
  }

  if is_64_bit ; then
    install_dependencies
    print_bindist_notice
    install_64bit_standard_binary
  else
    case "$1" in
      "6"*)
        die "Sorry, there is currently no Linux 32-bit gmp4 binary available."
        ;;
      *)
        install_dependencies
        print_bindist_notice
        install_32bit_standard_binary
        ;;
    esac
  fi
}

# Attempts to install on macOS.
# If 'brew' exists, installs using Homebrew.  Otherwise, installs
# the generic bindist.
do_osx_install() {
  info "Using generic bindist..."
  info ""
  install_64bit_osx_binary
  info "NOTE: You may need to run 'xcode-select --install' to set"
  info "      up the Xcode command-line tools, which Stack uses."
  info ""
}

# Attempts to insall on FreeBSD.  Installs dependencies with
# 'pkg install' and then downloads bindist.
do_freebsd_install() {
  install_dependencies() {
    pkg_install_pkgs devel/gmake perl5 lang/gcc misc/compat8x misc/compat9x converters/libiconv ca_root_nss
  }
  if is_64_bit ; then
    install_dependencies
    install_64bit_freebsd_binary
  else
    die "Sorry, there is currently no 32-bit FreeBSD binary available."
  fi
}

# Alpine distro install
do_alpine_install() {
  install_dependencies() {
    apk_install_pkgs gmp libgcc xz make
  }
  install_dependencies
  if is_64_bit ; then
    print_bindist_notice
    install_64bit_standard_binary
  else
    die "Sorry, there is currently no 32-bit Alpine Linux binary available."
  fi
}

# Attempts to install on unsupported Linux distribution by downloading
# the bindist.
do_sloppy_install() {
  info "This installer doesn't support your Linux distribution, trying generic"
  info "bindist..."
  info ""

  if is_arm ; then
    install_arm_binary
  elif is_aarch64 ; then
    install_aarch64_binary
  elif is_64_bit ; then
    install_64bit_standard_binary
  else
    install_32bit_standard_binary
  fi
  info "Since this installer doesn't support your Linux distribution,"
  info "there is no guarantee that 'stack' will work at all!  You may"
  info "need to manually install some system info dependencies for GHC:"
  info "  gcc, make, libffi, zlib, libgmp and libtinfo"
  info "Please see http://docs.haskellstack.org/en/stable/install_and_upgrade/"
  info "Pull requests to add support for this distro would be welcome!"
  info ""
}

# Attempts to determine the running Linux distribution.
# Prints "DISTRO;VERSION" (distribution name and version)"."
distro_info() {
  parse_lsb() {
    lsb_release -a 2> /dev/null | perl -ne "$1"
  }

  try_lsb() {
    if has_lsb_release ; then
      TL_DIST="$(parse_lsb 'if(/Distributor ID:\s+([^ ]+)/) { print "\L$1"; }')"
      TL_VERSION="$(parse_lsb 'if(/Release:\s+([^ ]+)/) { print "\L$1"; }')"
      echo "$TL_DIST;$TL_VERSION"
    else
      return 1
    fi
  }

  try_release() {
    parse_release() {
      perl -ne "$1" /etc/*release 2>/dev/null
    }

    parse_release_id() {
      parse_release 'if(/^(DISTRIB_)?ID\s*=\s*"?([^"]+)/) { print "\L$2"; exit 0; }'
    }

    parse_release_version() {
      parse_release 'if(/^(DISTRIB_RELEASE|VERSION_ID)\s*=\s*"?([^"]+)/) { print $2; exit 0; }'
    }

    TR_RELEASE="$(parse_release_id);$(parse_release_version)"

    if [ ";" = "$TR_RELEASE" ] ; then
      if [ -e /etc/arch-release ] ; then
        # /etc/arch-release exists but is often empty
        echo "arch;"
      elif [ -e /etc/centos-release ] && grep -q "\<6\>" /etc/centos-release ; then
        # /etc/centos-release has a non-standard format before version 7
        echo "centos;6"
      else
        return 1
      fi
    else
      echo "$TR_RELEASE"
    fi
  }

  try_issue() {
    case "$(cat /etc/issue 2>/dev/null)" in
      "Arch Linux"*)
        echo "arch;" # n.b. Version is not available in /etc/issue on Arch
        ;;
      "Ubuntu"*)
        echo "ubuntu;$(perl -ne 'if(/Ubuntu (\d+\.\d+)/) { print $1; }' < /etc/issue)"
        ;;
      "Debian"*)
        echo "debian;$(perl -ne 'if(/Debian GNU\/Linux (\d+(\.\d+)?)/) { print $1; }' < /etc/issue)"
        ;;
      *"SUSE"*)
        echo "suse;$(perl -ne 'if(/SUSE\b.* (\d+\.\d+)/) { print $1; }' < /etc/issue)"
        ;;
      *"NixOS"*)
        echo "nixos;$(perl -ne 'if(/NixOS (\d+\.\d+)/) { print $1; }' < /etc/issue)"
        ;;
      "CentOS"*)
        echo "centos;$(perl -ne 'if(/^CentOS release (\d+)\./) { print $1; }' < /etc/issue)"
        ;;
      *)
    esac
    # others do not output useful info in issue, return empty
  }

  try_lsb || try_release || try_issue
}

# Attempt to install on a Linux distribution
do_distro() {
  if ! has_perl ; then
    if ! try_install_pkgs perl ; then
      #TODO: remove dependence on 'perl', which is not installed by default
      #on some distributions (Fedora and RHEL, in particular).
      die "This script requires 'perl', please install it to continue."
    fi
  fi

  IFS=";" read -r DISTRO VERSION <<GETDISTRO
$(distro_info)
GETDISTRO

  if [ -n "$DISTRO" ] ; then
    info "Detected Linux distribution: $DISTRO"
    info ""
  fi

  case "$DISTRO" in
    ubuntu|linuxmint|elementary|neon)
      do_ubuntu_install "$VERSION"
      ;;
    debian|kali|raspbian)
      do_debian_install "$VERSION"
      ;;
    fedora)
      do_fedora_install "$VERSION"
      ;;
    centos|rhel|redhatenterpriseserver)
      do_centos_install "$VERSION"
      ;;
    alpine)
      do_alpine_install "$VERSION"
      ;;
    *)
      do_sloppy_install
  esac
}

# Determine operating system and attempt to install.
do_os() {
  case "$(uname)" in
    "Linux")
      do_distro
      ;;
    "Darwin")
      do_osx_install
      ;;
    "FreeBSD")
      do_freebsd_install
      ;;
    *)
      die "Sorry, this installer does not support your operating system: $(uname).
See http://docs.haskellstack.org/en/stable/install_and_upgrade/"
  esac
}

# Download a URL to file using 'curl' or 'wget'.
dl_to_file() {
  if has_curl ; then
    if ! curl ${QUIET:+-sS} -L -o "$2" "$1"; then
      die "curl download failed: $1"
    fi
  elif has_wget ; then
    if ! wget ${QUIET:+-q} "-O$2" "$1"; then
      die "wget download failed: $1"
    fi
  else
    # should already have checked for this, otherwise this message will probably
    # not be displayed, since dl_to_stdout will be part of a pipeline
    die "Neither wget nor curl is available, please install one to continue."
  fi
}

# Check for 'curl' or 'wget' and attempt to install 'curl' if neither found,
# or fail the script if that is not possible.
check_dl_tools() {
  if ! has_curl && ! has_wget ; then
    if ! try_install_pkgs curl ; then
      die "Neither wget nor curl is available, please install one to continue."
    fi
  fi
}

# Download a Stack bindst and install it in /usr/local/bin/stack.
install_from_bindist() {
    IFB_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK_VERSION}/stack-${STACK_VERSION}-$1"
    check_dl_tools
    make_temp_dir

    dl_to_file "$IFB_URL" "$STACK_TEMP_DIR/$1.bindist"
    mkdir -p "$STACK_TEMP_DIR/$1"
    if ! tar xzf "$STACK_TEMP_DIR/$1.bindist" -C "$STACK_TEMP_DIR/$1"; then
      die "Extract bindist failed"
    fi
    STACK_TEMP_EXE="$STACK_TEMP_DIR/$(basename "$DEST")"
    mv "$STACK_TEMP_DIR/$1"/*/stack "$STACK_TEMP_EXE"
    destdir="$(dirname "$DEST")"
    if [ ! -d "$destdir" ]; then
        info "$destdir directory does not exist; creating it..."
        # First try to create directory as current user, then try with sudo if it fails.
        if ! mkdir -p "$destdir" 2>/dev/null; then
            if ! sudocmd mkdir -p "$destdir"; then
                die "Could not create directory: $DEST"
            fi
        fi
    fi
    # First attempt to install 'stack' as current user, then try with sudo if it fails
    info "Installing Stack to: $DEST..."
    if ! install -c -m 0755 "$STACK_TEMP_EXE" "$destdir" 2>/dev/null; then
      if ! sudocmd install -c -o 0 -g 0 -m 0755 "$STACK_TEMP_EXE" "$destdir"; then
        die "Install to $DEST failed"
      fi
    fi

    post_install_separator
    info "Stack has been installed to: $DEST"
    info ""

    check_dest_on_path
}

install_arm_binary() {
  install_from_bindist "linux-arm.tar.gz"
}

install_32bit_standard_binary() {
  install_from_bindist "linux-i386.tar.gz"
}

install_64bit_standard_binary() {
  install_from_bindist "linux-x86_64-static.tar.gz"
}

install_aarch64_binary() {
  install_from_bindist "linux-aarch64.tar.gz"
}

install_64bit_gmp4_linked_binary() {
  install_from_bindist "linux-x86_64-gmp4.tar.gz"
}

install_64bit_gmp4_linked_binary() {
  install_from_bindist "linux-x86_64-gmp4"
}

install_64bit_osx_binary() {
  install_from_bindist "osx-x86_64.tar.gz"
}

install_64bit_freebsd_binary() {
  install_from_bindist "freebsd-x86_64.tar.gz"
}

# Attempt to install packages using whichever of apt-get, dnf, yum, or apk is
# available.
try_install_pkgs() {
  if has_apt_get ; then
    apt_get_install_pkgs "$@"
  elif has_dnf ; then
    dnf_install_pkgs "$@"
  elif has_yum ; then
    yum_install_pkgs "$@"
  elif has_apk ; then
    apk_install_pkgs "$@"
  else
    return 1
  fi
}

# Install packages using apt-get
apt_get_install_pkgs() {
  if dpkg-query -W "$@" > /dev/null; then
    info "Already installed!"
  elif ! sudocmd apt-get install -y ${QUIET:+-qq} "$@"; then
    die "Installing apt packages failed.  Please run 'apt-get update' and try again."
  fi
}

# Install packages using dnf
dnf_install_pkgs() {
  if ! sudocmd dnf install -y ${QUIET:+-q} "$@"; then
    die "Installing dnf packages failed.  Please run 'dnf check-update' and try again."
  fi
}

# Install packages using yum
yum_install_pkgs() {
  if ! sudocmd yum install -y ${QUIET:+-q} "$@"; then
    die "Installing yum packages failed.  Please run 'yum check-update' and try again."
  fi
}

# Install packages using apk
apk_install_pkgs() {
  if ! sudocmd apk add --update ${QUIET:+-q} "$@"; then
    die "Installing apk packages failed.  Please run 'apk update' and try again."
  fi
}

# Install packages using pkg
pkg_install_pkgs() {
    if ! sudocmd pkg install -y "$@"; then
        die "Installing pkg packages failed.  Please run 'pkg update' and try again."
    fi
}

# Get installed Stack version, if any
stack_version() {
  stack --version | grep -o 'Version \([[:digit:]]\|\.\)\+'
}

# Get installed Stack's path
stack_location() {
  command -v stack
}

# Check whether 'stack' command exists
has_stack() {
  if [ "$DEST" != "" ] ; then
    has_cmd "$DEST"
  else
    has_cmd stack
  fi
}

# Check whether 'wget' command exists
has_wget() {
  has_cmd wget
}

# Check whether 'curl' command exists
has_curl() {
  has_cmd curl
}

# Check whether 'lsb_release' command exists
has_lsb_release() {
  has_cmd lsb_release
}

# Check whether 'sudo' command exists
has_sudo() {
  has_cmd sudo
}

# Check whether 'getconf' command exists
has_getconf() {
  has_cmd getconf
}

# Check whether 'brew' command exists
#has_brew() {
#  has_cmd brew
#}

# Check whether 'perl' command exists
has_perl() {
  has_cmd perl
}

# Check whether 'apt-get' command exists
has_apt_get() {
  has_cmd apt-get
}

# Check whether 'yum' command exists
has_yum() {
  has_cmd yum
}

# Check whether 'apk' command exists
has_apk() {
  has_cmd apk
}

# Check whether 'dnf' command exists
has_dnf() {
  has_cmd dnf
}

# Check whether the given command exists
has_cmd() {
  command -v "$1" > /dev/null 2>&1
}

# Check whether the given path is listed in the PATH environment variable
on_path() {
  echo ":$PATH:" | grep -q :"$1":
}

# Check whether ~/.local/bin is on the PATH, and print a warning if not.
check_home_local_bin_on_path() {
  if ! on_path "$HOME_LOCAL_BIN" ; then
    #TODO: offer to add it for the user (pull requests welcome!)
    info "WARNING: '$HOME_LOCAL_BIN' is not on your PATH."
    info "    For best results, please add it to the beginning of PATH in your profile."
    info ""
  fi
}

# Check whether $DEST is on the PATH, and print a warning if not.
check_dest_on_path() {
  if ! on_path "$(dirname $DEST)" ; then
    info "WARNING: '$(dirname $DEST)' is not on your PATH."
    info ""
  fi
}

# Check whether Stack is already installed, and print an error if it is.
check_stack_installed() {
  if has_stack ; then
    if [ "$FORCE" = "true" ] ; then
      [ "$DEST" != "" ] || DEST="$(stack_location)"
    else
      if has_curl; then
        get="curl -sSL"
      else
        get="wget -qO-"
      fi
      [ "$DEST" != "" ] && location=$(realpath "$DEST") || location=$(stack_location)
      die "Stack $(stack_version) already appears to be installed at:
  $location
Use 'stack upgrade' or your OS's package manager to upgrade,
or pass '-f' to this script to over-write the existing binary, e.g.:
  $get https://get.haskellstack.org/ | sh -s - -f"
    fi
  else
    [ "$DEST" != "" ] || DEST="$DEFAULT_DEST"
  fi
}

trap cleanup_temp_dir EXIT

while [ $# -gt 0 ]; do
  case "$1" in
    -q|--quiet)
      # This tries its best to reduce output by suppressing the script's own
      # messages and passing "quiet" arguments to tools that support them.
      QUIET="true"
      shift
      ;;
    -f|--force)
      FORCE="true"
      shift
      ;;
    -d|--dest)
      DEST="$2/stack"
      shift 2
      ;;
    *)
      echo "Invalid argument: $1" >&2
      exit 1
      ;;
  esac
done

check_stack_installed
do_os
check_home_local_bin_on_path


text:
**Implemented enhancements:**

- Add tsconfig.json [\#13](https://github.com/grtjn/marklogic-typescript-definitions/issues/13)
- Update NPM dependencies [\#12](https://github.com/grtjn/marklogic-typescript-definitions/issues/12)
- Use /v1/eval to run xslt [\#5](https://github.com/grtjn/marklogic-typescript-definitions/issues/5)
- Validate ts files with tsc [\#4](https://github.com/grtjn/marklogic-typescript-definitions/issues/4)
- Improve element/node data type representation [\#3](https://github.com/grtjn/marklogic-typescript-definitions/issues/3)
- Improve JS datatypes [\#1](https://github.com/grtjn/marklogic-typescript-definitions/issues/1)

**Fixed bugs:**

- Typescript validation too early [\#11](https://github.com/grtjn/marklogic-typescript-definitions/issues/11)
- Get rid of all validation errors [\#8](https://github.com/grtjn/marklogic-typescript-definitions/issues/8)

**Closed issues:**

- Add a Contributing.md [\#9](https://github.com/grtjn/marklogic-typescript-definitions/issues/9)
- Describe how to use this in editors/IDEs [\#7](https://github.com/grtjn/marklogic-typescript-definitions/issues/7)
- Publish to npm [\#6](https://github.com/grtjn/marklogic-typescript-definitions/issues/6)
- Document where to get the XML input [\#2](https://github.com/grtjn/marklogic-typescript-definitions/issues/2)

\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*


text:
<?php

require '../../source/bootstrap.inc.php';
$input = file_get_contents('php://input');

if (preg_match('/(\<\!DOCTYPE|\<\!ENTITY)/i', $input)) {
	exit('fail');
}
libxml_disable_entity_loader(true);
$obj = simplexml_load_string($input, 'SimpleXMLElement', LIBXML_NOCDATA);
if($obj instanceof SimpleXMLElement && !empty($obj->FeedBackId)) {
	$data = array(
		'appid' => trim($obj->AppId),
		'timestamp' => trim($obj->TimeStamp),
		'errortype' => trim($obj->ErrorType),
		'description' => trim($obj->Description),
		'alarmcontent' => trim($obj->AlarmContent),
		'appsignature' => trim($obj->AppSignature),
		'signmethod' => trim($obj->SignMethod),
	);
	require '../../framework/bootstrap.inc.php';
	WeUtility::logging('pay-warning', $input);
}
exit('success');


text:
package io.fixprotocol.silverflash.auth;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Simple local Directory
 * <p>
 * Implementation is thread-safe and serializable.
 *
 * @author Don Mendelson
 *
 */
public class SimpleDirectory implements Directory, Serializable {

  private static final long serialVersionUID = 3210975686696739965L;
  private final Map<String, Map<String, Object>> entries = new ConcurrentHashMap<>();

  public boolean add(String name) {
    return entries.putIfAbsent(name, Collections.synchronizedMap(new HashMap<>())) == null;
  }

  public boolean setProperty(String name, String property, Object value) {
    Map<String, Object> props = entries.get(name);
    if (props != null) {
      synchronized (props) {
        props.put(property, value);
      }
      return true;
    } else {
      return false;
    }
  }

  public boolean isPresent(String name) {
    return entries.containsKey(name);
  }

  public Object getProperty(String name, String property) {
    Map<String, Object> props = entries.get(name);
    if (props != null) {
      synchronized (props) {
        return props.get(property);
      }
    } else {
      return null;
    }
  }

}


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:layout_alignParentBottom="true"
    android:orientation="vertical">

    <!-- 普通底部导航 -->

    <LinearLayout
        android:id="@+id/main_bottom"
        android:layout_width="match_parent"
        android:layout_height="54dp"
        android:background="#ffffff"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <RelativeLayout
            android:id="@+id/ll_chat"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="onTabClicked"
            android:padding="3dp">

            <RelativeLayout
                android:layout_width="60dp"
                android:layout_height="match_parent"
                android:layout_centerHorizontal="true"
                android:gravity="center">

                <ImageButton
                    android:id="@+id/ib_chat"
                    android:layout_width="wrap_content"
                    android:layout_height="28dp"
                    android:layout_centerHorizontal="true"
                    android:background="#ffffff"
                    android:clickable="false"
                    android:focusable="false"
                    android:scaleType="centerInside"
                    android:src="@mipmap/weixin_pressed" />

                <TextView
                    android:id="@+id/tv_weixin"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/ib_chat"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="3dp"
                    android:text="撩妹"
                    android:textColor="#9A9A9A"
                    android:textSize="12sp" />
            </RelativeLayout>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/ll_address"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="onTabClicked"
            android:padding="3dp">

            <RelativeLayout
                android:layout_width="60dp"
                android:layout_height="match_parent"
                android:layout_centerHorizontal="true"
                android:gravity="center">

                <ImageButton
                    android:id="@+id/ib_address"
                    android:layout_width="wrap_content"
                    android:layout_height="28dp"
                    android:layout_centerHorizontal="true"
                    android:background="#ffffff"
                    android:clickable="false"
                    android:focusable="false"
                    android:scaleType="centerInside"
                    android:src="@mipmap/contact_list_normal" />

                <TextView
                    android:id="@+id/tv_contact_list"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/ib_address"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="3dp"
                    android:text="通讯录"
                    android:textColor="#9A9A9A"
                    android:textSize="12sp" />
            </RelativeLayout>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/ll_friends"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="onTabClicked"
            android:padding="3dp">

            <RelativeLayout
                android:layout_width="60dp"
                android:layout_height="match_parent"
                android:layout_centerHorizontal="true"
                android:gravity="center">

                <ImageButton
                    android:id="@+id/ib_friends"
                    android:layout_width="wrap_content"
                    android:layout_height="28dp"
                    android:layout_centerHorizontal="true"
                    android:background="#ffffff"
                    android:clickable="false"
                    android:focusable="false"
                    android:scaleType="centerInside"
                    android:src="@mipmap/find_normal" />

                <TextView
                    android:id="@+id/tv_find"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/ib_friends"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="3dp"
                    android:text="朋友圈"
                    android:textColor="#9A9A9A"
                    android:textSize="12sp" />

            </RelativeLayout>
        </RelativeLayout>

    </LinearLayout>

</LinearLayout>


text:
#!/usr/bin/env node
/**
 * Algorithm
 * [1] Look at all installed platforms
 * [2] Copy (non-destructive) icons and splash screens from platform to local RESOURCE_DIR
 * [3] Copy (destructive) matching icons and splash screens from RESOURCE_DIR to platform
 *
 * This ensures that local RESOURCE_DIR will be pre-scaffolded with icons and splash
 * screens generated by Cordova as placeholder ONLY for installed platforms and that
 * any modifications to local assets are reflected in the CORRECT Cordova platform
 * locations, without having to hardcode file paths.
 */
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var ncp = require('ncp');
var mkdirp = require('mkdirp');
var glob = require('glob');
var Orchestrator = require('orchestrator');

var BASES = {
  android: 'res',
  ios: 'DrugDoseFramework/Resources',
  browser: 'www/images'
};
var RESOURCE_DIR = 'resources';

// Helper function for file copying that ensures directory existence.
function copyFile (src, dest, ncpOpts, callback) {
  var orchestrator = new Orchestrator();
  var parts = dest.split(path.sep);
  var fileName = parts.pop();
  var destDir = parts.join(path.sep);
  var destFile = path.resolve(destDir, fileName);
  orchestrator.add('ensureDir', function (done) {
    mkdirp(destDir, function (err) {
      done(err);
    });
  });
  orchestrator.add('copyFile', ['ensureDir'], function (done) {
    ncp(src, destFile, ncpOpts, function (err) {
      done(err);
    });
  });
  orchestrator.start('copyFile', function (err) {
    callback(err);
  });
}

// Main
var platforms = _.filter(fs.readdirSync('platforms'), function (file) {
  return fs.statSync(path.resolve('platforms', file)).isDirectory();
});
_.each(platforms, function (platform) {
  var base = path.resolve('platforms', platform, BASES[platform]);
  glob(base + '/**/*.png', function (err, files) {
    _.each(files, function (cordovaFile) {
      var orchestrator = new Orchestrator();
      var parts = cordovaFile.split('/');
      var fileName = parts.pop();
      var localDir = path.resolve(RESOURCE_DIR, platform, _.last(parts));
      var localFile = path.resolve(localDir, fileName);

      orchestrator.add('copyFromCordova', function (done) {
        copyFile(cordovaFile, localFile, { clobber: false }, function (err) {
          done(err);
        });
      });
      orchestrator.add('copyToCordova', ['copyFromCordova'], function (done) {
        copyFile(localFile, cordovaFile, { clobber: true }, function (err) {
          done(err);
        });
      });
      orchestrator.start('copyToCordova', function (err) {
        if (err) { console.error(err); }
      });
    });
  });
});


text:
<?php

namespace Symfony\Component\Form\Extension\Core\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\ChoiceList\Loader\IntlCallbackChoiceLoader;
use Symfony\Component\Intl\Languages;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;

class LanguageType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'choice_loader' => function (Options $options) {
                $choiceTranslationLocale = $options['choice_translation_locale'];
                $alpha3 = $options['alpha3'];

                return new IntlCallbackChoiceLoader(function () use ($choiceTranslationLocale, $alpha3) {
                    return array_flip($alpha3 ? Languages::getAlpha3Names($choiceTranslationLocale) : Languages::getNames($choiceTranslationLocale));
                });
            },
            'choice_translation_domain' => false,
            'choice_translation_locale' => null,
            'alpha3' => false,
        ]);

        $resolver->setAllowedTypes('choice_translation_locale', ['null', 'string']);
        $resolver->setAllowedTypes('alpha3', 'bool');
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return __NAMESPACE__.'\ChoiceType';
    }

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return 'language';
    }
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports._containerInsert = _containerInsert;
exports._containerInsertAfter = _containerInsertAfter;
exports._containerInsertBefore = _containerInsertBefore;
exports._verifyNodeList = _verifyNodeList;
exports.hoist = hoist;
exports.insertAfter = insertAfter;
exports.insertBefore = insertBefore;
exports.pushContainer = pushContainer;
exports.unshiftContainer = unshiftContainer;
exports.updateSiblingKeys = updateSiblingKeys;

var _cache = require("../cache");

var _hoister = require("./lib/hoister");

var _index = require("./index");

var _t = require("@babel/types");

const {
  arrowFunctionExpression,
  assertExpression,
  assignmentExpression,
  blockStatement,
  callExpression,
  cloneNode,
  expressionStatement,
  isAssignmentExpression,
  isCallExpression,
  isExpression,
  isIdentifier,
  isSequenceExpression,
  isSuper,
  thisExpression
} = _t;

function insertBefore(nodes_) {
  this._assertUnremoved();

  const nodes = this._verifyNodeList(nodes_);

  const {
    parentPath
  } = this;

  if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
    return parentPath.insertBefore(nodes);
  } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
    if (this.node) nodes.push(this.node);
    return this.replaceExpressionWithStatements(nodes);
  } else if (Array.isArray(this.container)) {
    return this._containerInsertBefore(nodes);
  } else if (this.isStatementOrBlock()) {
    const node = this.node;
    const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
    this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
    return this.unshiftContainer("body", nodes);
  } else {
    throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
  }
}

function _containerInsert(from, nodes) {
  this.updateSiblingKeys(from, nodes.length);
  const paths = [];
  this.container.splice(from, 0, ...nodes);

  for (let i = 0; i < nodes.length; i++) {
    const to = from + i;
    const path = this.getSibling(to);
    paths.push(path);

    if (this.context && this.context.queue) {
      path.pushContext(this.context);
    }
  }

  const contexts = this._getQueueContexts();

  for (const path of paths) {
    path.setScope();
    path.debug("Inserted.");

    for (const context of contexts) {
      context.maybeQueue(path, true);
    }
  }

  return paths;
}

function _containerInsertBefore(nodes) {
  return this._containerInsert(this.key, nodes);
}

function _containerInsertAfter(nodes) {
  return this._containerInsert(this.key + 1, nodes);
}

const last = arr => arr[arr.length - 1];

function isHiddenInSequenceExpression(path) {
  return isSequenceExpression(path.parent) && (last(path.parent.expressions) !== path.node || isHiddenInSequenceExpression(path.parentPath));
}

function isAlmostConstantAssignment(node, scope) {
  if (!isAssignmentExpression(node) || !isIdentifier(node.left)) {
    return false;
  }

  const blockScope = scope.getBlockParent();
  return blockScope.hasOwnBinding(node.left.name) && blockScope.getOwnBinding(node.left.name).constantViolations.length <= 1;
}

function insertAfter(nodes_) {
  this._assertUnremoved();

  if (this.isSequenceExpression()) {
    return last(this.get("expressions")).insertAfter(nodes_);
  }

  const nodes = this._verifyNodeList(nodes_);

  const {
    parentPath
  } = this;

  if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
    return parentPath.insertAfter(nodes.map(node => {
      return isExpression(node) ? expressionStatement(node) : node;
    }));
  } else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
    if (this.node) {
      const node = this.node;
      let {
        scope
      } = this;

      if (scope.path.isPattern()) {
        assertExpression(node);
        this.replaceWith(callExpression(arrowFunctionExpression([], node), []));
        this.get("callee.body").insertAfter(nodes);
        return [this];
      }

      if (isHiddenInSequenceExpression(this)) {
        nodes.unshift(node);
      } else if (isCallExpression(node) && isSuper(node.callee)) {
        nodes.unshift(node);
        nodes.push(thisExpression());
      } else if (isAlmostConstantAssignment(node, scope)) {
        nodes.unshift(node);
        nodes.push(cloneNode(node.left));
      } else if (scope.isPure(node, true)) {
        nodes.push(node);
      } else {
        if (parentPath.isMethod({
          computed: true,
          key: node
        })) {
          scope = scope.parent;
        }

        const temp = scope.generateDeclaredUidIdentifier();
        nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node)));
        nodes.push(expressionStatement(cloneNode(temp)));
      }
    }

    return this.replaceExpressionWithStatements(nodes);
  } else if (Array.isArray(this.container)) {
    return this._containerInsertAfter(nodes);
  } else if (this.isStatementOrBlock()) {
    const node = this.node;
    const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null);
    this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : []));
    return this.pushContainer("body", nodes);
  } else {
    throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
  }
}

function updateSiblingKeys(fromIndex, incrementBy) {
  if (!this.parent) return;

  const paths = _cache.path.get(this.parent);

  for (const [, path] of paths) {
    if (path.key >= fromIndex) {
      path.key += incrementBy;
    }
  }
}

function _verifyNodeList(nodes) {
  if (!nodes) {
    return [];
  }

  if (!Array.isArray(nodes)) {
    nodes = [nodes];
  }

  for (let i = 0; i < nodes.length; i++) {
    const node = nodes[i];
    let msg;

    if (!node) {
      msg = "has falsy node";
    } else if (typeof node !== "object") {
      msg = "contains a non-object node";
    } else if (!node.type) {
      msg = "without a type";
    } else if (node instanceof _index.default) {
      msg = "has a NodePath when it expected a raw object";
    }

    if (msg) {
      const type = Array.isArray(node) ? "array" : typeof node;
      throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`);
    }
  }

  return nodes;
}

function unshiftContainer(listKey, nodes) {
  this._assertUnremoved();

  nodes = this._verifyNodeList(nodes);

  const path = _index.default.get({
    parentPath: this,
    parent: this.node,
    container: this.node[listKey],
    listKey,
    key: 0
  }).setContext(this.context);

  return path._containerInsertBefore(nodes);
}

function pushContainer(listKey, nodes) {
  this._assertUnremoved();

  const verifiedNodes = this._verifyNodeList(nodes);

  const container = this.node[listKey];

  const path = _index.default.get({
    parentPath: this,
    parent: this.node,
    container: container,
    listKey,
    key: container.length
  }).setContext(this.context);

  return path.replaceWithMultiple(verifiedNodes);
}

function hoist(scope = this.scope) {
  const hoister = new _hoister.default(this, scope);
  return hoister.run();
}


text:
//Write a program that gets two numbers from the console and prints the greater of them. Don't use if statements.

using System;

class GreaterNumber
{
    static void Main()
    {
        Console.WriteLine("Please, type 2 numbers: ");
        int n1= int.Parse(Console.ReadLine());
        int n2 = int.Parse(Console.ReadLine());
        Console.WriteLine("The greater number is {0}", Math.Max(n1,n2));
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a sample xml file. This file should be modified with proper data elements -->
<!-- before using. -->
<studies xmlns="gme://ccts.cabig/1.0/gov.nih.nci.cabig.ccts.domain">
	<study>
		<blindedIndicator>false</blindedIndicator>
		<multiInstitutionIndicator>true</multiInstitutionIndicator>
		<randomizedIndicator>true</randomizedIndicator>
		<randomizationType>BOOK</randomizationType>
		<stratificationIndicator>true</stratificationIndicator>
		<standaloneIndicator>true</standaloneIndicator>
		<companionIndicator>false</companionIndicator>
		<shortTitleText>ShortTitleText1</shortTitleText>
		<longTitleText>LongTitleText1</longTitleText>
		<descriptionText>Description Text</descriptionText>
		<precisText>Study with randomization</precisText>
		<phaseCode>Phase I Trial</phaseCode>
		<coordinatingCenterStudyStatus>OPEN</coordinatingCenterStudyStatus>
		<type>Diagnostic</type>
		<targetAccrualNumber>150</targetAccrualNumber>
		<identifier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xsi:type="OrganizationAssignedIdentifierType">
			<value>cocenter id</value>
			<primaryIndicator>false</primaryIndicator>
			<healthcareSite xsi:type="LocalHealthcareSiteType">
				<address/>
				<identifier xsi:type="OrganizationAssignedIdentifierType">
					<value>site_ctep_id</value>
					<primaryIndicator>true</primaryIndicator>
					<type>CTEP</type>
				</identifier>
			</healthcareSite>
			<type>COORDINATING_CENTER_IDENTIFIER</type>
		</identifier>
		<identifier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xsi:type="OrganizationAssignedIdentifierType">
			<value>funding sponsor id</value>
			<primaryIndicator>false</primaryIndicator>
			<healthcareSite xsi:type="LocalHealthcareSiteType">
				<address/>
				<identifier xsi:type="OrganizationAssignedIdentifierType">
					<value>site_ctep_id</value>
					<primaryIndicator>true</primaryIndicator>
					<type>CTEP</type>
				</identifier>
			</healthcareSite>
			<type>PROTOCOL_AUTHORITY_IDENTIFIER</type>
		</identifier>
		<epoch gridId="grid">
			<name>epoch 1</name>
			<epochOrder>1</epochOrder>
			<descriptionText>DescriptionText</descriptionText>
			<accrualCeiling>10</accrualCeiling>
			<stratificationIndicator>true</stratificationIndicator>
			<randomizedIndicator>true</randomizedIndicator>
			<type>TREATMENT</type>
			<enrollmentIndicator>true</enrollmentIndicator>
			<arm gridId="grid1">
				<name>arm 1</name>
				<descriptionText>DescriptionText1</descriptionText>
				<targetAccrualNumber>20</targetAccrualNumber>
			</arm>
			<arm gridId="grid2">
				<name>arm 2</name>
				<descriptionText>DescriptionText2</descriptionText>
				<targetAccrualNumber>30</targetAccrualNumber>
			</arm>
			<eligibilityCriteria xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				gridId="gridid" xsi:type="InclusionEligibilityCriteriaType">
				<notApplicableIndicator>true</notApplicableIndicator>
				<questionNumber>1</questionNumber>
				<questionText>inc1</questionText>
			</eligibilityCriteria>
			<eligibilityCriteria xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				gridId="gridid" xsi:type="ExclusionEligibilityCriteriaType">
				<questionNumber>1</questionNumber>
				<questionText>exc1</questionText>
			</eligibilityCriteria>
			<stratificationCriteria>
				<questionNumber>1</questionNumber>
				<questionText>q1</questionText>
				<permissibleAnswer>
					<answerText>ans1</answerText>
				</permissibleAnswer>
				<permissibleAnswer>
					<answerText>ans2</answerText>
				</permissibleAnswer>
				<permissibleAnswer>
					<answerText>ans3</answerText>
				</permissibleAnswer>
			</stratificationCriteria>
			<stratificationCriteria>
				<questionNumber>0</questionNumber>
				<questionText>q2</questionText>
				<permissibleAnswer>
					<answerText>ans1</answerText>
				</permissibleAnswer>
				<permissibleAnswer>
					<answerText>ans2</answerText>
				</permissibleAnswer>
				<permissibleAnswer>
					<answerText>ans3</answerText>
				</permissibleAnswer>
			</stratificationCriteria>
			<randomization>
				<type>BOOK</type>
			</randomization>
		</epoch>
		<studyOrganization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gridId="co center"
			xsi:type="StudyCoordinatingCenterType">
			<healthcareSite xsi:type="LocalHealthcareSiteType">
				<address/>
				<identifier xsi:type="OrganizationAssignedIdentifierType">
					<value>site_ctep_id</value>
					<primaryIndicator>true</primaryIndicator>
					<type>CTEP</type>
				</identifier>
			</healthcareSite>
			<studyInvestigator>
				<roleCode>Principal Investigator</roleCode>
				<healthcareSiteInvestigator>
					<investigator xsi:type="LocalInvestigatorType">
						<assignedIdentifier>ctep_assigned_id</assignedIdentifier>
						<firstName>first</firstName>
						<lastName>last</lastName>
						<email>abc@xyz.com</email>
						<phoneNumber>1112223333</phoneNumber>
						<faxNumber>1112223333</faxNumber>
					</investigator>
				</healthcareSiteInvestigator>
			</studyInvestigator>
			<studyInvestigator>
				<roleCode>Site Investigator</roleCode>
				<healthcareSiteInvestigator>
					<investigator xsi:type="RemoteInvestigatorType">
						<assignedIdentifier>remote_ctep_assigned_id</assignedIdentifier>
						<firstName>first</firstName>
						<lastName>last</lastName>
						<email>abc@xyz.com</email>
						<phoneNumber>1112223333</phoneNumber>
						<faxNumber>1112223333</faxNumber>
						<externalId>external_id</externalId>
					</investigator>
				</healthcareSiteInvestigator>
			</studyInvestigator>
		</studyOrganization>
		<studyOrganization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			gridId="funding sponsor" xsi:type="StudyFundingSponsorType">
			<healthcareSite xsi:type="LocalHealthcareSiteType">
				<address/>
				<identifier xsi:type="OrganizationAssignedIdentifierType">
					<value>site_ctep_id</value>
					<primaryIndicator>true</primaryIndicator>
					<type>CTEP</type>
				</identifier>
			</healthcareSite>
		</studyOrganization>
		<studyOrganization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xsi:type="StudySiteType">
			<healthcareSite xsi:type="LocalHealthcareSiteType">
				<address/>
				<identifier xsi:type="OrganizationAssignedIdentifierType">
					<value>site_ctep_id</value>
					<primaryIndicator>true</primaryIndicator>
					<type>CTEP</type>
				</identifier>
			</healthcareSite>
			<siteStudyStatus>PENDING</siteStudyStatus>
			<irbApprovalDate>2009-09-17</irbApprovalDate>
		</studyOrganization>
		<studyOrganization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xsi:type="StudySiteType">
			<healthcareSite xsi:type="RemoteHealthcareSiteType">
				<address/>
				<identifier xsi:type="OrganizationAssignedIdentifierType">
					<value>remote_ctep_id</value>
					<primaryIndicator>true</primaryIndicator>
					<type>CTEP</type>
				</identifier>
				<externalId>external_id</externalId>
			</healthcareSite>
			<siteStudyStatus>PENDING</siteStudyStatus>
			<irbApprovalDate>2009-09-17</irbApprovalDate>
		</studyOrganization>
		<consent>
			<name>Male</name>
		</consent>
		<consent>
			<name>Female</name>
		</consent>
	</study>
</studies>


text:
#include <aws/ec2/model/CancelledSpotInstanceRequest.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

namespace Aws
{
namespace EC2
{
namespace Model
{

CancelledSpotInstanceRequest::CancelledSpotInstanceRequest() :
    m_spotInstanceRequestIdHasBeenSet(false),
    m_state(CancelSpotInstanceRequestState::NOT_SET),
    m_stateHasBeenSet(false)
{
}

CancelledSpotInstanceRequest::CancelledSpotInstanceRequest(const XmlNode& xmlNode) :
    m_spotInstanceRequestIdHasBeenSet(false),
    m_state(CancelSpotInstanceRequestState::NOT_SET),
    m_stateHasBeenSet(false)
{
  *this = xmlNode;
}

CancelledSpotInstanceRequest& CancelledSpotInstanceRequest::operator =(const XmlNode& xmlNode)
{
  XmlNode resultNode = xmlNode;

  if(!resultNode.IsNull())
  {
    XmlNode spotInstanceRequestIdNode = resultNode.FirstChild("spotInstanceRequestId");
    if(!spotInstanceRequestIdNode.IsNull())
    {
      m_spotInstanceRequestId = Aws::Utils::Xml::DecodeEscapedXmlText(spotInstanceRequestIdNode.GetText());
      m_spotInstanceRequestIdHasBeenSet = true;
    }
    XmlNode stateNode = resultNode.FirstChild("state");
    if(!stateNode.IsNull())
    {
      m_state = CancelSpotInstanceRequestStateMapper::GetCancelSpotInstanceRequestStateForName(StringUtils::Trim(Aws::Utils::Xml::DecodeEscapedXmlText(stateNode.GetText()).c_str()).c_str());
      m_stateHasBeenSet = true;
    }
  }

  return *this;
}

void CancelledSpotInstanceRequest::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
  if(m_spotInstanceRequestIdHasBeenSet)
  {
      oStream << location << index << locationValue << ".SpotInstanceRequestId=" << StringUtils::URLEncode(m_spotInstanceRequestId.c_str()) << "&";
  }

  if(m_stateHasBeenSet)
  {
      oStream << location << index << locationValue << ".State=" << CancelSpotInstanceRequestStateMapper::GetNameForCancelSpotInstanceRequestState(m_state) << "&";
  }

}

void CancelledSpotInstanceRequest::OutputToStream(Aws::OStream& oStream, const char* location) const
{
  if(m_spotInstanceRequestIdHasBeenSet)
  {
      oStream << location << ".SpotInstanceRequestId=" << StringUtils::URLEncode(m_spotInstanceRequestId.c_str()) << "&";
  }
  if(m_stateHasBeenSet)
  {
      oStream << location << ".State=" << CancelSpotInstanceRequestStateMapper::GetNameForCancelSpotInstanceRequestState(m_state) << "&";
  }
}

} // namespace Model
} // namespace EC2
} // namespace Aws


text:
package org.ihtsdo.otf.security.dto.customfieldmodels;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import java.util.logging.Logger;

import org.ihtsdo.otf.security.dto.OtfBasicWeb;
import org.ihtsdo.otf.security.dto.OtfCustomField;

public abstract class OtfCustomFieldModel {

	/**
	 * <p>
	 * logger.
	 * </p>
	 */
	private static final Logger LOG = Logger
			.getLogger(OtfCustomFieldModel.class.getName());

	protected String[] vals;
	protected String key;
	protected OtfCustomField.CustomType type;
	private OtfBasicWeb obw;
	public static final String SEP = "-xxx-";
	public static final String NEW_FORM_URL = "newForm/";

	public OtfCustomFieldModel() {
		super();
	}

	public OtfCustomFieldModel(final String keyIn, final String[] valsIn) {
		super();
		setKey(keyIn);
		setVals(valsIn);
		if (vals != null) {
			modelFromVals();
		}
		if (vals == null) {
			model2Vals();
		}

	}

	public abstract void model2Vals();

	public abstract void modelFromVals();

	public abstract void valFromParamDTO(OtfCustomFieldParamDTO ocfp);

	public abstract String getCollectionTitle();

	public abstract String getNewTitle();

	public abstract Map<String, String> getLabelValuesMap();

	public abstract OtfCustomField.CustomType getType();

	public abstract String getNewFormURLWithContext();

	public final String[] getVals() {
		if (vals == null || vals.length == 0) {
			model2Vals();
		}
		return vals;
	}

	public final void setVals(final String[] valsIn) {
		vals = valsIn;
	}

	@Override
	public final String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Cust FieldModel Key = ").append(getKey()).append("\n");
		for (int i = 0; i <= getVals().length - 1; i++) {
			sb.append(i).append(" : ").append(vals[i]).append("\n");
		}
		return sb.toString();
	}

	public final OtfBasicWeb getObw() {
		if (obw == null) {
			obw = new OtfBasicWeb();
		}
		return obw;
	}

	public final String getKey() {
		if (key == null) {
			key = "";
		}
		return key;
	}

	public final void setKey(String keyIn) {
		key = keyIn;
	}

	public Map<String, String> getStdLabelValuesMap() {
		return new LinkedHashMap<String, String>();
	}

	public static final boolean stringOK(final String toCheck) {
		return toCheck != null && toCheck.length() > 0;
	}

	public String getNewFormId() {
		StringBuilder sbuild = new StringBuilder();
		sbuild.append(getClass().getName()).append(".newForm");
		return sbuild.toString();
	}

	public String getNewFormURL() {
		StringBuilder sbuild = new StringBuilder();
		sbuild.append(NEW_FORM_URL).append(getType().name());
		return sbuild.toString();
	}

	public final String getUniqueControlName(final String controlName,
			final String idIn) {
		String id = idIn;
		if (!stringOK(id)) {
			id = getId();
		}
		return new StringBuilder().append(getType()).append(SEP)
				.append(controlName).append(SEP).append(id).toString();
	}

	public final String getId() {
		String id = getKey();
		if (!stringOK(id)) {
			id = UUID.randomUUID().toString();
		}
		return id;
	}

}


text:
class Birling
  # == Submodules ===========================================================

  autoload(:Formatter, 'birling/formatter')
  autoload(:Logger, 'birling/logger')
  autoload(:Support, 'birling/support')

  # == Module Methods =======================================================

  # Opens a new log file at the given path with options:
  # * encoding: The encoding of the file (default: 'UTF8')
  # * period: The rotation period to use (optional)
  # * retain_count: How many log files to retain when rotating (optional)
  # * retain_period: How long rotated log files are retained for (optional)
  # * formatter: Custom log formatter (optional)
  # * program: Name of program being logged (optional)
  # * time_source: Source of time to use (optional)
  # * path_format: The strftime-compatible format for the path (optional)
  def self.open(path, options = nil)
    Birling::Logger.new(path, options)
  end
end


text:
package org.apache.geode.test.dunit.internal;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

import org.apache.geode.SystemFailure;

/**
 * A class specialized for invoking methods via reflection.
 */
class MethodInvoker {

  /**
   * Invoke the method "methodName" on the class named "target". Return the result, including stack
   * trace (if any).
   */
  static MethodInvokerResult execute(String target, String methodName) {
    return execute(target, methodName, null);
  }

  /**
   * Executes the given static method on the given class with the given parameters.
   */
  static MethodInvokerResult execute(String target, String methodName, Object[] parameters) {
    try {
      // get the class
      Class targetClass = Class.forName(target);

      // invoke the method
      try {
        Class[] paramTypes;
        if (parameters == null) {
          paramTypes = new Class[0];

        } else {
          paramTypes = new Class[parameters.length];
          for (int i = 0; i < parameters.length; i++) {
            if (parameters[i] == null) {
              paramTypes[i] = null;

            } else {
              paramTypes[i] = parameters[i].getClass();
            }
          }
        }

        Method method = getMethod(targetClass, methodName, paramTypes);
        method.setAccessible(true);
        Object result = method.invoke(targetClass, parameters);
        return new MethodInvokerResult(result);

      } catch (InvocationTargetException e) {
        Throwable targetException = e.getTargetException();
        if (targetException == null) {
          return new MethodInvokerResult(null);

        } else {
          return new MethodInvokerResult(targetException);
        }
      }

    } catch (VirtualMachineError e) {
      SystemFailure.initiateFailure(e);
      throw e;

    } catch (Throwable t) {
      return new MethodInvokerResult(t);
    }
  }

  /**
   * Send the message "methodName" to the object "target". Return the result, including stack trace
   * (if any).
   */
  static MethodInvokerResult executeObject(Object target, String methodName) {
    return executeObject(target, methodName, null);
  }

  /**
   * Executes the given instance method on the given object with the given arguments.
   */
  static MethodInvokerResult executeObject(Object target, String methodName, Object[] arguments) {
    try {
      // get the class
      Class receiverClass = target.getClass();

      // invoke the method
      try {
        Class[] paramTypes;
        if (arguments == null) {
          paramTypes = new Class[0];

        } else {
          paramTypes = new Class[arguments.length];
          for (int i = 0; i < arguments.length; i++) {
            if (arguments[i] == null) {
              paramTypes[i] = Object.class;

            } else {
              paramTypes[i] = arguments[i].getClass();
            }
          }
        }

        Method method = getMethod(receiverClass, methodName, paramTypes);
        method.setAccessible(true);
        Object result = method.invoke(target, arguments);
        return new MethodInvokerResult(result);

      } catch (InvocationTargetException e) {
        Throwable targetException = e.getTargetException();
        if (targetException == null) {
          return new MethodInvokerResult(null);

        } else {
          return new MethodInvokerResult(targetException);
        }
      }

    } catch (VirtualMachineError e) {
      SystemFailure.initiateFailure(e);
      throw e;

    } catch (Throwable t) {
      return new MethodInvokerResult(t);
    }
  }

  /**
   * Helper method that searches a class (and its superclasses) for a method with the given name and
   * parameter types.
   *
   * @throws NoSuchMethodException If the method cannot be found
   */
  private static Method getMethod(Class targetClass, String methodName, Class[] parameterTypes)
      throws NoSuchMethodException {
    List<Method> matchingMethods = new ArrayList<>();
    for (Class theClass = targetClass; theClass != null; theClass = theClass.getSuperclass()) {
      Method[] methods = theClass.getDeclaredMethods();

      NEXT_METHOD:

      for (Method method : methods) {
        if (!method.getName().equals(methodName)) {
          continue;
        }

        Class[] methodParameterTypes = method.getParameterTypes();
        if (methodParameterTypes.length != parameterTypes.length) {
          continue;
        }

        for (int j = 0; j < methodParameterTypes.length; j++) {
          if (parameterTypes[j] == null) {
            if (methodParameterTypes[j].isPrimitive()) {
              // this parameter is not ok, the parameter is a primitive and the value is null
              continue NEXT_METHOD;
            } else {
              // this parameter is ok, the argument is an object and the value is null
              continue;
            }
          }
          if (!methodParameterTypes[j].isAssignableFrom(parameterTypes[j])) {
            Class methodParameterType = methodParameterTypes[j];
            Class parameterType = parameterTypes[j];

            if (methodParameterType.isPrimitive()) {
              if (methodParameterType.equals(boolean.class) && parameterType.equals(Boolean.class)
                  || methodParameterType.equals(short.class) && parameterType.equals(Short.class)
                  || methodParameterType.equals(int.class) && parameterType.equals(Integer.class)
                  || methodParameterType.equals(long.class) && parameterType.equals(Long.class)
                  || methodParameterType.equals(float.class) && parameterType.equals(Float.class)
                  || methodParameterType.equals(double.class) && parameterType.equals(Double.class)
                  || methodParameterType.equals(char.class) && parameterType.equals(Character.class)
                  || methodParameterType.equals(byte.class) && parameterType.equals(Byte.class)) {

                // This parameter is okay, try the next one
                continue;
              }
            }
            continue NEXT_METHOD;
          }
        }

        matchingMethods.add(method);
      }

      // We want to check to make sure there aren't two
      // ambiguous methods on the same class. But a subclass
      // can still override a method on a super class, so we'll stop
      // if we found a method on the subclass.
      if (matchingMethods.size() > 0) {
        break;
      }
    }

    if (matchingMethods.isEmpty()) {
      StringBuilder sb = new StringBuilder();
      sb.append("Could not find method ");
      sb.append(methodName);
      sb.append(" with ");
      sb.append(parameterTypes.length);
      sb.append(" parameters [");
      for (int i = 0; i < parameterTypes.length; i++) {
        String name = parameterTypes[i] == null ? null : parameterTypes[i].getName();
        sb.append(name);
        if (i < parameterTypes.length - 1) {
          sb.append(", ");
        }
      }
      sb.append("] in class ");
      sb.append(targetClass.getName());
      throw new NoSuchMethodException(sb.toString());
    }

    if (matchingMethods.size() > 1) {
      StringBuilder sb = new StringBuilder();
      sb.append("Method is ambiguous ");
      sb.append(methodName);
      sb.append(" with ");
      sb.append(parameterTypes.length);
      sb.append(" parameters [");
      for (int i = 0; i < parameterTypes.length; i++) {
        String name = parameterTypes[i] == null ? null : parameterTypes[i].getName();
        sb.append(name);
        if (i < parameterTypes.length - 1) {
          sb.append(", ");
        }
      }
      sb.append("] in class ");
      sb.append(targetClass.getName());
      sb.append(" methods=").append(matchingMethods);
      throw new NoSuchMethodException(sb.toString());

    } else {
      return matchingMethods.get(0);
    }
  }
}


text:
/**
 * @description
 * Asynchronous Http and WebSocket Client library for Java
 *
 * @author
 * @windard
 *
 * for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
 */

'use strict'

var CodeBuilder = require('../../helpers/code-builder')

module.exports = function (source, options) {
  var opts = Object.assign({
    indent: '  '
  }, options)

  var code = new CodeBuilder(opts.indent)

  code.push('AsyncHttpClient client = new DefaultAsyncHttpClient();')

  code.push(`client.prepare("${source.method.toUpperCase()}", "${source.fullUrl}")`)

  // Add headers, including the cookies
  var headers = Object.keys(source.allHeaders)

  // construct headers
  if (headers.length) {
    headers.forEach(function (key) {
      code.push(1, '.setHeader("%s", "%s")', key, source.allHeaders[key])
    })
  }

  if (source.postData.text) {
    code.push(1, '.setBody(%s)', JSON.stringify(source.postData.text))
  }

  code.push(1, '.execute()')
  code.push(1, '.toCompletableFuture()')
  code.push(1, '.thenAccept(System.out::println)')
  code.push(1, '.join();')
  code.blank()
  code.push('client.close();')

  return code.join()
}

module.exports.info = {
  key: 'asynchttp',
  title: 'AsyncHttp',
  link: 'https://github.com/AsyncHttpClient/async-http-client',
  description: 'Asynchronous Http and WebSocket Client library for Java'
}


text:
namespace dawn {

class StencilInstantiation;

/// @brief Abstract base class of all optimization and analyzer passes
///
/// To create a new Pass proceed as follows:
///
///   1) Inherit from `Pass` and implement the Pass::run method. Remeber to return `true`
///      on success!
///   2) Register your new Pass in the DAWNCompiler::compile method in DAWNCompiler.cpp at the
///      position you would like it run.
///
/// @ingroup Optimizer
class Pass {
  /// Name of the pass (should be unique)
  std::string name_;

protected:
  /// Name of the passes this pass depends on (empty implies no dependency)
  std::vector<std::string> dependencies_;
  /// Categroy of the pass
  const bool isDebug_;

public:
  Pass(const std::string& name) : Pass(name, false) {}
  Pass(const std::string& name, bool isDebug) : name_(name), isDebug_(isDebug) {}
  virtual ~Pass() {}

  /// @brief Run the the Pass
  /// @returns `true` on success, `false` otherwise
  virtual bool run(const std::shared_ptr<StencilInstantiation>& stencilInstantiation) = 0;

  /// @brief Get the name of the Pass
  const std::string& getName() const { return name_; }

  /// @brief Get the dependencies of this pass
  std::vector<std::string> getDependencies() const { return dependencies_; }

  bool isDebug() const { return isDebug_; }
};

} // namespace dawn

#endif