text:
(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define([undefined, '../ApiClient'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(undefined, require('../ApiClient'));
  } else {
    // Browser globals (root is window)
    if (!root.RedfishV100) {
      root.RedfishV100 = {};
    }
    factory(root.RedfishV100, root.RedfishV100.ApiClient);
  }
}(this, function(module, ApiClient) {
  'use strict';

  /**
   * Uniquely identifies the resource within the collection of like resources.
   **/
  var ResourceId = function ResourceId() {

  };

  ResourceId.prototype.constructFromObject = function(data) {
    if (!data) {
      return this;
    }

    return this;
  }

  ResourceId.prototype.toJson = function() {
    return JSON.stringify(this);
  }

  if (module) {
    module.ResourceId = ResourceId;
  }

  return ResourceId;

}));


text:
using System;
using System.Collections.Generic;

namespace Timesheets.Data.Model
{
    public class Timesheet
    {
        public int ID { get; set; }

        public string Name { get; set; }

        public string Customer { get; set; }

        public string Employee { get; set; }

        public DateTime PeriodStarts { get; set; }

        public DateTime PeriodEnds { get; set; }

        public ICollection<TimesheetEntry> Entries { get; set; }

        public Timesheet()
        {
            this.Entries = new List<TimesheetEntry>();
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.jbpm.process.instance.context.exception;

import org.drools.core.spi.ProcessContext;
import org.jbpm.process.core.context.exception.ActionExceptionHandler;
import org.jbpm.process.core.context.exception.ExceptionHandler;
import org.jbpm.process.core.context.exception.ExceptionScope;
import org.jbpm.process.instance.ContextInstanceContainer;
import org.jbpm.process.instance.ProcessInstance;
import org.jbpm.process.instance.impl.Action;
import org.jbpm.workflow.instance.NodeInstance;

public class DefaultExceptionScopeInstance extends ExceptionScopeInstance {

	private static final long serialVersionUID = 510l;

    public String getContextType() {
        return ExceptionScope.EXCEPTION_SCOPE;
    }

	public void handleException(ExceptionHandler handler, String exception, Object params) {

		if (handler instanceof ActionExceptionHandler) {
		    ActionExceptionHandler exceptionHandler = (ActionExceptionHandler) handler;
			Action action = (Action) exceptionHandler.getAction().getMetaData("Action");
			try {
		    	ProcessInstance processInstance = getProcessInstance();
			    ProcessContext processContext = new ProcessContext(processInstance.getKnowledgeRuntime());
			    ContextInstanceContainer contextInstanceContainer = getContextInstanceContainer();
			    if (contextInstanceContainer instanceof NodeInstance) {
			    	processContext.setNodeInstance((NodeInstance) contextInstanceContainer);
			    } else {
			    	processContext.setProcessInstance(processInstance);
			    }
			    String faultVariable = exceptionHandler.getFaultVariable();
			    if (faultVariable != null) {
			    	processContext.setVariable(faultVariable, params);
			    }
		        action.execute(processContext);
			} catch (Exception e) {
			    throw new RuntimeException("unable to execute Action", e);
			}
		} else {
			throw new IllegalArgumentException("Unknown exception handler " + handler);
		}
	}

}


text:
namespace Nettiers.AdventureWorks.Windows.Forms
{
	/// <summary>
	/// abstract ProductCostHistory typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ProductCostHistoryDataGridViewBase : System.Windows.Forms.UserControl
	{
		/// <summary>
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ProductCostHistoryDataGridViewEventArgs> CurrentEntityChanged;

		#region Fields

		/// <summary>
		/// the current entity.
		/// </summary>
		private Entities.ProductCostHistory _currentProductCostHistory = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();

		/// <summary>
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxProductCostHistoryDataGridView;

		/// <summary>
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxProductCostHistoryErrorProvider;

		/// <summary>
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxProductCostHistoryBindingSource;

		/// <summary>
		/// the DGV column associated with the ProductId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxProductIdDataGridViewColumn;

		/// <summary>
		/// the DGV column associated with the StartDate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStartDateDataGridViewColumn;

		/// <summary>
		/// the DGV column associated with the EndDate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxEndDateDataGridViewColumn;

		/// <summary>
		/// the DGV column associated with the StandardCost property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStandardCostDataGridViewColumn;

		/// <summary>
		/// the DGV column associated with the ModifiedDate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxModifiedDateDataGridViewColumn;

		#endregion

		#region Combo list

		private Entities.TList<Entities.Product> _ProductIdList;

		/// <summary>
		/// The list of selectable Product
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Product> ProductIdList
		{
			get {return this._ProductIdList;}
			set
			{
				this._ProductIdList = value;
				this.uxProductIdDataGridViewColumn.DataSource = null;
				this.uxProductIdDataGridViewColumn.DataSource = this._ProductIdList;
			}
		}

		private bool _allowNewItemInProductIdList;

		/// <summary>
		/// Indicates if user can add an item in the list of Product
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInProductIdList
		{
			get { return _allowNewItemInProductIdList;}
			set
			{
				this._allowNewItemInProductIdList = value;
				this.uxProductIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}

		#endregion

		#region Main Datasource

		private Entities.TList<Entities.ProductCostHistory> _ProductCostHistoryList;

		/// <summary>
		/// The list of ProductCostHistory to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ProductCostHistory> ProductCostHistoryList
		{
			get {return this._ProductCostHistoryList;}
			set
			{
				this._ProductCostHistoryList = value;
				this.uxProductCostHistoryBindingSource.DataSource = null;
				this.uxProductCostHistoryBindingSource.DataSource = value;
				this.uxProductCostHistoryDataGridView.DataSource = null;
				this.uxProductCostHistoryDataGridView.DataSource = this.uxProductCostHistoryBindingSource;
				//this.uxProductCostHistoryBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxProductCostHistoryBindingSource_ListChanged);
				this.uxProductCostHistoryBindingSource.CurrentItemChanged += new System.EventHandler(OnProductCostHistoryBindingSourceCurrentItemChanged);
			}
		}

		private void OnProductCostHistoryBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentProductCostHistory = uxProductCostHistoryBindingSource.Current as Entities.ProductCostHistory;

			if (_currentProductCostHistory != null)
			{
				_currentProductCostHistory.Validate();
			}
			//_ProductCostHistory.Validate();
			OnCurrentEntityChanged();
		}

		//void uxProductCostHistoryBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}

		#endregion

		/// <summary>
		/// Gets the currently selected <see cref="Entities.ProductCostHistory"/> instance.
		/// </summary>
		public Entities.ProductCostHistory SelectedProductCostHistory
		{
			get {return this._currentProductCostHistory;}
		}

		#region other properties

		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxProductCostHistoryDataGridView.VirtualMode;}
			set
			{
				this.uxProductCostHistoryDataGridView.VirtualMode = value;
			}
		}

		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxProductCostHistoryDataGridView.AllowUserToAddRows;}
			set {this.uxProductCostHistoryDataGridView.AllowUserToAddRows = value;}
		}

		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxProductCostHistoryDataGridView.AllowUserToDeleteRows;}
			set {this.uxProductCostHistoryDataGridView.AllowUserToDeleteRows = value;}
		}

		/// <summary>
		/// Gets the <see cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxProductCostHistoryDataGridView;}
		}

		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))]
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxProductCostHistoryDataGridView.Columns; }
		}

		#endregion

		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Constructor

		/// <summary>
		/// Initializes a new instance of the <see cref="ProductCostHistoryDataGridViewBase"/> class.
		/// </summary>
		public ProductCostHistoryDataGridViewBase()
		{
			this.components = new System.ComponentModel.Container();

			this.uxProductCostHistoryDataGridView = new System.Windows.Forms.DataGridView();
			this.uxProductCostHistoryBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxProductCostHistoryErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxProductIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxStartDateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxEndDateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStandardCostDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxModifiedDateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxProductIdBindingSource = new ProductBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxProductIdBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxProductCostHistoryDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxProductCostHistoryBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxProductCostHistoryErrorProvider)).BeginInit();
			this.SuspendLayout();

			//
			// uxProductCostHistoryErrorProvider
			//
			this.uxProductCostHistoryErrorProvider.ContainerControl = this;
			this.uxProductCostHistoryErrorProvider.DataSource = this.uxProductCostHistoryBindingSource;
			//
			// uxProductCostHistoryDataGridView
			//
			this.uxProductCostHistoryDataGridView.AutoGenerateColumns = false;
			this.uxProductCostHistoryDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxProductCostHistoryDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxProductIdDataGridViewColumn,
		this.uxStartDateDataGridViewColumn,
		this.uxEndDateDataGridViewColumn,
		this.uxStandardCostDataGridViewColumn,
		this.uxModifiedDateDataGridViewColumn			});
			this.uxProductCostHistoryDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxProductCostHistoryDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxProductCostHistoryDataGridView.Name = "uxProductCostHistoryDataGridView";
			this.uxProductCostHistoryDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxProductCostHistoryDataGridView.TabIndex = 0;
			this.uxProductCostHistoryDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxProductCostHistoryDataGridView.EnableHeadersVisualStyles = false;
			this.uxProductCostHistoryDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnProductCostHistoryDataGridViewDataError);
			this.uxProductCostHistoryDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnProductCostHistoryDataGridViewCellValueNeeded);
			this.uxProductCostHistoryDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnProductCostHistoryDataGridViewCellValuePushed);

			//
			// uxProductIdDataGridViewColumn
			//
			this.uxProductIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxProductIdDataGridViewColumn.DataPropertyName = "ProductId";
			this.uxProductIdDataGridViewColumn.HeaderText = "ProductId";
			this.uxProductIdDataGridViewColumn.Name = "uxProductIdDataGridViewColumn";
			this.uxProductIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxProductIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxProductIdDataGridViewColumn.ReadOnly = false;
			//
			// uxStartDateDataGridViewColumn
			//
			this.uxStartDateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStartDateDataGridViewColumn.DataPropertyName = "StartDate";
			this.uxStartDateDataGridViewColumn.HeaderText = "StartDate";
			this.uxStartDateDataGridViewColumn.Name = "uxStartDateDataGridViewColumn";
			this.uxStartDateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStartDateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStartDateDataGridViewColumn.ReadOnly = false;
			//
			// uxEndDateDataGridViewColumn
			//
			this.uxEndDateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxEndDateDataGridViewColumn.DataPropertyName = "EndDate";
			this.uxEndDateDataGridViewColumn.HeaderText = "EndDate";
			this.uxEndDateDataGridViewColumn.Name = "uxEndDateDataGridViewColumn";
			this.uxEndDateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxEndDateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxEndDateDataGridViewColumn.ReadOnly = false;
			//
			// uxStandardCostDataGridViewColumn
			//
			this.uxStandardCostDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStandardCostDataGridViewColumn.DataPropertyName = "StandardCost";
			this.uxStandardCostDataGridViewColumn.HeaderText = "StandardCost";
			this.uxStandardCostDataGridViewColumn.Name = "uxStandardCostDataGridViewColumn";
			this.uxStandardCostDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStandardCostDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStandardCostDataGridViewColumn.ReadOnly = false;
			//
			// uxModifiedDateDataGridViewColumn
			//
			this.uxModifiedDateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxModifiedDateDataGridViewColumn.DataPropertyName = "ModifiedDate";
			this.uxModifiedDateDataGridViewColumn.HeaderText = "ModifiedDate";
			this.uxModifiedDateDataGridViewColumn.Name = "uxModifiedDateDataGridViewColumn";
			this.uxModifiedDateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxModifiedDateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxModifiedDateDataGridViewColumn.ReadOnly = false;
			//
			// uxProductIdDataGridViewColumn
			//
			this.uxProductIdDataGridViewColumn.DisplayMember = "Name";
			this.uxProductIdDataGridViewColumn.ValueMember = "ProductId";
			this.uxProductIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxProductIdDataGridViewColumn.DataSource = uxProductIdBindingSource;

			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxProductCostHistoryDataGridView);
			this.Name = "ProductCostHistoryDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxProductIdBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxProductCostHistoryErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxProductCostHistoryDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxProductCostHistoryBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion

		#region events

		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ProductCostHistoryDataGridViewEventArgs args = new ProductCostHistoryDataGridViewEventArgs();
				args.ProductCostHistory = _currentProductCostHistory;
				CurrentEntityChanged(this, args);
			}
		}

		#endregion

		/// <summary>
		/// Strongly typed event
		/// </summary>
		public class ProductCostHistoryDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ProductCostHistory	_ProductCostHistory;

			/// <summary>
			/// the  Entities.ProductCostHistory instance.
			/// </summary>
			public Entities.ProductCostHistory ProductCostHistory
			{
				get { return _ProductCostHistory; }
				set { _ProductCostHistory = value; }
			}
		}

		/// <summary>
		/// Handles the DataError event of the uxProductCostHistoryDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnProductCostHistoryDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}

		/// <summary>
		/// Handles the CellValueNeeded event of the uxProductCostHistoryDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnProductCostHistoryDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxProductCostHistoryDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxProductIdDataGridViewColumn":
						e.Value = ProductCostHistoryList[e.RowIndex].ProductId;
						break;
					case "uxStartDateDataGridViewColumn":
						e.Value = ProductCostHistoryList[e.RowIndex].StartDate;
						break;
					case "uxEndDateDataGridViewColumn":
						e.Value = ProductCostHistoryList[e.RowIndex].EndDate;
						break;
					case "uxStandardCostDataGridViewColumn":
						e.Value = ProductCostHistoryList[e.RowIndex].StandardCost;
						break;
					case "uxModifiedDateDataGridViewColumn":
						e.Value = ProductCostHistoryList[e.RowIndex].ModifiedDate;
						break;
				default:
				break;
			}
		}

		/// <summary>
		/// Handles the CellValuePushed event of the uxProductCostHistoryDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnProductCostHistoryDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxProductCostHistoryDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxProductIdDataGridViewColumn":
						ProductCostHistoryList[e.RowIndex].ProductId = (System.Int32)e.Value;
						break;
					case "uxStartDateDataGridViewColumn":
						ProductCostHistoryList[e.RowIndex].StartDate = (System.DateTime)e.Value;
						break;
					case "uxEndDateDataGridViewColumn":
						ProductCostHistoryList[e.RowIndex].EndDate = (System.DateTime?)e.Value;
						break;
					case "uxStandardCostDataGridViewColumn":
						ProductCostHistoryList[e.RowIndex].StandardCost = (System.Decimal)e.Value;
						break;
					case "uxModifiedDateDataGridViewColumn":
						ProductCostHistoryList[e.RowIndex].ModifiedDate = (System.DateTime)e.Value;
						break;
				default:
				break;
			}
		}
	}
}


text:
package org.apache.maven.plugin.invoker;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.introspection.ReflectionValueExtractor;

/**
 * A map-like source to interpolate expressions.
 *
 * @author Olivier Lamy
 * @since 1.1
 * @version $Id$
 */
class CompositeMap
    implements Map<String, Object>
{

    /**
     * The Maven project from which to extract interpolated values, never null.
     */
    private MavenProject mavenProject;

    /**
     * The set of additional properties from which to extract interpolated values, never null.
     */
    private Map<String, Object> properties;

    /**
     * Creates a new interpolation source backed by the specified Maven project and some user-specified properties.
     *
     * @param mavenProject The Maven project from which to extract interpolated values, must not be null.
     * @param properties The set of additional properties from which to extract interpolated values, may be
     *            null.
     */
    protected CompositeMap( MavenProject mavenProject, Map<String, Object> properties )
    {
        if ( mavenProject == null )
        {
            throw new IllegalArgumentException( "no project specified" );
        }
        this.mavenProject = mavenProject;
        this.properties = properties == null ? new HashMap<String, Object>() : properties;
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#clear()
     */
    public void clear()
    {
        // nothing here
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#containsKey(java.lang.Object)
     */
    public boolean containsKey( Object key )
    {
        if ( !( key instanceof String ) )
        {
            return false;
        }

        String expression = (String) key;
        if ( expression.startsWith( "project." ) || expression.startsWith( "pom." ) )
        {
            try
            {
                Object evaluated = ReflectionValueExtractor.evaluate( expression, this.mavenProject );
                if ( evaluated != null )
                {
                    return true;
                }
            }
            catch ( Exception e )
            {
                // uhm do we have to throw a RuntimeException here ?
            }
        }

        return properties.containsKey( key ) || mavenProject.getProperties().containsKey( key );
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#containsValue(java.lang.Object)
     */
    public boolean containsValue( Object value )
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#entrySet()
     */
    public Set<Entry<String, Object>> entrySet()
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#get(java.lang.Object)
     */
    public Object get( Object key )
    {
        if ( !( key instanceof String ) )
        {
            return null;
        }

        String expression = (String) key;
        if ( expression.startsWith( "project." ) || expression.startsWith( "pom." ) )
        {
            try
            {
                Object evaluated = ReflectionValueExtractor.evaluate( expression, this.mavenProject );
                if ( evaluated != null )
                {
                    return evaluated;
                }
            }
            catch ( Exception e )
            {
                // uhm do we have to throw a RuntimeException here ?
            }
        }

        Object value = properties.get( key );

        return ( value != null ? value : this.mavenProject.getProperties().get( key ) );

    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#isEmpty()
     */
    public boolean isEmpty()
    {
        return this.mavenProject.getProperties().isEmpty() && this.properties.isEmpty();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#keySet()
     */
    public Set<String> keySet()
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#put(java.lang.Object, java.lang.Object)
     */
    public Object put( String key, Object value )
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#putAll(java.util.Map)
     */
    public void putAll( Map<? extends String, ? extends Object> t )
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#remove(java.lang.Object)
     */
    public Object remove( Object key )
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#size()
     */
    public int size()
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     *
     * @see java.util.Map#values()
     */
    public Collection<Object> values()
    {
        throw new UnsupportedOperationException();
    }
}


text:
module Admin
  # admin member dashboard controller
  class AnnouncementsController < Admin::ApplicationController
  end
end


text:
/*
 * "Planet" that is a particle effect that magically transports you to another
 * system.
 */
package celestial;

import celestial.Ship.Ship;
import com.jme3.asset.AssetManager;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.shapes.SphereCollisionShape;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.shape.Sphere;
import entity.Entity;
import java.util.ArrayList;
import jmeplanet.PlanetAppState;
import universe.SolarSystem;
import universe.Universe;

/**
 *
 * @author nwiehoff
 */
public class Jumphole extends Planet {

    transient ParticleEmitter emitter;
    private int seed;
    //colors
    public static final ColorRGBA START_COLOR = new ColorRGBA(1, 1, 0.5f, 1);
    public static final ColorRGBA END_COLOR = new ColorRGBA(0, 0, 1, 0.5f);
    //hole stuff
    private Jumphole outGate;
    protected String out = "n/n";

    public Jumphole(Universe universe, String name) {
        super(universe, name, null, 15, Vector3f.ZERO);
    }

    @Override
    public void construct(AssetManager assets) {
        //create geometry
        Sphere objectSphere = new Sphere(64, 64, radius);
        setSpatial(new Geometry("JumpholeSphere", objectSphere));
        //retrieve texture
        mat = new Material(assets, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setColor("Color", START_COLOR);
        getSpatial().setMaterial(mat);
        //initializes the physics as a sphere
        SphereCollisionShape sphereShape = new SphereCollisionShape(radius);
        //setup dynamic physics
        physics = new RigidBodyControl(sphereShape, getMass());
        //setup particle
        setupCoreParticle(assets);
        //add physics to mesh
        getSpatial().addControl(physics);
        nameControl.setParent(this);
        getSpatial().addControl(nameControl);
    }

    private void setupCoreParticle(AssetManager assets) {
        //create the emitter
        emitter = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 120);
        mat = new Material(assets, "Common/MatDefs/Misc/Particle.j3md");
        mat.setTexture("Texture", assets.loadTexture("Effects/Star/jumphole.png"));
        //mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
        //mat.getAdditionalRenderState().setAlphaTest(true);
        emitter.setMaterial(mat);
        //setup emitter
        emitter.setEnabled(true);
        emitter.setImagesX(1);
        emitter.setImagesY(1);
        emitter.setEndColor(END_COLOR);
        emitter.setStartColor(START_COLOR); // IRRELEVENT
        emitter.setStartSize(radius * 2);
        emitter.setEndSize(0);
        emitter.setGravity(0, 0, 0);
        emitter.setLowLife(15);
        emitter.setHighLife(60);
        emitter.getParticleInfluencer().setVelocityVariation(1f);
        emitter.getParticleInfluencer().setInitialVelocity(Vector3f.UNIT_XYZ);
        emitter.setParticlesPerSec(2);
        emitter.setInWorldSpace(false);
    }

    @Override
    public void deconstruct() {
        super.deconstruct();
    }

    @Override
    public void attach(Node node, BulletAppState physics, PlanetAppState planetAppState) {
        //node.attachChild(spatial);
        physics.getPhysicsSpace().add(getSpatial());
        node.attachChild(emitter);
    }

    @Override
    public void detach(Node node, BulletAppState physics, PlanetAppState planetAppState) {
        //node.detachChild(spatial);
        physics.getPhysicsSpace().remove(getSpatial());
        node.detachChild(emitter);
    }

    @Override
    protected void alive() {
        super.alive();
        if (emitter != null) {
            emitter.setLocalTranslation(getLocation());
        }
        aliveAlways();
    }

    @Override
    protected void oosAlive() {
        super.oosAlive();
        aliveAlways();
    }

    @Override
    public int getSeed() {
        return seed;
    }

    @Override
    public void setSeed(int seed) {
        this.seed = seed;
    }

    public void createLink(String out) {
        /*
         * Locates this gate's partner in the target solar system.
         */
        String outSysTmp = out.split("/")[0];
        String outGateTmp = out.split("/")[1];
        //find the out link
        Universe universe = getCurrentSystem().getUniverse();
        for (int a = 0; a < universe.getSystems().size(); a++) {
            SolarSystem curr = universe.getSystems().get(a);
            if (curr.getName().equals(outSysTmp)) {
                for (int b = 0; b < curr.getCelestials().size(); b++) {
                    Entity entity = curr.getCelestials().get(b);
                    if (entity instanceof Jumphole) {
                        if (entity.getName().equals(outGateTmp)) {
                            outGate = (Jumphole) entity;
                            outGate.linkWithPartner(this);
                        }
                    }
                }
            }
        }
    }

    public void linkWithPartner(Jumphole gate) {
        outGate = gate;
    }

    public void setOut(String out) {
        this.out = out;
    }

    private void jumpShip(Ship ship) {
        SolarSystem start = ship.getCurrentSystem();
        SolarSystem end = outGate.getCurrentSystem();
        //pull from old system
        start.pullEntityFromSystem(ship);
        //store location
        Vector3f diff = getLocation().subtract(ship.getLocation());
        ship.setLocation(outGate.getLocation().add(diff.mult(2)));
        //complete transfer
        end.putEntityInSystem(ship);

    }

    private void checkForJumpers() {
        //check for any ships to jump
        ArrayList<Entity> near = getCurrentSystem().getShipList();
        for (int a = 0; a < near.size(); a++) {
            Ship tmp = (Ship) near.get(a);
            float dist = tmp.getLocation().distance(getLocation());
            if (dist <= 1.5f * radius) {
                //jump
                jumpShip(tmp);
            }
        }
    }

    private void aliveAlways() {
        //guarantee link
        if (outGate == null) {
            createLink(out);
        }
        //see if anything can jump through
        checkForJumpers();
    }

    public String getOut() {
        return out;
    }

    public Jumphole getOutGate() {
        return outGate;
    }

    @Override
    public float getSafetyZone(float caution) {
        return 0;
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eRPC API Reference: Serial</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>

eRPC API Reference
    Rev. 1.3.0

NXP Semiconductors

Main Page

API Reference

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Files |
Functions

Serial
Porting

Serial port.
More...

Overview

Serial port.

   Collaboration diagram for Serial:

Files

file  	serial.h

Functions

int 	serial_setup (int fd, speed_t speed)

int 	serial_set_read_timeout (int fd, uint8_t vtime, uint8_t vmin)

int 	serial_write (int fd, char *buf, int size)

int 	serial_read (int fd, char *buf, int size)

int 	serial_open (const char *port)

int 	serial_close (int fd)

Copyright © 2016 Freescale Semiconductor, Inc.


text:
import logging
import ibmsecurity.utilities.tools

logger = logging.getLogger(__name__)

def get(isdsAppliance, check_mode=False, force=False):
    """
    Retrieving the administrator settings
    """
    return isdsAppliance.invoke_get("Retrieving the administrator settings", "/admin_cfg")

def set_pw(isdsAppliance, newPassword, oldPassword, sessionTimeout="30", check_mode=False, force=False):
    """
    Set password for admin user (super user for appliance)
    """
    warnings = ["Password change requested - cannot query existing password for idempotency check."]
    if check_mode is True:
        return isdsAppliance.create_return_object(changed=True, warnings=warnings)
    else:
        json_data = {
            "oldPassword": oldPassword,
            "newPassword": newPassword,
            "confirmPassword": newPassword,
            "sessionTimeout": sessionTimeout
        }

        return isdsAppliance.invoke_put("Setting admin password", "/admin_cfg", json_data, warnings=warnings)

def set(isdsAppliance, oldPassword=None, newPassword=None, sessionTimeout=30, check_mode=False, force=False):
    """
    Updating the administrator settings
    """
    warnings = []
    if force is False:
        update_required, warnings, json_data = _check(isdsAppliance, oldPassword, newPassword, sessionTimeout, warnings)

    if force is True or update_required is True:
        if check_mode is True:
            return isdsAppliance.create_return_object(changed=True, warnings=warnings)
        else:
            return isdsAppliance.invoke_put(
                "Updating the administrator settings",
                "/admin_cfg", json_data, warnings=warnings)

    return isdsAppliance.create_return_object(changed=False, warnings=warnings)

def _check(isdsAppliance, oldPassword, newPassword, sessionTimeout, warnings):
    """
    Check whether target key has already been set with the value
    :param isdsAppliance:
    :param key:
    :param value:
    :return: True/False
    """
    ret_obj = get(isdsAppliance)

    json_data = {
        "sessionTimeout": sessionTimeout
    }
    if oldPassword is not None:
        json_data["oldPassword"] = oldPassword
        if newPassword is None:
            warnings.append("Please provide new password, when old password is specified.")
    if newPassword is not None:
        warnings.append("Password change requested - cannot query existing password for idempotency check.")
        json_data["newPassword"] = newPassword
        json_data["confirmPassword"] = newPassword
        if oldPassword is None:
            warnings.append("Please provide old password, when new password is specified.")

    if ibmsecurity.utilities.tools.json_sort(json_data) != ibmsecurity.utilities.tools.json_sort(ret_obj['data']):
        logger.debug("Admin Settings are found to be different. See following JSON for difference.")
        logger.debug("New JSON: {0}".format(ibmsecurity.utilities.tools.json_sort(json_data)))
        logger.debug("Old JSON: {0}".format(ibmsecurity.utilities.tools.json_sort(ret_obj['data'])))
        return True, warnings, json_data
    else:  # No changes required
        return False, warnings, json_data

def compare(isdsAppliance1, isdsAppliance2):
    """
    Compare advanced tuning parameters between two appliances
    """
    ret_obj1 = get(isdsAppliance1)
    ret_obj2 = get(isdsAppliance2)

    return ibmsecurity.utilities.tools.json_compare(ret_obj1, ret_obj2)


text:
title: Web apps
slug: web

**Non amo sviluppare per il web** (sono più un tipo da **backend**, ecco):
io e l'HTML non riusciamo a stare insieme per troppe ore ma per necessità
mi sono rimboccato le maniche e ho approfondito anche un po' di *HTML*,
*CSS* e *JS* oltre a *PHP*, *Java* e *Python* (il mio preferito).


text:
<!DOCTYPE html>

  <meta charset='UTF-8'>
  <title>Mongoose Express API Documentation</title>
  <link rel='stylesheet' href='assets/codo.css' type='text/css'>

    Mongoose Express API
    »
    Index
    »
    README.md

          (no frames)

      Classes
      Files
      Methods
      Extras

    <input type='text'>

      Quickly fuzzy find classes, mixins, methods, file:

        Ctrl-T
        Open fuzzy finder dialog

      In frame mode you can toggle the list naviation frame on the left side:

        Ctrl-L
        Toggle list view

      You can focus a list in frame mode or toggle a tab in frameless mode:

        Ctrl-C
        Class list

        Ctrl-I
        Mixin list

        Ctrl-F
        File list

        Ctrl-M
        Method list

        Ctrl-E
        Extras list

      You can focus and blur the search input:

        Ctrl-S
        Focus search input

        Esc
        Blur search input

      In frameless mode you can close the list tab:

        Esc
        Close list tab

            Table of Contents

            (left)

Mongoose Express Api

Flexible automatic API generation for Moongose and Express

Features

Unobtrusive mix routes into Express apps.

Quick setup.

RESTful ready to use default implementation with CRUDL (create, read, update, destroy and list) actions and JSend responses. list action supports complex queries through moongose-api-query.

Setup middlewares to secure api and intercept requests.

Choose which models to map and actions enabled to them.

Flexible Interface: you can change everything, modifing actions and response formats, or replace the whole implementation to use different protocols or action sets.

Automatic documentation generation.

Installation

npm install mongoose-express-api

or specify it as a dependency in package.json

"dependencies": {
  "mongoose-express-api": "*"
}

and then run npm install in your project root.

Examples

Basic usage

MongooseExpressApi = require("mongoose-express-api");

api = new MongooseExpressApi();
api.resources(mongoose.models);

api.mount(app, "/api");

Filtering models

api.resources(mongoose.models, { skip: ["Admin"] })

Specifying allowed actions

api.resources(mongoose.models, {actions: ["read", "list"]})

Adding a single model

api.resource(myModel)

Adding a single model filtering actions

api.resource(myModel, {actions: ["read", "list"]})

Extending implementation

impl = api.getImplementation();
impl.setResponder( myResponder );
impl.addAction( "search", searchAction );

Replacing Implementation

impl = api.setImplementation( myImpl );

Securing api and using middlewares

impl.use(myMiddleware);

impl.use(authMiddleware, {if: function(action){
  return action.method != "get";
}});

Generate Documentation

api = new MongooseExpressApi({ title: "My API", description: "This API is for ..", version: "1.0.0" });
api.resources(mongoose.models);

api.mount(app, "/api");
api.mountDocumentation(app, "/api/docs");

  Generated on
  Tue Aug 27 2013 17:53:55 GMT+0200 (CEST)
  by
  Codo
  v1.7.2
  (Node.js v0.10.15).
  ✲
  Press Ctrl-h to see the keyboard shortcuts
  ✲
  @netzpirat
  ✲
  mksoft.ch


text:
package org.thingsboard.server.dao.resource;

import org.thingsboard.server.common.data.TbResourceInfo;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.dao.Dao;

import java.util.UUID;

public interface TbResourceInfoDao extends Dao<TbResourceInfo> {

    PageData<TbResourceInfo> findAllTenantResourcesByTenantId(UUID tenantId, PageLink pageLink);

    PageData<TbResourceInfo> findTenantResourcesByTenantId(UUID tenantId, PageLink pageLink);

}


text:
package edu.umd.cs.findbugs.annotations;

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

/**
 * This annotation is used to denote a method whose return value should always
 * be checked when invoking the method.
 *
 * The checker treats this annotation as inherited by overriding methods.
 *
 * @deprecated - use {@link javax.annotation.CheckReturnValue} instead.
 */
@Documented
@Target({ ElementType.METHOD, ElementType.CONSTRUCTOR })
@Retention(RetentionPolicy.CLASS)
@Deprecated
public @interface CheckReturnValue {

    @Deprecated
    Priority priority() default Priority.MEDIUM;

    Confidence confidence() default Confidence.MEDIUM;

    /**
     * A textual explanation of why the return value should be checked
     */
    String explanation() default "";
}


text:
module Spree
  Payment.class_eval do
    belongs_to :order, :touch => true
  end
end


text:
require 'ansible/ruby/modules/base'

module Ansible
  module Ruby
    module Modules
      # Change an administrative parameter on a MongoDB server.
      class Mongodb_parameter < Base
        # @return [Object, nil] The username used to authenticate with
        attribute :login_user

        # @return [Object, nil] The password used to authenticate with
        attribute :login_password

        # @return [String, nil] The host running the database
        attribute :login_host
        validates :login_host, type: String

        # @return [Integer, nil] The port to connect to
        attribute :login_port
        validates :login_port, type: Integer

        # @return [Object, nil] The database where login credentials are stored
        attribute :login_database

        # @return [Object, nil] Replica set to connect to (automatically connects to primary for writes)
        attribute :replica_set

        # @return [Object] The name of the database to add/remove the user from
        attribute :database
        validates :database, presence: true

        # @return [:yes, :no, nil] Whether to use an SSL connection when connecting to the database
        attribute :ssl
        validates :ssl, expression_inclusion: {:in=>[:yes, :no], :message=>"%{value} needs to be :yes, :no"}, allow_nil: true

        # @return [String] MongoDB administrative parameter to modify
        attribute :param
        validates :param, presence: true, type: String

        # @return [Integer] MongoDB administrative parameter value to set
        attribute :value
        validates :value, presence: true, type: Integer

        # @return [String, nil] Define the parameter value (str, int)
        attribute :param_type
        validates :param_type, type: String
      end
    end
  end
end


text:
#include "common/sedna.h"
#include "common/base.h"

#include "tr/executor/base/dynamic_context.h"
#include "tr/executor/base/PPBase.h"
#include "tr/executor/base/xs_uri.h"
#include "tr/executor/base/xs_helper.h"

producer::producer() : type(pt_not_defined),
                 s(NULL),
                 op(NULL),
                 svc(NULL),
                 cvc(NULL),
                 tuple_pos(0),
                 t(NULL)
{
}

producer::~producer()
{
    switch (type)
    {
        case pt_not_defined : break;
        case pt_tuple       : delete t; break;
        case pt_seq         : delete s; break;
        case pt_lazy_simple : delete svc; break;
        case pt_lazy_complex: delete cvc; break;
        default             : throw USER_EXCEPTION2(SE1003, "Unexpected case in producer::~producer");
    }
}

void global_producer::open()
{
    op->open();
}

void global_producer::close()
{
    ((PPIterator*)op)->close();
}

/*******************************************************************************
 * Global variable context
 ******************************************************************************/

global_variable_context::~global_variable_context()
{
    // delete global vars operations
    for (std::vector<global_producer>::iterator it = producers.begin();
            it != producers.end(); it++)
        delete it->op;
}

/*******************************************************************************
 * Function context
 ******************************************************************************/

function_context::~function_context()
{
    // delete function operations and arg sequencies
    for (std::vector<function_declaration>::iterator it = fun_decls.begin();
            it != fun_decls.end(); it++)
    {
        delete[] it->args;
        delete it->op;
    }
}

/*******************************************************************************
 * Dynamic context
 ******************************************************************************/

dynamic_context::dynamic_context(static_context *_st_cxt_) : st_cxt(_st_cxt_)
{
    current_var_cxt = NULL;
    curr_var_dsc = curr_gvar_dsc = curr_func_id = 0;
    datetime_initialized = false;
}

dynamic_context::~dynamic_context()
{
    // destroy children-contexts
    for (size_t i = 0; i < child_cxts.size(); i++)
        delete child_cxts[i];

    // drop temporary docs
    std::vector<xptr>::iterator cit=temp_docs.begin();
    while (cit != temp_docs.end())
    {
        xptr nd = *cit;
        CHECKP(nd);
        getSchemaNode(nd)->drop();
        ++cit;
    }

    // destroy all variable contexts
    for (size_t i = 0; i < var_cxts.size(); i++)
        delete var_cxts[i];

    // destroy static context
    delete st_cxt;
}

void dynamic_context::reset_local_vars()
{
    // reuse current context if we haven't used it
    if (!current_var_cxt || current_var_cxt->size != 0)
    {
        current_var_cxt = new variable_context();
        var_cxts.push_back(current_var_cxt);
    }

    curr_var_dsc = 0;
}

void dynamic_context::global_variables_open()
{
    // open children-contexts
    for (size_t i = 0; i < child_cxts.size(); i++)
        child_cxts[i]->global_variables_open();

    glb_var_cxt.open();
}

void dynamic_context::global_variables_close()
{
    glb_var_cxt.close();

    // close children-contexts
    for (size_t i = 0; i < child_cxts.size(); i++)
        child_cxts[i]->global_variables_close();
}

void dynamic_context::set_datetime()
{
    if (!datetime_initialized)
    {
        datetime_initialized = true;
        utm tm = getLocalTime();
        current_datetime = XMLDateTime(tm);
        current_date = XMLDateTime(tm).convertTo(xs_date);
        current_time = XMLDateTime(tm).convertTo(xs_time);
        implicit_timezone = XMLDateTime(tm).getTimezone();
    }
}


text:
#include <string>

#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/kernel_def_builder.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/kernels/lookup_table_init_op.h"
#include "tensorflow/core/kernels/lookup_table_op.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"

namespace tensorflow {
namespace {
// lookup::InitializeTableFromTextFile requires a delimiter even though we use
// the entire line for vocabularies.
constexpr char kUnusedLookupDelim = '\t';
}  // namespace

// This Op generates a vocab remapping Tensor from an old and new vocabulary
// file that maps new ID's to old ID's.
class GenerateVocabRemappingOp : public OpKernel {
 public:
  explicit GenerateVocabRemappingOp(OpKernelConstruction* context)
      : OpKernel(context) {
    OP_REQUIRES_OK(context,
                   context->GetAttr("new_vocab_offset", &new_vocab_offset_));
    OP_REQUIRES_OK(context, context->GetAttr("num_new_vocab", &num_new_vocab_));
    OP_REQUIRES_OK(context,
                   context->GetAttr("old_vocab_size", &old_vocab_size_));
  }

  void Compute(OpKernelContext* context) override {
    const Tensor* new_vocab_file_tensor;
    OP_REQUIRES_OK(context,
                   context->input("new_vocab_file", &new_vocab_file_tensor));
    OP_REQUIRES(context,
                TensorShapeUtils::IsScalar(new_vocab_file_tensor->shape()),
                errors::InvalidArgument(
                    "new_vocab_file should be a single string, but got ",
                    new_vocab_file_tensor->shape().DebugString()));

    // Build a new ID->token lookup table.
    const string& new_vocab_filename =
        new_vocab_file_tensor->scalar<tstring>()();
    OP_REQUIRES(context, !new_vocab_filename.empty(),
                errors::InvalidArgument("new vocab filename cannot be empty."));
    lookup::HashTable<int64_t, tstring>* new_vocab_table =
        new lookup::HashTable<int64_t, tstring>(context, this);
    core::ScopedUnref unref_new(new_vocab_table);
    // Note: we pass -1 (unknown) for vocab_size, which is supposed to be the
    // total elements in file.  This is different from num_new_vocab_, which
    // accounts for partitioning.
    OP_REQUIRES_OK(context, lookup::InitializeTableFromTextFile(
                                new_vocab_filename,
                                -1,  // vocab_size
                                kUnusedLookupDelim,
                                -1,  // key_index, use the line number.
                                -2,  // value_index, use the whole line/token.
                                0,   // No offset.
                                context->env(), new_vocab_table));
    OP_REQUIRES(context,
                new_vocab_offset_ + num_new_vocab_ <= new_vocab_table->size(),
                errors::InvalidArgument("lookup table size must be larger than "
                                        "last new vocab entry's line"));

    const Tensor* old_vocab_file_tensor;
    OP_REQUIRES_OK(context,
                   context->input("old_vocab_file", &old_vocab_file_tensor));
    OP_REQUIRES(context,
                TensorShapeUtils::IsScalar(old_vocab_file_tensor->shape()),
                errors::InvalidArgument(
                    "old_vocab_file should be a single string, but got ",
                    old_vocab_file_tensor->shape().DebugString()));
    // Build a token->old ID lookup table.
    const string& old_vocab_filename =
        old_vocab_file_tensor->scalar<tstring>()();
    OP_REQUIRES(context, !old_vocab_filename.empty(),
                errors::InvalidArgument("new vocab filename cannot be empty."));
    lookup::HashTable<tstring, int64_t>* old_vocab_table =
        new lookup::HashTable<tstring, int64_t>(context, this);
    core::ScopedUnref unref_old(old_vocab_table);
    // Note: If old_vocab_size_ is -1 (unknown), we retrieve all elements in
    // file (see TextFileLineIterator).
    OP_REQUIRES_OK(context,
                   lookup::InitializeTableFromTextFile(
                       old_vocab_filename, old_vocab_size_, kUnusedLookupDelim,
                       -2,  // key_index, use the whole line/token.
                       -1,  // value_index, use the line number.
                       0,   // No offset.
                       context->env(), old_vocab_table));

    // Fill out new_ids = [new_vocab_offset, new_vocab_offset + 1, ...,
    //                     new_vocab_offset + num_new_vocab_]
    // The double look-up requires a few temporary Tensors.
    Tensor new_ids;
    OP_REQUIRES_OK(
        context, context->allocate_temp(DT_INT64, TensorShape({num_new_vocab_}),
                                        &new_ids));
    auto new_ids_vec = new_ids.vec<int64_t>();
    // Note that we should always be able to find tokens for all new ID's, given
    // that the lookup table is constructed with the vocabulary file itself
    // (see the check on offset and table size post-initialization).
    Tensor default_token;
    OP_REQUIRES_OK(
        context, context->allocate_temp(
                     DT_STRING, TensorShape({num_new_vocab_}), &default_token));
    auto default_token_vec = default_token.vec<tstring>();
    default_token_vec.setConstant("" /* NOT_FOUND_TOKEN */);

    Tensor default_id;
    OP_REQUIRES_OK(
        context, context->allocate_temp(DT_INT64, TensorShape({num_new_vocab_}),
                                        &default_id));
    auto default_id_vec = default_id.vec<int64_t>();
    default_id_vec.setConstant(-1 /* NOT_FOUND_ID */);

    for (int i = 0; i < num_new_vocab_; ++i) {
      new_ids_vec(i) = static_cast<int64_t>(i + new_vocab_offset_);
    }
    Tensor tokens;
    OP_REQUIRES_OK(context,
                   context->allocate_temp(
                       DT_STRING, TensorShape({num_new_vocab_}), &tokens));
    Tensor* remapping;
    OP_REQUIRES_OK(context,
                   context->allocate_output(
                       "remapping", TensorShape({num_new_vocab_}), &remapping));
    // In the corner case where num_new_vocab_ is 0 (we are dealing with an
    // OOV-only partition), we should not do this lookup.
    if (num_new_vocab_ != 0) {
      OP_REQUIRES_OK(context, new_vocab_table->Find(context, new_ids, &tokens,
                                                    default_token));
      OP_REQUIRES_OK(context, old_vocab_table->Find(context, tokens, remapping,
                                                    default_id));
    }
    // Iterate through remapping to calculate num_present.
    const auto remapping_vec = remapping->vec<int64_t>();
    int num_present = 0;
    for (int i = 0; i < num_new_vocab_; ++i) {
      if (remapping_vec(i) != -1 /* NOT_FOUND_ID */) {
        ++num_present;
      }
    }
    Tensor* num_present_t;
    OP_REQUIRES_OK(context,
                   context->allocate_output("num_present", TensorShape({}),
                                            &num_present_t));
    num_present_t->scalar<int>()() = num_present;
  }

 private:
  int new_vocab_offset_;
  int num_new_vocab_;
  int old_vocab_size_;
};

REGISTER_KERNEL_BUILDER(Name("GenerateVocabRemapping").Device(DEVICE_CPU),
                        GenerateVocabRemappingOp);

}  // namespace tensorflow


text:
package core

import (
	"os";
	"net";
	"log";
	"irc";
	"runloop";
	"events";
)

// A clients implements a connection to an IRC client.
type client struct {
	conn		*irc.Conn;
	network		*Network;

	// Login nick and real name
	nick		string;
	realname	string;
}

// newClient returns a new client for a given network connection.
func newClient(conn net.Conn, network *Network) *client {
	var c *client;

	recvFunc := func(msg *irc.Message) {
		runloop.CallLater(func() { c.recvFunc(msg) })
	};
	errorFunc := func(err os.Error) {
		runloop.CallLater(func() { c.errorFunc(err) })
	};

	c = &client{conn: irc.NewConn(conn, recvFunc, errorFunc), network: network};
	return c;
}

func (c *client) errorFunc(err os.Error) {
	// TODO handle error
	log.Stderrf("client %s failed: %s\n", c.conn.RemoteAddr(), err);
}

func (c *client) welcome() {
	c.conn.Send(irc.RplWelcome.Message(c.nick, c.nick, c.nick, c.conn.RemoteAddr()));
	c.conn.Send(irc.RplYourHost.Message(c.nick, "bouncin", "0.1"));
	c.conn.Send(irc.RplCreated.Message(c.nick, "..."));
	c.conn.Send(irc.RplMyInfo.Message(c.nick, "bouncin", "0.1", "", ""));
}

func (c *client) recvFunc(msg *irc.Message) {
	// Connection registration is a special state, don't process messages
	// until the client gives its nick and user.
	if c.nick == "" {
		if msg.Command == "NICK" && len(msg.Params) == 1 {
			c.nick = msg.Params[0]
		}
		return;
	}
	if c.realname == "" {
		if msg.Command == "USER" && len(msg.Params) == 4 {
			c.realname = msg.Params[3];
			c.welcome();
		}
		return;
	}

	// The normal code path notifies the RecvFromClient event chain.
	events.Notify("RecvFromClient", c, msg);
}

func (c *client) Network() *Network {
	return c.network
}

func (c *client) RemoteAddr() net.Addr {
	return c.conn.RemoteAddr()
}

func (c *client) Send(msg *irc.Message) {
	events.Notify("SendToClient", c, msg)
}

func sendToClient(conn Conn, msg *irc.Message) events.EventAction {
	conn.(*client).conn.Send(msg);
	return events.EventStop;
}

func init() {
	events.AddChain("RecvFromClient", InvokeSendRecv);
	events.AddChain("SendToClient", InvokeSendRecv);

	events.AddHandler("SendToClient", "client", events.PrioLast, sendToClient);
}


text:
package com.nowellpoint.client.sforce;

public class OauthConstants {

	public static final String AUTHORIZE_ENDPOINT = "authorizeUrl";

	public static final String TOKEN_ENDPOINT = "tokenUrl";

	public static final String REVOKE_ENDPOINT = "revokeUrl";

	public static final String GRANT_TYPE_PARAMETER = "grant_type";

	public static final String TOKEN_PARAMETER = "token";

	public static final String CODE_PARAMETER = "code";

	public static final String USERNAME_PARAMETER = "username";

	public static final String PASSWORD_PARAMETER = "password";

	public static final String RESPONSE_TYPE_PARAMETER = "response_type";

	public static final String CLIENT_ID_PARAMETER = "client_id";

	public static final String CLIENT_SECRET_PARAMETER = "client_secret";

	public static final String SCOPE_PARAMETER = "scope";

	public static final String DISPLAY_PARAMETER = "display";

	public static final String REDIRECT_URI_PARAMETER = "redirect_uri";

	public static final String PROMPT_PARAMETER = "prompt";

	public static final String STATE_PARAMETER = "state";

	public static final String OAUTH_TOKEN_PARAMETER = "oauth_token";

	public static final String REFRESH_GRANT_TYPE = "refresh_token";

	public static final String REFRESH_TOKEN_PARAMETER = "refresh_token";

	public static final String AUTHORIZATION_GRANT_TYPE = "authorization_code";

	public static final String PASSWORD_GRANT_TYPE = "password";
}


text:
UPDATE PROPOSAL_TYPE SET DESCRIPTION = 'Resubmission' where PROPOSAL_TYPE_CODE = 2;
UPDATE PROPOSAL_TYPE SET DESCRIPTION = 'Continuation' where PROPOSAL_TYPE_CODE = 4;
UPDATE krns_parm_t SET txt = '4' where nmspc_cd = 'KRA-PD' and parm_dtl_typ_cd = 'D' and parm_nm =  'proposaldevelopment.proposaltype.continuation';
commit;


text:
#pragma once
#include <aws/servicecatalog/ServiceCatalog_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/servicecatalog/model/OrganizationNode.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace ServiceCatalog
{
namespace Model
{
  class AWS_SERVICECATALOG_API ListOrganizationPortfolioAccessResult
  {
  public:
    ListOrganizationPortfolioAccessResult();
    ListOrganizationPortfolioAccessResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    ListOrganizationPortfolioAccessResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
Displays information about the organization nodes.

     */
    inline const Aws::Vector<OrganizationNode>& GetOrganizationNodes() const{ return m_organizationNodes; }

    /**
     *
Displays information about the organization nodes.

     */
    inline void SetOrganizationNodes(const Aws::Vector<OrganizationNode>& value) { m_organizationNodes = value; }

    /**
     *
Displays information about the organization nodes.

     */
    inline void SetOrganizationNodes(Aws::Vector<OrganizationNode>&& value) { m_organizationNodes = std::move(value); }

    /**
     *
Displays information about the organization nodes.

     */
    inline ListOrganizationPortfolioAccessResult& WithOrganizationNodes(const Aws::Vector<OrganizationNode>& value) { SetOrganizationNodes(value); return *this;}

    /**
     *
Displays information about the organization nodes.

     */
    inline ListOrganizationPortfolioAccessResult& WithOrganizationNodes(Aws::Vector<OrganizationNode>&& value) { SetOrganizationNodes(std::move(value)); return *this;}

    /**
     *
Displays information about the organization nodes.

     */
    inline ListOrganizationPortfolioAccessResult& AddOrganizationNodes(const OrganizationNode& value) { m_organizationNodes.push_back(value); return *this; }

    /**
     *
Displays information about the organization nodes.

     */
    inline ListOrganizationPortfolioAccessResult& AddOrganizationNodes(OrganizationNode&& value) { m_organizationNodes.push_back(std::move(value)); return *this; }

    /**
     *
The page token to use to retrieve the next set of results. If there are no
     * additional results, this value is null.

     */
    inline const Aws::String& GetNextPageToken() const{ return m_nextPageToken; }

    /**
     *
The page token to use to retrieve the next set of results. If there are no
     * additional results, this value is null.

     */
    inline void SetNextPageToken(const Aws::String& value) { m_nextPageToken = value; }

    /**
     *
The page token to use to retrieve the next set of results. If there are no
     * additional results, this value is null.

     */
    inline void SetNextPageToken(Aws::String&& value) { m_nextPageToken = std::move(value); }

    /**
     *
The page token to use to retrieve the next set of results. If there are no
     * additional results, this value is null.

     */
    inline void SetNextPageToken(const char* value) { m_nextPageToken.assign(value); }

    /**
     *
The page token to use to retrieve the next set of results. If there are no
     * additional results, this value is null.

     */
    inline ListOrganizationPortfolioAccessResult& WithNextPageToken(const Aws::String& value) { SetNextPageToken(value); return *this;}

    /**
     *
The page token to use to retrieve the next set of results. If there are no
     * additional results, this value is null.

     */
    inline ListOrganizationPortfolioAccessResult& WithNextPageToken(Aws::String&& value) { SetNextPageToken(std::move(value)); return *this;}

    /**
     *
The page token to use to retrieve the next set of results. If there are no
     * additional results, this value is null.

     */
    inline ListOrganizationPortfolioAccessResult& WithNextPageToken(const char* value) { SetNextPageToken(value); return *this;}

  private:

    Aws::Vector<OrganizationNode> m_organizationNodes;

    Aws::String m_nextPageToken;
  };

} // namespace Model
} // namespace ServiceCatalog
} // namespace Aws


text:
require 'spec_helper_acceptance'

describe 's3 class' do

  context 'default parameters' do
    # Using puppet_apply as a helper
    it 'should work idempotently with no errors' do
      pp = <<-EOS
      class { 's3': }
      EOS

      # Run it twice and test for idempotency
      apply_manifest(pp, :catch_failures => true)
      apply_manifest(pp, :catch_changes  => true)
    end

    describe package('aws-sdk') do
      it { is_expected.to be_installed }
    end

  end
end


text:
package org.colorcoding.tools.btulz.shell;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * 运行环境
 *
 * @author Niuren.Zhu
 *
 */
public class Environment {

	/**
	 * 命名空间-壳
	 */
	public static final String NAMESPACE_BTULZ_SHELL = "http://colorcoding.org/btulz/shell";

	/**
	 * 命名空间-壳-命令
	 */
	public static final String NAMESPACE_BTULZ_SHELL_COMMANDS = NAMESPACE_BTULZ_SHELL + "/commands";

	/**
	 * 程序启动的目录(主要的配置文件目录)
	 *
	 * @return
	 */
	public static String getStartupFolder() {
		try {
			String path = java.net.URLDecoder
					.decode(Environment.class.getProtectionDomain().getCodeSource().getLocation().getPath(), "UTF-8");
			if (path != null) {
				if (path.split(":").length > 2) {
					path = path.substring(path.indexOf(":") + 1, path.length());
				}
				if (path.indexOf("!") > 0) {
					path = path.substring(0, path.indexOf("!"));
				}
			}
			if (path == null) {
				path = System.getProperty("user.dir");
			}
			File file = new File(path);
			if (file.isFile()) {
				file = file.getParentFile();
			}
			if (file.getParentFile().isDirectory() && file.getParentFile().getName().equals("WEB-INF")) {
				// web路径
				file = file.getParentFile();
			}
			return file.getPath();
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 获取工作目录
	 *
	 * @return
	 */
	public static String getWorkingFolder() {
		return getStartupFolder();
	}

	/**
	 * 获取历史目录
	 *
	 * @return
	 */
	public static String getHistoryFolder() {
		return getWorkingFolder() + File.separator + "history";
	}

	/**
	 * 获取命令目录
	 *
	 * @return
	 */
	public static String getCommandsFolder() {
		return getWorkingFolder() + File.separator + "commands";
	}

	/**
	 * 获取资源地址
	 *
	 * @param type 资源名称
	 * @return 统一格式(此对象避免路径的中文问题)
	 * @throws URISyntaxException
	 */
	public static URI getResource(String name) throws URISyntaxException {
		URL url = Thread.currentThread().getContextClassLoader().getResource(name);
		if (url == null) {
			return null;
		}
		return url.toURI();
	}

}


text:
FROM php:7.2-apache

WORKDIR /var/www/

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
    apt-get update && \
    apt-get install -y nodejs && \
    apt-get install -y yarn && \
    apt-get install -y git && \
    a2enmod rewrite && \
    rm -r -f /var/www/html && \
    git clone https://github.com/enhavo/enhavo.git /var/www && \
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
    php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
    php composer-setup.php && \
    php -r "unlink('composer-setup.php');" && \
    apt-get install -y zlib1g-dev libicu-dev g++ && \
    apt-get install -y libpng-dev && \
    docker-php-ext-install intl && \
    docker-php-ext-install zip && \
    docker-php-ext-install pdo_mysql && \
    docker-php-ext-install gd && \
    docker-php-ext-install mbstring && \
    php composer.phar install --prefer-dist && \
    mkdir /var/startup && \
    git clone https://github.com/vishnubob/wait-for-it.git /var/startup/wait-for-it && \
    yarn install && \
    yarn encore prod

COPY etc/apache2/000-default.conf /etc/apache2/sites-available/000-default.conf
COPY etc/php/docker-php-enhavo.ini /usr/local/etc/php/conf.d/docker-php-enhavo.ini
COPY startup/startup.bash /var/startup/startup.bash
COPY startup/docker-php-enrypoint.sh /usr/local/bin/docker-php-entrypoint
COPY startup/install.bash /var/startup/install.bash

RUN chmod 755 /usr/local/bin/docker-php-entrypoint && \
    chmod 755 /var/startup/startup.bash && \
    chmod 755 /var/startup/install.bash && \
    chmod 755 /var/www/var && \
    bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json && \
    bin/console cache:warmup && \
    chown -R www-data:www-data /var/www/var

EXPOSE 80