text:
/**
 *     This code was auto-generated by a Codezu.
 *
 *     Changes to this file may cause incorrect behavior and will be lost if
 *     the code is regenerated.
 */
package com.mozu.api.resources.commerce.checkouts;

import com.mozu.api.ApiContext;
import java.util.List;
import java.util.ArrayList;
import com.mozu.api.MozuClient;
import com.mozu.api.MozuClientFactory;
import com.mozu.api.MozuUrl;
import com.mozu.api.Headers;
import org.joda.time.DateTime;
import com.mozu.api.AsyncCallback;
import java.util.concurrent.CountDownLatch;
import com.mozu.api.security.AuthTicket;
import org.apache.commons.lang.StringUtils;

/**
 * Use this resource to manage the items a shopper adds to their cart while the Checkouts resource is active (the Checkouts resource only applies to sites that enable shipping to multiple destinations within the same order). The Checkouts resource remains active until the shopper submits their order.
 *
 */
public class OrderItemResource {
	///
	/// <see cref="Mozu.Api.ApiContext"/>
	///
	private ApiContext _apiContext;

	public OrderItemResource(ApiContext apiContext)
	{
		_apiContext = apiContext;
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.splitItem( checkoutId,  itemId);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param itemId The unique identifier of the item.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout splitItem(String checkoutId, String itemId) throws Exception
	{
		return splitItem( checkoutId,  itemId,  null,  null);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.splitItem( checkoutId,  itemId, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param itemId The unique identifier of the item.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public CountDownLatch splitItemAsync(String checkoutId, String itemId, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		return splitItemAsync( checkoutId,  itemId,  null,  null, callback);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.splitItem( checkoutId,  itemId,  quantity,  responseFields);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param itemId The unique identifier of the item.
	 * @param quantity The number of cart items in the shopper's active cart.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout splitItem(String checkoutId, String itemId, Integer quantity, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.splitItemClient( checkoutId,  itemId,  quantity,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.splitItem( checkoutId,  itemId,  quantity,  responseFields, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param itemId The unique identifier of the item.
	 * @param quantity The number of cart items in the shopper's active cart.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public CountDownLatch splitItemAsync(String checkoutId, String itemId, Integer quantity, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.splitItemClient( checkoutId,  itemId,  quantity,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.bulkUpdateItemDestinations( itemsForDestination,  checkoutId);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param itemsForDestination A collection of items to be associated with a destination.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout bulkUpdateItemDestinations(List<com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination> itemsForDestination, String checkoutId) throws Exception
	{
		return bulkUpdateItemDestinations( itemsForDestination,  checkoutId,  null);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.bulkUpdateItemDestinations( itemsForDestination,  checkoutId, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param  callback callback handler for asynchronous operations
	 * @param itemsForDestination A collection of items to be associated with a destination.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination
	 */
	public CountDownLatch bulkUpdateItemDestinationsAsync(List<com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination> itemsForDestination, String checkoutId, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		return bulkUpdateItemDestinationsAsync( itemsForDestination,  checkoutId,  null, callback);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.bulkUpdateItemDestinations( itemsForDestination,  checkoutId,  responseFields);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @param itemsForDestination A collection of items to be associated with a destination.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout bulkUpdateItemDestinations(List<com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination> itemsForDestination, String checkoutId, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.bulkUpdateItemDestinationsClient( itemsForDestination,  checkoutId,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.bulkUpdateItemDestinations( itemsForDestination,  checkoutId,  responseFields, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @param  callback callback handler for asynchronous operations
	 * @param itemsForDestination A collection of items to be associated with a destination.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination
	 */
	public CountDownLatch bulkUpdateItemDestinationsAsync(List<com.mozu.api.contracts.commerceruntime.checkouts.ItemsForDestination> itemsForDestination, String checkoutId, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.bulkUpdateItemDestinationsClient( itemsForDestination,  checkoutId,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.addCheckoutItem( item,  checkoutId);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param item
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.orders.OrderItem
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout addCheckoutItem(com.mozu.api.contracts.commerceruntime.orders.OrderItem item, String checkoutId) throws Exception
	{
		return addCheckoutItem( item,  checkoutId,  null);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.addCheckoutItem( item,  checkoutId, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param  callback callback handler for asynchronous operations
	 * @param item
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.orders.OrderItem
	 */
	public CountDownLatch addCheckoutItemAsync(com.mozu.api.contracts.commerceruntime.orders.OrderItem item, String checkoutId, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		return addCheckoutItemAsync( item,  checkoutId,  null, callback);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.addCheckoutItem( item,  checkoutId,  responseFields);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @param item
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.orders.OrderItem
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout addCheckoutItem(com.mozu.api.contracts.commerceruntime.orders.OrderItem item, String checkoutId, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.addCheckoutItemClient( item,  checkoutId,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.addCheckoutItem( item,  checkoutId,  responseFields, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @param  callback callback handler for asynchronous operations
	 * @param item
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.orders.OrderItem
	 */
	public CountDownLatch addCheckoutItemAsync(com.mozu.api.contracts.commerceruntime.orders.OrderItem item, String checkoutId, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.addCheckoutItemClient( item,  checkoutId,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.updateItemDestination( checkoutId,  itemId,  destinationId);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param destinationId The unique identifier of the destination.
	 * @param itemId The unique identifier of the item.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout updateItemDestination(String checkoutId, String itemId, String destinationId) throws Exception
	{
		return updateItemDestination( checkoutId,  itemId,  destinationId,  null);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.updateItemDestination( checkoutId,  itemId,  destinationId, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param destinationId The unique identifier of the destination.
	 * @param itemId The unique identifier of the item.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public CountDownLatch updateItemDestinationAsync(String checkoutId, String itemId, String destinationId, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		return updateItemDestinationAsync( checkoutId,  itemId,  destinationId,  null, callback);
	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.updateItemDestination( checkoutId,  itemId,  destinationId,  responseFields);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param destinationId The unique identifier of the destination.
	 * @param itemId The unique identifier of the item.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout updateItemDestination(String checkoutId, String itemId, String destinationId, String responseFields) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.updateItemDestinationClient( checkoutId,  itemId,  destinationId,  responseFields);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.updateItemDestination( checkoutId,  itemId,  destinationId,  responseFields, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param destinationId The unique identifier of the destination.
	 * @param itemId The unique identifier of the item.
	 * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public CountDownLatch updateItemDestinationAsync(String checkoutId, String itemId, String destinationId, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.updateItemDestinationClient( checkoutId,  itemId,  destinationId,  responseFields);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	Checkout checkout = orderitem.deleteCheckoutItem( checkoutId,  itemId);
	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param itemId The unique identifier of the item.
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public com.mozu.api.contracts.commerceruntime.checkouts.Checkout deleteCheckoutItem(String checkoutId, String itemId) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.deleteCheckoutItemClient( checkoutId,  itemId);
		client.setContext(_apiContext);
		client.executeRequest();
		return client.getResult();

	}

	/**
	 *
	 *

	 *	OrderItem orderitem = new OrderItem();
	 *	CountDownLatch latch = orderitem.deleteCheckoutItem( checkoutId,  itemId, callback );
	 *	latch.await()	 *

	 * @param checkoutId The unique identifier of the checkout.
	 * @param itemId The unique identifier of the item.
	 * @param  callback callback handler for asynchronous operations
	 * @return com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 * @see com.mozu.api.contracts.commerceruntime.checkouts.Checkout
	 */
	public CountDownLatch deleteCheckoutItemAsync(String checkoutId, String itemId, AsyncCallback<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> callback) throws Exception
	{
		MozuClient<com.mozu.api.contracts.commerceruntime.checkouts.Checkout> client = com.mozu.api.clients.commerce.checkouts.OrderItemClient.deleteCheckoutItemClient( checkoutId,  itemId);
		client.setContext(_apiContext);
		return client.executeRequest(callback);

	}

}


text:
'use strict';

(function () {

  var module = angular.module('pnc.import');

  module.config(['$stateProvider', function ($stateProvider) {

    $stateProvider.state('import.product', {
      url: '/product',
      views: {
        'content@': {
          templateUrl: 'import/product/views/import.product.html',
          controller: 'ProductImportCtrl',
          controllerAs: 'ctrl'
        }
      },
      data: {
        //proxy: 'Create Release'
      },
      resolve: {
        //releaseDetail: function() { return null; }
      }
    });

  }]);
})();

redpajama_set_name: RedPajamaGithub


text: game = new Game();


text:
using CupCake.Messages.Blocks;

namespace CupCake.Messages.Send
{
    /// <summary>
    ///     Interface Block Place Send Event
    /// </summary>
    public interface IBlockPlaceSendEvent : IEncryptedSendEvent
    {
        /// <summary>
        ///     Gets or sets the layer.
        /// </summary>
        /// <value>
        ///     The layer.
        /// </value>
        Layer Layer { get; set; }

        /// <summary>
        ///     Gets or sets the x-coordinate.
        /// </summary>
        /// <value>
        ///     The x-coordinate.
        /// </value>
        int X { get; set; }

        /// <summary>
        ///     Gets or sets the y-coordinate.
        /// </summary>
        /// <value>
        ///     The y-coordinate.
        /// </value>
        int Y { get; set; }

        /// <summary>
        ///     Gets or sets the block.
        /// </summary>
        /// <value>
        ///     The block.
        /// </value>
        Block Block { get; set; }
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';

import ServiceRow from './ServiceRow';

/**
 * Get list of services and passes each incident information
 * to ServiceRow.
 *
 * @param {Array} services
 */
const ServiceList = ({ services }) => (

HTTP

      {services.map(service => (
        <ServiceRow data={service} key={service.id} />
      ))}

);

ServiceList.propTypes = {
  services: PropTypes.array
};

export default ServiceList;


text:
package requestHandler.commands;

/**
 * All commands-classes which process a certain request should inherit from this class.
 */
public abstract class Command {

	public static final String SUCCES_VAR = "successful";
	public static final String ERROR_VAR = "error";
	public static final String INT_ERROR = "Internal error";
	public static final String ADMIN_ERROR ="You are not an admin";

	/**
	 * Should be overwritten by every class which inherits from this class.
	 * @return Returns the result of the processing of the request.
	 */
	public String process(){
		return null;
	}

}


text:
package org.spongepowered.asm.mixin.transformer;

import org.spongepowered.asm.launch.MixinInitialisationError;
import org.spongepowered.asm.service.IMixinInternal;

/**
 * Factory for the mixin transformer, concrete instances of this class are only
 * provided to services since only the service should be able to decide when the
 * mixin transformer is initialised.
 */
public interface IMixinTransformerFactory extends IMixinInternal {

    /**
     * Create a new transformer.
     */
    public abstract IMixinTransformer createTransformer() throws MixinInitialisationError;

}


text:
Collection of technology demos (mostly C and WinAPI).

Currently available:
- ReadFile: Reading a (possibly empty) file using WinAPI memory mapping.
- WriteFile: Writing a (possibly empty) file using WinAPI memory mapping.
- Array: Dynamic arrays for Bytes and pointers.

Upcoming:
- Array: Dynamic dequeues for pointers.
- Message: Generic messages (mouse button, mouse pointer, keyboard key, ...) and generic message queues.


text:
[![Build status](https://img.shields.io/appveyor/ci/gsscoder/commandline.svg)](https://ci.appveyor.com/project/gsscoder/commandline)
[![Nuget](https://img.shields.io/nuget/dt/commandlineparser.svg)](http://nuget.org/packages/commandlineparser)
[![Nuget](https://img.shields.io/nuget/v/commandlineparser.svg)](http://nuget.org/packages/commandlineparser)
[![Nuget](https://img.shields.io/nuget/vpre/commandlineparser.svg)](http://nuget.org/packages/commandlineparser)
[![Join the gitter chat!](https://badges.gitter.im/gsscoder/commandline.svg)](https://gitter.im/gsscoder/commandline?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Command Line Parser Library 2.0.275.0 beta for CLR.
===

**Note:** the API surface has changed since 1.9.x and earlier. If you are looking for documentation on 1.9.x, please see [this branch](https://github.com/gsscoder/commandline/tree/stable-1.9.71.2)

The Command Line Parser Library offers CLR applications a clean and concise API for manipulating command line arguments and related tasks, such as defining switches, options and verb commands. It allows you to display a help screen with a high degree of customization and a simple way to report syntax errors to the end user.

Everything that is boring and repetitive about parsing command line arguments is delegated to the library, letting developers concentrate on core logic. It's written in **C#** and doesn't depend on other packages.

__This library provides _hassle free_ command line parsing with a constantly updated API since 2005.__

Compatibility:
---
  - .NET Framework 4.0+
  - Mono 2.1+ Profile
  - .Net Core

Current Release:
---
  - This is a __pre-release__, for documentation please read appropriate [wiki section](https://github.com/gsscoder/commandline/wiki/Latest-Version). From version **2.0.x-pre+** parsing kernel was rewritten and public API simplified.

At glance:
---
  - One line parsing using default singleton: `CommandLine.Parser.Default.ParseArguments(...)`.
  - Automatic or one line help screen generator: `HelpText.AutoBuild(...)`.
    - Supports `--help`, `--version`, `version` and `help [verb]` by default.
  - Map to sequences (`IEnumerable<T>`) or scalar types, including enum and `Nullable<T>`.
  - You can also map to every type with a constructor that accepts a string (like `System.Uri`).
  - __Plug-In friendly__ architecture as explained [here](https://github.com/gsscoder/commandline/wiki/Plug-in-Friendly-Architecture).
  - Define [verb commands](https://github.com/gsscoder/commandline/wiki/Latest-Version#verbs) as `git commit -a`.
  - Unparsing support: `CommandLine.Parser.Default.FormatCommandLine<T>(T options)`.
  - F#-friendly with support for `option<'a>`, see [demo](https://github.com/gsscoder/commandline/blob/master/demo/fsharp-demo.fsx).
  - Most of features applies with a [CoC](http://en.wikipedia.org/wiki/Convention_over_configuration) philosophy.
  - C# demo: source [here](https://github.com/gsscoder/commandline/tree/master/demo/ReadText.Demo).

To install:
---
  - NuGet way (latest stable): `Install-Package CommandLineParser`
  - NuGet way (latest version): `Install-Package CommandLineParser -pre`
  - XCOPY way: `cp -r ClonedRepo/src/CommandLine To/Your/Project/Dir`

To build:
---
- [FAKE](http://fsharp.github.io/FAKE/) Script
- MS Visual Studio
- Xamarin Studio

Public API:
---
Latest changes are recorded from Version 1.9.4.91, please refer to [this document](https://github.com/gsscoder/commandline/blob/master/docs/PublicAPI.md).

Used by:
---
- [FSharp.Formatting](https://github.com/tpetricek/FSharp.Formatting) by @tpetricek.
- [MiniDumper](https://github.com/goldshtn/minidumper) by @goldshtn.
- [Google APIs Client Library for .NET](https://github.com/google/google-api-dotnet-client) by Google.
- [FSpec](https://github.com/PeteProgrammer/fspec) by @PeteProgrammer.
- Various commercial products.

Notes:
---
The project is well suited to be included in your application. If you don't merge it to your project tree, you must reference `CommandLine.dll` and import `CommandLine` and `CommandLine.Text` namespaces (or install via NuGet). The help text builder and support types are in the `CommandLine.Text` namespace that is loosely coupled with the parser. It is good to know that the `HelpText` class will avoid a lot of repetitive coding.

**C#:**

Define a class to receive parsed values:
```csharp
class Options {
  [Option('r', "read", Required = true,
    HelpText = "Input files to be processed.")]
  public IEnumerable<string> InputFiles { get; set; }

  // Omitting long name, default --verbose
  [Option(
    HelpText = "Prints all messages to standard output.")]
  public bool Verbose { get; set; }

  [Option(Default = "中文",
    HelpText = "Content language.")]
  public string Language { get; set; }

  [Value(0, MetaName = "offset",
    HelpText = "File offset.")]
  public long? Offset { get; set; }
}
```
Consume them:
```csharp
static int Main(string[] args) {
  var options = new Options();
  var isValid = CommandLine.Parser.Default.ParseArgumentsStrict(args, options);
```
**F#:**
```fsharp
type options = {
  [<Option('r', "read", Required = true, HelpText = "Input files.")>] files : seq<string>;
  [<Option(HelpText = "Prints all messages to standard output.")>] verbose : bool;
  [<Option(Default = "русский", HelpText = "Content language.")>] language : string;
  [<Value(0, MetaName="offset", HelpText = "File offset.")>] offset : int64 option;
}
```
Consume them:
```fsharp
let main argv =
  let result = CommandLine.Parser.Default.ParseArguments<options>(argv)
  match result with
  | :? Parsed<options> as parsed -> run parsed.Value
  | :? NotParsed<options> as notParsed -> fail notParsed.Errors
```
**VB.NET:**
```VB.NET
Class Options
	<CommandLine.Option('r', "read", Required := true,
	HelpText:="Input files to be processed.")>
	Public Property InputFiles As IEnumerable(Of String)

    ' Omitting long name, default --verbose
    <CommandLine.Option(
	HelpText:="Prints all messages to standard output.")>
	Public Property Verbose As Boolean

	<CommandLine.Option(Default:="中文",
	HelpText:="Content language.")>
	Public Property Language As String

	<CommandLine.Value(0, MetaName:="offset",
	HelpText:="File offset.")>
	Public Property Offset As Long?
End Class
```
Consume them:
```VB.NET
TODO
```

For verbs:

**C#:**
```csharp
[Verb("add", HelpText = "Add file contents to the index.")]
class AddOptions {
  //normal options here
}
[Verb("commit", HelpText = "Record changes to the repository.")]
class CommitOptions {
  //normal options here
}
[Verb("clone", HelpText = "Clone a repository into a new directory.")]
class CloneOptions {
  //normal options here
}

int Main(string[] args) {
  return CommandLine.Parser.Default.ParseArguments<AddOptions, CommitOptions, CloneOptions>(args)
    .MapResult(
      (AddOptions opts) => RunAddAndReturnExitCode(opts),
      (CommitOptions opts) => RunCommitAndReturnExitCode(opts),
      (CloneOptions opts) => RunCloneAndReturnExitCode(opts),
      errs => 1);
}
```

**F#:**
```fsharp
open CommandLine

[<Verb("add", HelpText = "Add file contents to the index.")>]
type AddOptions = {
  // normal options here
}
[<Verb("commit", HelpText = "Record changes to the repository.")>]
type CommitOptions = {
  // normal options here
}
[<Verb("clone", HelpText = "Clone a repository into a new directory.")>]
type CloneOptions = {
  // normal options here
}

[<EntryPoint>]
let main args =
  let result = Parser.Default.ParseArguments<AddOptions, CommitOptions, CloneOptions> args
  match result with
  | :? CommandLine.Parsed<obj> as command ->
    match command.Value with
    | :? AddOptions as opts -> RunAddAndReturnExitCode opts
    | :? CommitOptions as opts -> RunCommitAndReturnExitCode opts
    | :? CloneOptions as opts -> RunCloneAndReturnExitCode opts
  | :? CommandLine.NotParsed<obj> -> 1
```
**VB.NET:**
```VB.NET
<CommandLine.Verb("add", HelpText:="Add file contents to the index.")>
Public Class AddOptions
	'Normal options here
End Class
<CommandLine.Verb("commit", HelpText:="Record changes to the repository.")>
Public Class AddOptions
	'Normal options here
End Class
<CommandLine.Verb("clone", HelpText:="Clone a repository into a new directory.")>
Public Class AddOptions
	'Normal options here
End Class

Public Shared Sub Main()
	'TODO
End Sub
```

Acknowledgements:
---
[![Jet Brains ReSharper](/art/resharper-logo.png)](http://www.jetbrains.com/resharper/)

Thanks to JetBrains for providing an open source license for [ReSharper](http://www.jetbrains.com/resharper/).

Main Contributors (alphabetical order):
- Alexander Fast (@mizipzor)
- Dan Nemec (@nemec)
- Kevin Moore (@gimmemoore)
- Steven Evans
- Thomas Démoulins (@Thilas)

Resources for newcomers:
---
  - [CodePlex](http://commandline.codeplex.com)
  - [Quickstart](https://github.com/gsscoder/commandline/wiki/Quickstart)
  - [Wiki](https://github.com/gsscoder/commandline/wiki)
  - [GNU getopt](http://www.gnu.org/software/libc/manual/html_node/Getopt.html)

Latest Changes:
---
  - Implemented issue #31 (double dash), thanks also to PR #77 by Tom Glastonbury (@tg73).
  - Merged pull request #87, thanks to @randacc.
  - Merged pull request #95, thanks to Dan Nemec (@nemec).
  - Merged pull request #97, thanks to @bolha7 and @nemec.
  - Merged pull request #103, thanks to @krs43.
  - Merged pull request #119, thanks to @andrecarlucci.
  - Added F# demo (as a simple script); removed specific API (work-in-progress) from solution.
  - Merged pull request #144, thanks to @JLRishe.
  - Merged pull request #154, thanks to @txdv.
  - Implemented issue #68 (option list behaviour).
  - Fixed issue #157 (range problems).
  - Fixed issue #159 (min constraint).
  - Fixed issue #160 (max constraint).
  - Fixed issue #161 (min/max constraint for values).
  - Increased test coverage.
  - Fixed issue #149 (valid numeric input for enums).
  - Fixed issue #164 (fixed bug in required value constraint).
  - Important fix on scalar string value adjacent to string sequence (without constraints).
  - Adding more tests for token partitioners.
  - Fix in `Sequence.Partition()`.
  - `Sequence.Partition()` rewritten.
  - Refactoring for Increase Testability.
  - Little change to allow .NET 4.5 build.
  - Better `GetHashCode()` implementations.
  - New tests added.
  - Fixing FAKE build script.
  - Issue #172 fixed (`Max` constraint when `Min=Max`).
  - Merged PR #171 from @mizipzor.
  - Issue #155 Fixed (fix from @guyzeug).
  - Added support for `FSharpOption<T>` (if not used no need to distribute `FSharp.Core.dll`).
  - Disallowed `Min=Max=0` for sequences, raising exception.
  - Issue #177 Fixed.
  - Issue #112 Fixed.
  - Support for **immutable types**.
  - PR #123 by @smbecker Merged.
  - Fixes.
  - Issue #179 Implemented (`Value|Option.DefaultValue` -> `Default`).
  - Issue #180 Implemented (better `ParserResult<T>` model).
  - Issue #181 Implemented.
  - Added `Return<TSource,TResult>(...)` to `ParserResult<TSource>`.
  - Issue #183 (option list in verb scenario) Fixed by @Thilas.
  - Issue #183 (immutable in verb scenario) reported by @Thilas Fixed.
  - Default `--help` command refactored.
  - Added `WithParsed<T>()` for verbs.
  - Added `Return<T1...T16>()` for verbs.
  - Automatic `--version` handling.
  - Added C# demo.
  - Issue #189 Implemented.
  - Issue #190 Fixed/Implemented (`--help`/`--version`/`version` for verbs).
  - Issue #188 (reported by @diversteve) Fixed.
  - Issue #191 (`--version`/`version` added to help screen) Fixed.
  - Issue #162 (`ValueAttribute` handled in help screen) Implemented.
  - PR #197 (by @Thilas) Implemented.
  - Issue #202 (reported by @StevenLiekens) Fixed.
  - Managing deps with Paket.
  - Issue #203 Implemented.
  - Issue #204 (reported by @Kimi-Arthur) Fixed.
  - PR #205 (by @forki) Merged.
  - Refactoring with `RailwaySharp.ErrorHandling`.
  - Test project refactoring.
  - Issue #186 Implemented: Adding unparse support.
  - PR #207 Merged.
  - Using new Paket-friendly CSharpx and RailwaySharp.
  - Added F# option support to `FormatCommandLine()`.
  - `ParserResult<T>` internally refactored, minor breaking changes to `HelpText`.
  - Added `FormatCommandLine()` overload with settings.
  - Issue #208 Implemented (extended usage text support).
  - Internal/external refactorings.
  - Minor `HelpText` refactorings.
  - Issue #210 (reported by @mac2000) Implemented.
  - Test refactorings.
  - Fixing XML comments.
  - Changes in usage text handling.
  - Issue #65 (re) Fixed for 2.0.x library.
  - Issue #218 Fixed (IgnoreUnknownArguments).
  - PR #215 (by @Thilas) Merged.
  - PR #216 (by @Thilas) Merged.
  - Issue #217 Fixed.
  - Renaming tests fakes.
  - Issue #220 Implemented.
  - Replacing Either<L,R> with Result<TSucc, TMsg>.
  - Centralizing `Tokenizer` configuration.
  - Issue #225 (reported by @rmunn) Fixed.
  - Issue #225/b (reported by @rmunn) Fixed.
  - All `ParserResult<T>.Return` renamed to `MapResult`.
  - PR #227 (by @Thilas) Merged.
  - Reverted back to `Tuple<...>` instead of `TokePartitions` type.
  - PR #227 (by @cfeilen) Merged.
  - PR #231 (by @kshanafelt) Merged.
  - Updated RailwaySharp source reference.
  - Internal refactoring.
  - Added properties test project using FsCheck.
  - Issue #241 (reported by @pvmraghunandan) Fixed.
  - PR #255 fixes Issue #254 by @scadorel Merged.

Contact:
---
Giacomo Stelluti Scala
  - gsscoder AT gmail DOT com (_use this for everything that is not available via GitHub features_)
  - [Blog](http://gsscoder.blogspot.it)
  - [Twitter](http://twitter.com/gsscoder)


text:
var x = 42;

Function.prototype.testFunction = function() {
  return [this, 42, this.call];
};

Object.defineProperty(Function.prototype, 'testGetter', {
  get: function() {
    return [this, x, this.call];
  },
  configurable: true
});

Object.defineProperty(Function.prototype, 'testSetter', {
  set: function(value) {
    x = [this, value, this.call];
  },
  configurable: true
});

class NoExtends {
  static method() {
    return super.testFunction();
  }

  static get getter() {
    return super.testGetter;
  }

  static set setter(value) {
    super.testSetter = value;
  }
}

var call = Function.prototype.call;
expect(NoExtends.method()).toEqual([NoExtends, 42, call]);

expect(NoExtends.getter).toEqual([NoExtends, 42, call]);

NoExtends.setter = 1;
expect(x).toEqual([NoExtends, 1, call]);

delete Function.prototype.testFunction;
delete Function.prototype.testGetter;
delete Function.prototype.testSetter;


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

/**
 * @fileoverview Definition of the DebugWindow class. Please minimize
 * dependencies this file has on other closure classes as any dependency it
 * takes won't be able to use the logging infrastructure.
 *
 */

goog.provide('goog.debug.DebugWindow');

goog.require('goog.debug.HtmlFormatter');
goog.require('goog.debug.LogManager');
goog.require('goog.debug.Logger');
goog.require('goog.structs.CircularBuffer');
goog.require('goog.userAgent');

/**
 * Provides a debug DebugWindow that is bound to the goog.debug.Logger.
 * It handles log messages and writes them to the DebugWindow. This doesn't
 * provide a lot of functionality that the old Gmail logging infrastructure
 * provided like saving debug logs for exporting to the server. Now that we
 * have an event-based logging infrastructure, we can encapsulate that
 * functionality in a separate class.
 *
 * @constructor
 * @param {string=} opt_identifier Identifier for this logging class.
 * @param {string=} opt_prefix Prefix prepended to messages.
 */
goog.debug.DebugWindow = function(opt_identifier, opt_prefix) {
  /**
   * Identifier for this logging class
<<<<<<< HEAD
   * @type {string}
   * @protected
   * @suppress {underscore}
   */
  this.identifier_ = opt_identifier || '';

  /**
   * Optional prefix to be prepended to error strings
   * @type {string}
   * @private
   */
  this.prefix_ = opt_prefix || '';

  /**
   * Array used to buffer log output
   * @type {Array}
   * @protected
   * @suppress {underscore}
   */
  this.outputBuffer_ = [];

  /**
   * Buffer for saving the last 1000 messages
   * @type {goog.structs.CircularBuffer}
   * @private
=======
   * @protected {string}
   */
  this.identifier = opt_identifier || '';

  /**
   * Array used to buffer log output
   * @protected {!Array}
   */
  this.outputBuffer = [];

  /**
   * Optional prefix to be prepended to error strings
   * @private {string}
   */
  this.prefix_ = opt_prefix || '';

  /**
   * Buffer for saving the last 1000 messages
   * @private {!goog.structs.CircularBuffer}
>>>>>>> newgitrepo
   */
  this.savedMessages_ =
      new goog.structs.CircularBuffer(goog.debug.DebugWindow.MAX_SAVED);

  /**
   * Save the publish handler so it can be removed
<<<<<<>>>>>> newgitrepo
   */
  this.publishHandler_ = goog.bind(this.addLogRecord, this);

  /**
   * Formatter for formatted output
<<<<<<>>>>>> newgitrepo
   */
  this.formatter_ = new goog.debug.HtmlFormatter(this.prefix_);

  /**
   * Loggers that we shouldn't output
<<<<<<>>>>>> newgitrepo
   */
  this.filteredLoggers_ = {};

  // enable by default
  this.setCapturing(true);

  /**
   * Whether we are currently enabled. When the DebugWindow is enabled, it tries
   * to keep its window open. When it's disabled, it can still be capturing log
   * output if, but it won't try to write them to the DebugWindow window until
   * it's enabled.
<<<<<<>>>>>> newgitrepo

  // timer to save the DebugWindow's window position in a cookie
  goog.global.setInterval(goog.bind(this.saveWindowPositionSize_, this), 7500);
};

/**
 * Max number of messages to be saved
 * @type {number}
 */
goog.debug.DebugWindow.MAX_SAVED = 500;

/**
 * How long to keep the cookies for in milliseconds
 * @type {number}
 */
goog.debug.DebugWindow.COOKIE_TIME = 30 * 24 * 60 * 60 * 1000; // 30-days

/**
 * HTML string printed when the debug window opens
 * @type {string}
 * @protected
 */
goog.debug.DebugWindow.prototype.welcomeMessage = 'LOGGING';

/**
 * Whether to force enable the window on a severe log.
 * @type {boolean}
 * @private
 */
goog.debug.DebugWindow.prototype.enableOnSevere_ = false;

/**
 * Reference to debug window
 * @type {Window}
 * @protected
 * @suppress {underscore}
 */
goog.debug.DebugWindow.prototype.win_ = null;

/**
 * In the process of opening the window
 * @type {boolean}
 * @private
 */
goog.debug.DebugWindow.prototype.winOpening_ = false;

/**
 * Whether we are currently capturing logger output.
 *
 * @type {boolean}
 * @private
 */
goog.debug.DebugWindow.prototype.isCapturing_ = false;

/**
 * Whether we already showed an alert that the DebugWindow was blocked.
 * @type {boolean}
 * @private
 */
goog.debug.DebugWindow.showedBlockedAlert_ = false;

/**
 * Reference to timeout used to buffer the output stream.
 * @type {?number}
 * @private
 */
goog.debug.DebugWindow.prototype.bufferTimeout_ = null;

/**
 * Timestamp for the last time the log was written to.
<<<<<<>>>>>> newgitrepo

/**
 * Sets the welcome message shown when the window is first opened or reset.
 *
 * @param {string} msg An HTML string.
 */
goog.debug.DebugWindow.prototype.setWelcomeMessage = function(msg) {
  this.welcomeMessage = msg;
};

/**
 * Initializes the debug window.
 */
goog.debug.DebugWindow.prototype.init = function() {
  if (this.enabled_) {
    this.openWindow_();
  }
};

/**
 * Whether the DebugWindow is enabled. When the DebugWindow is enabled, it
 * tries to keep its window open and logs all messages to the window.  When the
 * DebugWindow is disabled, it stops logging messages to its window.
 *
 * @return {boolean} Whether the DebugWindow is enabled.
 */
goog.debug.DebugWindow.prototype.isEnabled = function() {
  return this.enabled_;
};

/**
 * Sets whether the DebugWindow is enabled. When the DebugWindow is enabled, it
 * tries to keep its window open and log all messages to the window. When the
 * DebugWindow is disabled, it stops logging messages to its window. The
 * DebugWindow also saves this state to a cookie so that it's persisted across
 * application refreshes.
 * @param {boolean} enable Whether the DebugWindow is enabled.
 */
goog.debug.DebugWindow.prototype.setEnabled = function(enable) {
  this.enabled_ = enable;

  if (this.enabled_) {
    this.openWindow_();
  }

  this.setCookie_('enabled', enable ? '1' : '0');
};

/**
 * Sets whether the debug window should be force enabled when a severe log is
 * encountered.
 * @param {boolean} enableOnSevere Whether to enable on severe logs..
 */
goog.debug.DebugWindow.prototype.setForceEnableOnSevere =
    function(enableOnSevere) {
  this.enableOnSevere_ = enableOnSevere;
};

/**
 * Whether we are currently capturing logger output.
 * @return {boolean} whether we are currently capturing logger output.
 */
goog.debug.DebugWindow.prototype.isCapturing = function() {
  return this.isCapturing_;
};

/**
 * Sets whether we are currently capturing logger output.
 * @param {boolean} capturing Whether to capture logger output.
 */
goog.debug.DebugWindow.prototype.setCapturing = function(capturing) {
  if (capturing == this.isCapturing_) {
    return;
  }
  this.isCapturing_ = capturing;

  // attach or detach handler from the root logger
  var rootLogger = goog.debug.LogManager.getRoot();
  if (capturing) {
    rootLogger.addHandler(this.publishHandler_);
  } else {
    rootLogger.removeHandler(this.publishHandler_);
  }
};

/**
 * Gets the formatter for outputting to the debug window. The default formatter
 * is an instance of goog.debug.HtmlFormatter
 * @return {goog.debug.Formatter} The formatter in use.
 */
goog.debug.DebugWindow.prototype.getFormatter = function() {
  return this.formatter_;
};

/**
 * Sets the formatter for outputting to the debug window.
 * @param {goog.debug.Formatter} formatter The formatter to use.
 */
goog.debug.DebugWindow.prototype.setFormatter = function(formatter) {
  this.formatter_ = formatter;
};

/**
 * Adds a separator to the debug window.
 */
goog.debug.DebugWindow.prototype.addSeparator = function() {
  this.write_('
');
};

/**
 * @return {boolean} Whether there is an active window.
 */
goog.debug.DebugWindow.prototype.hasActiveWindow = function() {
  return !!this.win_ && !this.win_.closed;
};

/**
 * Clears the contents of the debug window
 * @protected
<<<<<<>>>>>> newgitrepo
  this.savedMessages_.clear();
  if (this.hasActiveWindow()) {
    this.writeInitialDocument();
  }
};

/**
 * Adds a log record.
 * @param {goog.debug.LogRecord} logRecord the LogRecord.
 */
goog.debug.DebugWindow.prototype.addLogRecord = function(logRecord) {
  if (this.filteredLoggers_[logRecord.getLoggerName()]) {
    return;
  }
  var html = this.formatter_.formatRecord(logRecord);
  this.write_(html);
  if (this.enableOnSevere_ &&
      logRecord.getLevel().value >= goog.debug.Logger.Level.SEVERE.value) {
    this.setEnabled(true);
  }
};

/**
 * Writes a message to the log, possibly opening up the window if it's enabled,
 * or saving it if it's disabled.
 * @param {string} html The HTML to write.
 * @private
 */
goog.debug.DebugWindow.prototype.write_ = function(html) {
  // If the logger is enabled, open window and write html message to log
  // otherwise save it
  if (this.enabled_) {
    this.openWindow_();
    this.savedMessages_.add(html);
    this.writeToLog_(html);
  } else {
    this.savedMessages_.add(html);
  }
};

/**
 * Write to the buffer.  If a message hasn't been sent for more than 750ms just
 * write, otherwise delay for a minimum of 250ms.
 * @param {string} html HTML to post to the log.
 * @private
 */
goog.debug.DebugWindow.prototype.writeToLog_ = function(html) {
<<<<<< 750) {
=======
  this.outputBuffer.push(html);
  goog.global.clearTimeout(this.bufferTimeout_);

  if (goog.now() - this.lastCall > 750) {
>>>>>>> newgitrepo
    this.writeBufferToLog();
  } else {
    this.bufferTimeout_ =
        goog.global.setTimeout(goog.bind(this.writeBufferToLog, this), 250);
  }
};

/**
 * Write to the log and maybe scroll into view.
 * @protected
 */
goog.debug.DebugWindow.prototype.writeBufferToLog = function() {
<<<<<<>>>>>> newgitrepo
  if (this.hasActiveWindow()) {
    var body = this.win_.document.body;
    var scroll = body &&
        body.scrollHeight - (body.scrollTop + body.clientHeight) <= 100;

<<<<<<>>>>>> newgitrepo

    if (scroll) {
      this.win_.scrollTo(0, 1000000);
    }
  }
};

/**
 * Writes all saved messages to the DebugWindow.
 * @protected
<<<<<<>>>>>> newgitrepo
  var messages = this.savedMessages_.getValues();
  for (var i = 0; i < messages.length; i++) {
    this.writeToLog_(messages[i]);
  }
};

/**
 * Opens the debug window if it is not already referenced
 * @private
 */
goog.debug.DebugWindow.prototype.openWindow_ = function() {
  if (this.hasActiveWindow() || this.winOpening_) {
    return;
  }

  var winpos = this.getCookie_('dbg', '0,0,800,500').split(',');
  var x = Number(winpos[0]);
  var y = Number(winpos[1]);
  var w = Number(winpos[2]);
  var h = Number(winpos[3]);

  this.winOpening_ = true;
  this.win_ = window.open('', this.getWindowName_(), 'width=' + w +
                          ',height=' + h + ',toolbar=no,resizable=yes,' +
                          'scrollbars=yes,left=' + x + ',top=' + y +
                          ',status=no,screenx=' + x + ',screeny=' + y);

  if (!this.win_) {
    if (!this.showedBlockedAlert_) {
      // only show this once
      alert('Logger popup was blocked');
      this.showedBlockedAlert_ = true;
    }
  }

  this.winOpening_ = false;

  if (this.win_) {
    this.writeInitialDocument();
  }
};

/**
 * Gets a valid window name for the debug window. Replaces invalid characters in
 * IE.
 * @return {string} Valid window name.
 * @private
 */
goog.debug.DebugWindow.prototype.getWindowName_ = function() {
  return goog.userAgent.IE ?
<<<<<<>>>>>> newgitrepo
};

/**
 * @return {string} The style rule text, for inclusion in the initial HTML.
 */
goog.debug.DebugWindow.prototype.getStyleRules = function() {
  return '*{font:normal 14px monospace;}' +
         '.dbg-sev{color:#F00}' +
         '.dbg-w{color:#E92}' +
         '.dbg-sh{background-color:#fd4;font-weight:bold;color:#000}' +
         '.dbg-i{color:#666}' +
         '.dbg-f{color:#999}' +
         '.dbg-ev{color:#0A0}' +
         '.dbg-m{color:#990}';
};

/**
 * Writes the initial HTML of the debug window.
 * @protected
 */
goog.debug.DebugWindow.prototype.writeInitialDocument = function() {
  if (!this.hasActiveWindow()) {
    return;
  }

  this.win_.document.open();

  var html = '' +
             '

' +
             this.welcomeMessage + '
Logger: ' +
<<<<<<< HEAD
             this.identifier_ + '

';

  this.writeToLog_(html);
  this.writeSavedMessages_();
=======
             this.identifier + '

';

  this.writeToLog_(html);
  this.writeSavedMessages();
>>>>>>> newgitrepo
};

/**
 * Save persistent data (using cookies) for 1 month (cookie specific to this
 * logger object).
 * @param {string} key Data name.
 * @param {string} value Data value.
 * @private
 */
goog.debug.DebugWindow.prototype.setCookie_ = function(key, value) {
<<<<<<>>>>>> newgitrepo
  document.cookie = fullKey + '=' + encodeURIComponent(value) +
      ';path=/;expires=' +
      (new Date(goog.now() + goog.debug.DebugWindow.COOKIE_TIME)).toUTCString();
};

/**
 * Retrieve data (using cookies).
 * @param {string} key Data name.
 * @param {string=} opt_default Optional default value if cookie doesn't exist.
 * @return {string} Cookie value.
 * @private
 */
goog.debug.DebugWindow.prototype.getCookie_ = function(key, opt_default) {
  return goog.debug.DebugWindow.getCookieValue_(
<<<<<<>>>>>> newgitrepo
};

/**
 * Creates a valid cookie key name which is scoped to the given identifier.
 * Substitutes all occurences of invalid cookie name characters (whitespace,
 * ';', and '=') with '_', which is a valid and readable alternative.
 * @see goog.net.Cookies#isValidName
 * @see RFC 2109
 * @param {string} identifier Identifier for logging class.
 * @param {string} key Data name.
 * @return {string} Cookie key name.
 * @private
 */
goog.debug.DebugWindow.getCookieKey_ = function(identifier, key) {
  var fullKey = key + identifier;
  return fullKey.replace(/[;=\s]/g, '_');
};

/**
 * Retrieve data (using cookies).
 * @param {string} identifier Identifier for logging class.
 * @param {string} key Data name.
 * @param {string=} opt_default Optional default value if cookie doesn't exist.
 * @return {string} Cookie value.
 * @private
 */
goog.debug.DebugWindow.getCookieValue_ = function(
    identifier, key, opt_default) {
  var fullKey = goog.debug.DebugWindow.getCookieKey_(identifier, key);
  var cookie = String(document.cookie);
  var start = cookie.indexOf(fullKey + '=');
  if (start != -1) {
    var end = cookie.indexOf(';', start);
    return decodeURIComponent(cookie.substring(start + fullKey.length + 1,
        end == -1 ? cookie.length : end));
  } else {
    return opt_default || '';
  }
};

/**
 * @param {string} identifier Identifier for logging class.
 * @return {boolean} Whether the DebugWindow is enabled.
 */
goog.debug.DebugWindow.isEnabled = function(identifier) {
  return goog.debug.DebugWindow.getCookieValue_(identifier, 'enabled') == '1';
};

/**
 * Saves the window position size to a cookie
 * @private
 */
goog.debug.DebugWindow.prototype.saveWindowPositionSize_ = function() {
  if (!this.hasActiveWindow()) {
    return;
  }
  var x = this.win_.screenX || this.win_.screenLeft || 0;
  var y = this.win_.screenY || this.win_.screenTop || 0;
  var w = this.win_.outerWidth || 800;
  var h = this.win_.outerHeight || 500;
  this.setCookie_('dbg', x + ',' + y + ',' + w + ',' + h);
};

/**
 * Adds a logger name to be filtered.
 * @param {string} loggerName the logger name to add.
 */
goog.debug.DebugWindow.prototype.addFilter = function(loggerName) {
  this.filteredLoggers_[loggerName] = 1;
};

/**
 * Removes a logger name to be filtered.
 * @param {string} loggerName the logger name to remove.
 */
goog.debug.DebugWindow.prototype.removeFilter = function(loggerName) {
  delete this.filteredLoggers_[loggerName];
};

/**
 * Modify the size of the circular buffer. Allows the log to retain more
 * information while the window is closed.
 * @param {number} size New size of the circular buffer.
 */
goog.debug.DebugWindow.prototype.resetBufferWithNewSize = function(size) {
  if (size > 0 && size < 50000) {
<<<<<<>>>>>> newgitrepo
    this.savedMessages_ = new goog.structs.CircularBuffer(size);
  }
};


text:
import {Injectable} from "@angular/core";
import {Contact} from "../models/contact";
import {Observable} from "rxjs";
import {Http, Headers, RequestOptions, Response} from "@angular/http";

@Injectable()
export class ContactService{
  private contactUrl = "/api/contact";

  constructor(private http: Http) {
  }

  sendEmail (body: Object): Observable<Contact> {
    let bodyString = JSON.stringify(body);
    let headers      = new Headers({ 'Content-Type': 'application/json' });
    let options = new RequestOptions({ headers: headers });

    return this.http.post(this.contactUrl, bodyString, options)
      .map((res:Response) => res.json())
      .catch((error:any) => Observable.throw(error.json().error || 'Server error'));
  }
}


text:
import config from '../config';

const makeHref = req => {
  const protocol = config.protocol || req.protocol;
  const host = req.get('host');
  return path => `${protocol}://${host}${path}`;
};

export default (req, res, next) => {
  req.href = makeHref(req);
  if (next) return next();
};


text:
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT


text:
VBoxService --foreground --verbose --only-automount 2>&1 | \
while read line
do
  mount_log=$(echo $line | grep automount)

  if [ $? -eq 0 ] ; then
    mount_src=$(echo "$mount_log" | cut --delimiter '"' --fields 2)
    mount_target=$(echo "$mount_log" | cut --delimiter '"' --fields 4)

    echo "Mounting ${mount_src} on ${mount_target}"
    nsenter --mount=/hproc/1/ns/mnt mkdir -p "$mount_target"
    nsenter --mount=/hproc/1/ns/mnt mount -t vboxsf "$mount_src" "$mount_target"
  fi
done


text:
http://www.futaba-kikaku.jp/

# Installation

# Todo

# authors

* Hideya Ochiai
* Hiroyuki Ikegami


text:
<?php

namespace openacalendar\staticweb\errors;

class ConfigErrorInvalidTheme extends BaseError {

}


text:
<?php
/*
Section: email-forgot-password
Language: German
*/

$translations = array(
    'email' => 'Wir haben Ihre Anfrage für ein neues Passwort Ihres db4free.net Accounts "{$user}" erhalten.

Ihr neues Passwort lautet {$newData}

Bitte bestätigen Sie diesen Link, um das neue Passwort zu aktivieren:

{$mailLink}

Wenn Sie kein neues Passwort angefordert haben, bitten wir Sie, diese Email zu ignorieren!

Wir hoffen, dass Sie viel Freude mit Ihrer Datenbank haben!

Ihr db4free.net Team
http://www.db4free.net',
);
?>


text:
package org.jmockring.ri.mvc;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.InternalResourceView;

/**
 * @author Pavel Lechev
 * @version 0.0.1
 * @date 09/03/13
 */
@Controller
@RequestMapping("/controller")
public class SpringController {

    @Autowired
    private WebApplicationContext context;

    @RequestMapping("test")
    public String getTest(Model model) {
        model.addAttribute("attributeOne", "[Value One]");
        model.addAttribute("attributeTwo", "[Value Two]");
        return "test";
    }

    @RequestMapping("raw")
    public ModelAndView getRaw() {
        ModelAndView mav = new ModelAndView();
        mav.addObject("attributeOne", "[Value One]");
        mav.addObject("attributeTwo", "[Value Two]");
        InternalResourceView view = new InternalResourceView("/WEB-INF/jsp/test.jsp");
        view.setApplicationContext(context);
        view.setServletContext(context.getServletContext());
        mav.setView(view);
        return mav;
    }

    @RequestMapping("direct")
    public void getDirect(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String body = "[GET OK] URI=" + req.getRequestURI();
        resp.setHeader("Content-Type", "text/plain");
        resp.setHeader("Content-Length", "" + body.length());
        PrintWriter pw = new PrintWriter(resp.getOutputStream());
        pw.write(body);
        pw.flush();
        pw.close();
    }

}


text:
import './greeting.less';
export {default} from './greeting.js';


text:
var express = require('express');
var path = require('path');
var User = require('./../db/user');
var router = express.Router();
var querystring = require("querystring");
var mongoose = require('mongoose');

router.get('/', function(req, res) {
    res.sendFile(path.join(__dirname, '../view', 'Modify.html'));
});

router.post('/edit', function(req, res) {
    var body = '';
    req.on('data', function(data) {
        body += data;
    });
    req.on('end', function() {

        var para = querystring.parse(body);
        var old_password = para.old_Password;
        var new_password = para.new_Password;
        var in_name = para.Account;

        // TODO: Avoid Callback Hell (Use findOne.exec())
        // TODO: Room save error handler, success handler
        User.findOne({
            name: in_name
        }, function(err, user) {
            if (err) return console.log(err);
            if (user != null && user.password == old_password) {
                user.password = new_password;
                user.save(function(err, updatedUser) {
                    if (err) return console.error(err);
                    res.send({
                        msg: "success"
                    });
                });
            } else {
                res.send({
                    msg: "fail"
                });
            }
        });
    })

});

module.exports = router;


text:
package com.mc.redis;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PushbackInputStream;
import java.math.BigInteger;
import java.nio.charset.Charset;

import com.mc.redis.exception.UnexpectedBytesException;
import com.mc.redis.exception.UnexpectedEndOfStreamException;

public class RedisUniversalProtocol implements RedisProtocol {

    @Override
    public void writeRequest(OutputStream out, String cmd, byte[]... args)
            throws RedisException {
        try {
            if (cmd == null) throw new NullPointerException("Command cannot be null in a request to Redis");
            out.write(MULTI_BULK_INDICATOR);
            int numParts = (args == null) ? 1 : (args.length + 1);
            out.write(intToByteArray(numParts));
            out.write(REDIS_DELIM);
            out.write(BULK_INDICATOR);
            out.write(intToByteArray(cmd.length()));
            out.write(REDIS_DELIM);
            out.write(cmd.getBytes(utf8));
            out.write(REDIS_DELIM);
            if (args != null) {
                for (int i=0; i<args.length; i++) {
                    byte[] bytes = args[i];
                    out.write(BULK_INDICATOR);
                    out.write(intToByteArray(bytes == null ? -1 : bytes.length));
                    out.write(REDIS_DELIM);
                    if (bytes != null) {
                        out.write(args[i]);
                        out.write(REDIS_DELIM);
                    }
                }
            }
            out.flush();
        } catch (Exception e) {
            throw new RedisException(e);
        }
    }

    @Override
    public void writeRequest(OutputStream out, String cmd, String... args)
            throws RedisException {
        if (args == null) {
            writeRequest(out, cmd, (byte[][])null);
        } else {
            byte[][] byteArgs = new byte[args.length][];
            for (int i=0; i<args.length; i++) {
                byteArgs[i] = args[i] == null ? null : args[i].getBytes(utf8);
            }
            writeRequest(out, cmd, byteArgs);
        }
    }

    @Override
    public void writeRequest(OutputStream out, String cmd)
            throws RedisException {
        writeRequest(out, cmd, (byte[][])null);
    }

    @Override
    public String readSingleLineReply(InputStream in) throws RedisException {
        PushbackInputStream pin = new PushbackInputStream(in, 3);
        try {
            checkForErrorResponse(pin);
            ensureExpectedType(pin,  ResponseType.SINGLE_LINE);
            return readToEOL(pin);
        } catch (RedisException e) {
            throw e;
        } catch (Exception e) {
            throw new RedisException(e);
        }
    }

    @Override
    public BigInteger readBigInt(InputStream in) throws RedisException {
        PushbackInputStream pin = new PushbackInputStream(in, 3);
        try {
            checkForErrorResponse(pin);
            ensureExpectedType(pin, ResponseType.NUMBER);
            String val = readToEOL(pin);
            return new BigInteger(val);
        } catch (RedisException e) {
            throw e;
        } catch (Exception e) {
            throw new RedisException(e);
        }
    }

    @Override
    public int readSmallInt(InputStream in) throws RedisException {
        return readBigInt(in).intValue();
    }

    @Override
    public long readLong(InputStream in) throws RedisException {
        return readBigInt(in).longValue();
    }

    @Override
    public boolean readBoolean(InputStream in) throws RedisException {
        int val = readSmallInt(in);
        switch (val) {
        case 0:
            return false;
        case 1:
            return true;
        default:
            throw new RedisException("Unexpected value when checking a boolean: " + val);
        }
    }

    @Override
    public byte[] readBulkReplyBinary(InputStream in) throws RedisException {
        PushbackInputStream pin = new PushbackInputStream(in, 3);
        try {
            checkForErrorResponse(pin);
            if (isNullResponse(pin)) return null;
            ensureExpectedType(pin,  ResponseType.BULK);
            return readValue(pin);
        } catch (RedisException e) {
            throw e;
        } catch (Exception e) {
            throw new RedisException(e);
        }
    }

    @Override
    public String readBulkReply(InputStream in, Charset charset) throws RedisException {
        byte[] bytes = readBulkReplyBinary(in);
        if (bytes == null) return null;
        return new String(bytes, charset);
    }

    @Override
    public String readBulkReply(InputStream in) throws RedisException {
        return readBulkReply(in, utf8);
    }

    @Override
    public byte[][] readMultiBulkReplyBinary(InputStream in) throws RedisException {
        PushbackInputStream pin = new PushbackInputStream(in, 3);
        try {
            checkForErrorResponse(pin);
            if (isNullResponse(pin)) return null;
            ensureExpectedType(pin, ResponseType.MULTI_BULK);

            int numBulks = readNumber(pin);
            byte[][] byteArrays = new byte[numBulks][];

            for (int i=0; i<numBulks; i++) {
                byteArrays[i] = readBulkReplyBinary(pin);
            }

            return byteArrays;
        } catch (RedisException e) {
            throw e;
        } catch (Exception e) {
            throw new RedisException(e);
        }
    }

    @Override
    public String[] readMultiBulkReply(InputStream in, Charset charset) throws RedisException {
        byte[][] bytes = readMultiBulkReplyBinary(in);
        if (bytes == null) return null;
        String[] resp = new String[bytes.length];
        for (int i=0; i<bytes.length; i++) {
            if (bytes[i] == null) resp[i] = null;
            else resp[i] = new String(bytes[i], charset);
        }
        return resp;
    }

    @Override
    public String[] readMultiBulkReply(InputStream in) throws RedisException {
        return readMultiBulkReply(in, utf8);
    }

    /*
     * Convert the integer to a byte array containing the UFT-8 encoded equivalent
     */
    private byte[] intToByteArray(int number) {
        return String.valueOf(number).getBytes(utf8);
    }

    /*
     * At the beginning of a response, check for a '-' and throw an
     * exception with the message, if found
     */
    private void checkForErrorResponse(PushbackInputStream pin) throws IOException {
        int indicator = pin.read();
        switch (indicator) {
        case EOS:
            throw new UnexpectedEndOfStreamException();
        case MINUS:
            throw new RedisErrorResponse(readToEOL(pin));
        default:
            pin.unread(indicator);
        }
    }

    /*
     * For single-line & error messages, read all the bytes up to the /r/n
     * and return.
     * This method also removes the trailing /r/n.
     *
     * NOTE:
     * This method is NOT safe for reading Bulk or Multi-Bulk messages, only
     * single-line, error, and potentially number responses
     */
    private String readToEOL(PushbackInputStream pin) throws IOException {
        StringBuilder sb = new StringBuilder();
        while (true) {
            int b = pin.read();
            while (EOS != b && CR != b) {
                sb.append((char)b);
                b = pin.read();
            }
            if (EOS == b)
                throw new UnexpectedEndOfStreamException();
            if (CR == b) {
                int b2 = pin.read();
                if (LF == b2)
                    return sb.toString();
                sb.append((char)b).append((char)b2);
            }
        }
    }

    /*
     * The thing about this method, is that it assumes you've already read
     * past the type indicator byte.  It reads the length of the value, and
     * then returns that many bytes.
     */
    private byte[] readValue(PushbackInputStream pin) throws IOException {
        int len = readNumber(pin);
        byte[] bytes = readBytes(pin, len);
        if (pin.read() == CR && pin.read() == LF)
            return bytes;
        throw new UnexpectedBytesException("The Redis Response didn't end when expected");
    }

    /*
     * Returns the next 'n' bytes from the InputStream
     */
    private byte[] readBytes(PushbackInputStream pin, int len) throws IOException {
        byte[] bytes = new byte[len];
        int bytesRead = 0;
        while (bytesRead < len) {
            int newBytesRead = pin.read(bytes, bytesRead, len-bytesRead);
            if (EOS == newBytesRead) throw new UnexpectedEndOfStreamException();
            bytesRead += newBytesRead;
        }
        return bytes;
    }

    /*
     * Ensures the InputStream is at the beginning of a response of
     * the expected type.  Throws an exception if not.
     */
    private void ensureExpectedType(PushbackInputStream pin, ResponseType expected) throws IOException {
        char typeIndicator = (char) pin.read();
        if (expected.indicator != typeIndicator) {
            String msg = String.format(unexpectedFormat, expected, expected.indicator, typeIndicator);
            throw new RedisException(msg);
        }
    }

    /*
     * Bulk messages use a message length of -1 to indicate null
     */
    private boolean isNullResponse(PushbackInputStream pin) throws IOException {
        int type = pin.read();
        byte[] bytes = readBytes(pin, 2);
        if (bytes[0] == MINUS && bytes[1] == ONE) {
            if (CR == pin.read() && LF == pin.read())
                return true;
            throw new IllegalStateException("No CRLF terminator after nil bulk reply");
        }
        pin.unread(bytes);
        pin.unread(type);
        return false;
    }

    /*
     * Read the number starting at the current position and ending
     * at /r/n
     */
    private final int readNumber(PushbackInputStream in) throws IOException {
        int raw = in.read();
        int val = 0;
        while (CR != raw && EOS != raw) {
            Character.digit(raw, 10);
            val = val*10 + Character.digit(raw, 10);
            raw = in.read();
        }
        if (EOS != raw && LF == in.read()) {
            return val;
        }
        throw new IllegalStateException("Couldn't read segment length");
    }

    private static final int CR = 13;
    private static final int LF = 10;
    private static final int EOS = -1;
    private static final int MINUS = '-';
    private static final int ONE = '1';

    private static final Charset utf8 = Charset.forName("UTF-8");

    private static byte MULTI_BULK_INDICATOR = "*".getBytes(utf8)[0];
    private static byte BULK_INDICATOR = "$".getBytes(utf8)[0];
    private static byte[] REDIS_DELIM = "\r\n".getBytes(utf8);

    private static final String unexpectedFormat =
        "Expected a %s which begins with a '%s', got '%s' instead.";
}


text:
class Chef
  NOT_PASSED = Object.new if !defined?(NOT_PASSED)
  # Earlier versions of Chef didn't have this message
  module ChefCompatDeprecation
    def log_deprecation(message, location=nil)
      if !location
        # Pick the first caller that is *not* part of the Chef or ChefCompat gem,
        # that's the thing the user wrote.
        chef_compat_gem_path = File.expand_path("../../..", __FILE__)
        chef_gem_path = File.expand_path("../..",::Chef::Resource.instance_method(:initialize).source_location[0])
        caller(0..10).each do |c|
          if !c.start_with?(chef_gem_path) && !c.start_with?(chef_compat_gem_path)
            location = c
            break
          end
        end
      end

      begin
        super
        # Bleagh. `super_method` doesn't exist on older rubies and I haven't
        # figured out a way to check for its existence otherwise.
      rescue NoMethodError
        Chef::Log.warn(message)
      end
    end
  end

  class<<self
    prepend ChefCompatDeprecation
  end

end


text:
@implementation SDLTouchEventCapabilities

- (instancetype)init {
    if (self = [super init]) {
    }
    return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
    if (self = [super initWithDictionary:dict]) {
    }
    return self;
}

- (void)setPressAvailable:(NSNumber *)pressAvailable {
    if (pressAvailable != nil) {
        [store setObject:pressAvailable forKey:NAMES_pressAvailable];
    } else {
        [store removeObjectForKey:NAMES_pressAvailable];
    }
}

- (NSNumber *)pressAvailable {
    return [store objectForKey:NAMES_pressAvailable];
}

- (void)setMultiTouchAvailable:(NSNumber *)multiTouchAvailable {
    if (multiTouchAvailable != nil) {
        [store setObject:multiTouchAvailable forKey:NAMES_multiTouchAvailable];
    } else {
        [store removeObjectForKey:NAMES_multiTouchAvailable];
    }
}

- (NSNumber *)multiTouchAvailable {
    return [store objectForKey:NAMES_multiTouchAvailable];
}

- (void)setDoublePressAvailable:(NSNumber *)doublePressAvailable {
    if (doublePressAvailable != nil) {
        [store setObject:doublePressAvailable forKey:NAMES_doublePressAvailable];
    } else {
        [store removeObjectForKey:NAMES_doublePressAvailable];
    }
}

- (NSNumber *)doublePressAvailable {
    return [store objectForKey:NAMES_doublePressAvailable];
}

@end


text:
module Azure::ServiceFabric::V6_4_0_36
  module Models
    #
    # Represents the health state of a partition, which contains the partition
    # identifier and its aggregated health state.
    #
    class PartitionHealthState < EntityHealthState

      include MsRestAzure

      # @return Id of the partition whose health state is described by this
      # object.
      attr_accessor :partition_id

      #
      # Mapper for PartitionHealthState class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'PartitionHealthState',
          type: {
            name: 'Composite',
            class_name: 'PartitionHealthState',
            model_properties: {
              aggregated_health_state: {
                client_side_validation: true,
                required: false,
                serialized_name: 'AggregatedHealthState',
                type: {
                  name: 'String'
                }
              },
              partition_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PartitionId',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
<!DOCTYPE html>

<meta charset="utf-8"/>
<title>Application Management System </title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="" name="description"/>
<meta content="" name="author"/>

    <link href="../../resources/global/css/fonts.css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css"/>

    <link href="../../resources/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/fullcalendar/fullcalendar.min.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/plugins/morris/morris.css" rel="stylesheet" type="text/css">

    <link href="../../resources/admin/pages/css/tasks.css" rel="stylesheet" type="text/css"/>

    <link href="../../resources/global/css/components-rounded.css" id="style_components" rel="stylesheet" type="text/css"/>
    <link href="../../resources/global/css/plugins.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/admin/layout4/css/layout.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/admin/layout4/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
    <link href="../../resources/admin/layout4/css/custom.css" rel="stylesheet" type="text/css"/>

<link href="../../resources/global/plugins/ztree/css/metro.css" rel="stylesheet" type="text/css"/>
<link href="../../resources/global/plugins/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" type="text/css" />
<link href="../../resources/global/plugins/bootstrap-toastr/toastr.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" type="text/css" href="../../resources/global/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="../../resources/global/plugins/datatables/extensions/Scroller/css/dataTables.scroller.min.css"/>
<link rel="stylesheet" type="text/css" href="../../resources/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css"/>
<link rel="stylesheet" type="text/css" href="../../resources/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/>

<link href="../../resources/global/plugins/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" type="text/css" />
<link href="../../resources/global/css/lion.css" rel="stylesheet" type="text/css" />
<link href="../../resources/global/css/combotree/combotree.css" rel="stylesheet" type="text/css" />

                <form id="queryform" class="form-horizontal">

                        角色名

                        <input class="form-control input-small" type="text" size="30" name="nameZh" id="nameZh"  placeholder="please enter name"/>

                         查询

                </form>

                    添加

                    编辑

                    删除

                    刷新

                    Excel

                    授权

                            <input type="checkbox" class="group-checkable" data-set="#sys_group_list_tb.checkboxes"  data-sortable="false" />

                            角色名称(英文)

                            角色名称(中文)

                            描述

                            可编辑

                            创建时间

                            更新时间

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

 角色授权

                    <input type="hidden" id='roleId' name='id' value="">

                                    已授权信息

                                    关联用户组

                                    关联用户

                                    关联资源

                                        已关联用户组

                                                    <input type="checkbox" class="group-checkable" data-set="#rolegroup_list.checkboxes"  data-sortable="false"  />

                                                    用户组名称(英文)

                                                    用户组名称(中文)

                                                    描述

                                        已关联用户

                                                    <input type="checkbox" class="group-checkable" data-set="#roleuser_list.checkboxes"  data-sortable="false"  />

                                                    用户名

                                                    用户姓名(中文)

                                                    员工

                                                        <input type="checkbox" class="group-checkable" data-set="#authgroup_list.checkboxes"  data-sortable="false"  />

                                                        用户组名称(英文)

                                                        用户组名称(中文)

                                                        描述

                                                        <input type="checkbox" class="group-checkable" data-set="#authuser_list.checkboxes"  data-sortable="false"  />

                                                        用户名

                                                        用户姓名(中文)

                                                        员工

                    <button type="button" id="btnCancel" class="btn default" data-dismiss="modal">
                         取 消 </button>
                    <button type="button" id="btnAuthSave" class="btn blue">
                         保 存</button>

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

						<@spring.message "sys.role.form.adddialog.text"/>

                            <form action="#" class="form-horizontal" name="sysRoleForm" id="sysRoleForm" method="post">
                                <input type="hidden" id='id' name='id' value="">

                                            <@spring.message "sys.role.form.namezh.text"/>

                                                <input type="text"  name="nameZh"  maxlength="100" class="form-control" placeholder="<@spring.message "sys.role.form.namezh.missing.message"/>" size="30"/>

                                            <@spring.message "sys.role.form.nameen.text"/>

                                                <input type="text"  id="nameEn" name="nameEn" maxlength="100" class="form-control" placeholder="<@spring.message "sys.role.form.nameen.missing.message"/>" size="30"/>

                                            <@spring.message "sys.role.form.description.text"/>

                                                <input type="text" name="description" id="description" class="form-control" placeholder="<@spring.message "sys.role.form.description.missing.message"/>" maxlength="255" size="30"/>

                                            <@spring.message "sys.role.form.editable.text"/>

                                                <input type="checkbox" class="form-control" name="editable" checked="true" value="1"/>

                            </form>

                    <button type="button" id="btnCancel" class="btn default" data-dismiss="modal">

                        <@spring.message "common.diaglog.btn.cancel"/>
                    </button>
                    <button type="button" id="btnSave" class="btn blue">

                        <@spring.message "common.diaglog.btn.save"/>
                    </button>


text:
<?php

namespace Igorwanbarros\Autenticacao\Http\Controllers;

use Illuminate\Http\Request;
use Igorwanbarros\Autenticacao\Models\Empresa;
use Igorwanbarros\Autenticacao\Widgets\FormEmpresa;
use Igorwanbarros\BaseLaravel\Http\Support\FormHelper;
use Igorwanbarros\BaseLaravel\Http\Support\IndexHelper;
use Igorwanbarros\BaseLaravel\Http\Support\StoreHelper;
use Igorwanbarros\Php2HtmlLaravel\Tabs\TabsViewLaravel;
use Igorwanbarros\BaseLaravel\Http\Support\DestroyHelper;
use Igorwanbarros\BaseLaravel\Http\Controllers\BaseController;

class EmpresasController extends BaseController
{
    protected $tabsName = 'empresas';

    public function __construct(Request $request, Empresa $model)
    {
        parent::__construct($request, $model);

        $this->form = new FormEmpresa(url('/empresas/salvar'), Empresa::class);

        $this->headers = [
            'id'                    => 'Código',
            'cnpj'                  => 'CNPJ',
            'razao_social'          => 'Razão Social',
            'nome_fantasia'         => 'Nome Fantasia',
            'telefone_principal'    => 'Telefone',
            'email_principal'       => 'Email',
        ];

        $this->title = ' %s Empresa';
        $this->view->urlBase = 'empresas';

        $assets = app('assets');
        $assets->addScript(url('assets/autenticacao-laravel/autenticacao.js'));
    }

    public function index()
    {
        return IndexHelper::support($this);
    }

    public function form($id = null)
    {
        $tabs = app('tabs')[$this->tabsName];
        return FormHelper::support($this, compact('id'), $this->personalizeForm($tabs, $id));
    }

    protected static function personalizeForm($tabsEndereco, $id = null)
    {
        return function ($controller) use ($tabsEndereco, $id) {
            $contents['principal'] = "{$controller->form}

";
            $tabs = new TabsViewLaravel($tabsEndereco, $contents, $id);
            $controller->view->widget
                ->setBody("
{$tabs}
");
        };
    }

    public function store()
    {
        return StoreHelper::support($this);
    }

    public function destroy($id)
    {
        return DestroyHelper::support($this, compact('id'));
    }
}


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>MMD Models</title>
    <meta name="description" content="A-Frame MMD loader component">
    <script>
    /*
    var WebVRConfig = {
        FORCE_ENABLE_VR: true,
        BUFFER_SCALE: 1.0
    };
    */
    </script>
    <script src="https://cdn.rawgit.com/aframevr/aframe/v0.5.0/dist/aframe-master.min.js"></script>
    <script src="https://cdn.rawgit.com/kripken/ammo.js/dcab07bf0e7f2b4b64c01dc45da846344c8f50be/builds/ammo.js"></script>
    <script src="https://cdn.rawgit.com/donmccurdy/aframe-extras/v3.2.0/dist/aframe-extras.min.js"></script>
    <script src="https://cdn.rawgit.com/takahirox/aframe-outline/v1.1.0/build/aframe-outline.min.js"></script>
   <script src="https://cdn.rawgit.com/takahirox/a-mmd/master/build/a-mmd.js"></script>

   <!-- include aframe-artoolkit -->
   <script src="../build/aframe-ar.js"></script>
  </head>

  <body style='margin : 0px; overflow: hidden; font-family: Monospace;'>

<!--
The license of MMD assets used here
https://github.com/mrdoob/three.js/tree/dev/examples/models/mmd#readme
-->

    <a-scene  embedded artoolkit='debug: false; sourceType: webcam;' antialias="true" outline stats>
      <a-assets>
        <img id="sky" src="https://cdn.rawgit.com/aframevr/aframe/master/examples/primitives/models/peach-gradient.jpg">
      </a-assets>

                <a-entity camera></a-entity>

		<a-marker type='pattern' url='../../data/data/patt.hiro' size='10'>
			<a-entity scale="0.1 0.1 0.1">
      				<a-entity mmd="audio:https://cdn.rawgit.com/mrdoob/three.js/dev/examples/models/mmd/audios/wavefile_short.mp3;
                     			audioDelayTime:5.333333333333333; afterglow:2.0;">
        			<a-entity mmd-model="model:https://cdn.rawgit.com/mrdoob/three.js/dev/examples/models/mmd/miku/miku_v2.pmd;
                				vmd:https://cdn.rawgit.com/mrdoob/three.js/dev/examples/models/mmd/vmds/wavefile_v2.vmd;
                        			physics:false;"

                  			rotation="90 0 0"
                  			shadow="cast:true">
				</a-entity>
       			</a-entity>
		</a-marker>

      <a-plane rotation="-90 0 0"
               color="#AAAAAA"
               height="200"
               width="200"
               shadow="receive:true"></a-plane>

      <a-sky src="#sky"></a-sky>

      <a-entity shadow-light="type:directional;
                              castShadow:true;
                              color:#888;
                              shadowMapWidth:1024;
                              shadowMapHeight:1024;
                              shadowCameraRight:20;
                              shadowCameraTop:20;
                              shadowCameraLeft:-20;
                              shadowCameraBottom:-20"
                position="-20 20 20"></a-entity>
    </a-scene>
  </body>
</html>


text:
package com.latitude.seventimer.model.http;

/**
 * Created by cloud on 2019-08-17.
 */
public class ApiResponse<T> {

    public static final int CODE_SUCCESS = 0x1;
    public static final int CODE_NO_DATA = 0x2;

    protected int code;
    protected String response;
    protected T data;

    public ApiResponse() {
    }

    public ApiResponse(String response) {
        this(CODE_SUCCESS, response, null);
    }

    public ApiResponse(int code) {
        this(code, null, null);
    }

    public ApiResponse(int code, String response) {
        this(code, response, null);
    }

    public ApiResponse(String response, T data) {
        this(CODE_SUCCESS, response, data);
    }

    public ApiResponse(int code, String response, T data) {
        this.code = code;
        this.response = response;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public String getResponse() {
        return response;
    }

    public T getData() {
        return data;
    }

    public boolean isDataValid() {
        return code == CODE_SUCCESS;
    }
}


text:
namespace chrono {
/// Namespace for classes devoted to
/// collision detection.
namespace collision {

///
/// Base class for the narrow-phase collision detection algorithm (collision
/// between a single couple of models).
/// It just implements algorithms to handle the list of the contact
/// pairs, but child classes must implement the most important function,
/// that is the ComputeCollisions() function, which should find the
/// contact pairs between two collision models. \see ChCollisionTree
///

class ChNarrowPhaseCollider {
  public:
    /// Constructor
    ChNarrowPhaseCollider();
    /// Destructor
    virtual ~ChNarrowPhaseCollider();

    /// Child classes must use this function to insert a new CollisionPair
    /// into  the vector of contacts. (The pair is automatically copied and allocated).
    void AddCollisionPair(ChCollisionPair* mcollision);

    /// Free the vector of contact pairs.
    void ClearPairsList();

    /// Returns 1 if colliding, return 0 if not colliding (after calling ComputeCollisions())
    int IsColliding() { return (num_collision_pairs > 0); }

    /// Returns number of collision pairs (after calling ComputeCollisions())
    int GetNumPairs() { return num_collision_pairs; }

    /// Returns reference to vector of collision pairs (after calling ComputeCollisions())
    std::vector<ChCollisionPair>& GetPairs() { return pairs; }

    /// Returns the number of bounding volume tests, for statistics
    int GetNumBVTests() { return num_bv_tests; }
    /// Returns the number of intersection between geometric primitives, for statistics
    int NumGeoTests() { return num_geo_tests; }
    /// Time of execution of last call to ComputeCollisions()
    double QueryTimeSecs() { return query_time_secs; }

    // PERFORM THE COLLISION DETECTION

    enum eCollMode {
        ChC_ALL_CONTACTS = 1,   ///< find all possible contact pairs
        ChC_FIRST_CONTACT = 2,  ///< report first intersecting entity and shortcircuit search
    };
    enum eCollSuccess {
        ChC_RESULT_OK = 1,              ///< ComputeCollisions() performed ok
        ChC_RESULT_MODELSNOTBUILT = 2,  ///< No collision query was possible: models not correctly built!
        ChC_RESULT_GENERICERROR = 100,  ///< ComputeCollisions() generic failure to performs
    };
    /// Perform collision detection between two
    /// collision models (each belonging to a different rigid
    /// body, for example), given the absolute orientations and
    /// translations of the two models.
    /// The identified contacts will be inserted in the Contacts vector.
    /// All child classes must implement this.
    ///
    virtual eCollSuccess ComputeCollisions(ChMatrix33<>& R1,     ///< abs.rotation of first model
                                           Vector T1,            ///< abs.position of first model
                                           ChCollisionTree* o1,  ///< reference to first model
                                           ChMatrix33<>& R2,     ///< abs.rotation of second model
                                           Vector T2,            ///< abs position of second model
                                           ChCollisionTree* o2,  ///< reference to second model
                                           eCollMode flag        ///< mode of collision \see eCollMode
                                           );

  protected:
    // DATA

    int num_collision_pairs;             ///< number of collision pairs (contact points) detected
    std::vector<ChCollisionPair> pairs;  ///< vector of collision pairs (contact points)

    int num_bv_tests;        ///< number of bounding volume tests, for statistics
    int num_geo_tests;       ///< number of test of intersection between primitive pairs
    double query_time_secs;  ///< time of execution of last call to collision detection

    // Used internally, initialized after call to base function ComputeCollisions()
    // and then they can be used by children classes which inherit specific ComputeCollisions() features
    ChMatrix33<> R;   // relative rotation of model 2 respect to model 1
    Vector T;         // relative position of model 2 respect to model 1
    ChMatrix33<> R1;  // abs.rotation of model1
    Vector T1;        // abs.position of model1
    ChMatrix33<> R2;  // abs.rotation of model2
    Vector T2;        // abs.position of model2
};

}  // END_OF_NAMESPACE____
}  // END_OF_NAMESPACE____

#endif


text:
<?php

/**
 * Skeleton subclass for representing a row from the 'axcron_task_schedule' table.
 *
 *
 *
 * This class was autogenerated by Propel 1.5.3-dev on:
 *
 * Mon Jun 28 10:48:51 2010
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.plugins.axCronPlugin.lib.model
 */
class axCronTaskSchedule extends BaseaxCronTaskSchedule {
	/**
	 * Returns the next scheduled date time
	 * @return DateTime the datetime of next start
	 */
	public function getNextDatetime() {
		$from = $this->getaxCronTask()->getLastRun();

		if ($from == null) {
			$from = new DateTime('1900-01-01');
		}

		// We are in a day fixed schedule
		if ($this->getDay() !== null) {
			// If the day of week off today equals to the from date, i can not use strtotime with next/last
			if ($this->getDay() == $from->format('w')) {
				$next_date = new DateTime();
				$next_date->setTime($this->getHours(), $this->getMinutes());
			} else {
				$next_date = new DateTime('last '.$this->getDayAsString());
				$next_date->setTime($this->getHours(), $this->getMinutes());
			}

			if ($next_date < $from) {
				$next_date = new DateTime('next '.$this->getDayAsString());
				$next_date->setTime($this->getHours(), $this->getMinutes());
			}

			return $next_date;
		} else { // We are in interval schedule
			// I only add the interval to the latest run
			return $from->add(new DateInterval('PT'.$this->getInterval().'M'));
		}
	}

	/**
	 * @return integer the hours to start at
	 */
	public function getHours() {
		if ($this->getStartAt()) {
			return intval($this->getStartAt(null)->format('G'));
		}

		return null;
	}

	/**
	 * @return integer the minutes to start at
	 */
	public function getMinutes() {
		if ($this->getStartAt()) {
			return intval($this->getStartAt(null)->format('i'));
		}

		return null;
	}

	/**
	 * @return string the week of day in string
	 */
	public function getDayAsString() {
		switch ($this->getDay()) {
			case 0:
				return 'Sunday';
			case 1:
				return 'Monday';
			case 2:
				return 'Tuesday';
			case 3:
				return 'Wednesday';
			case 4:
				return 'Thursday';
			case 5:
				return 'Friday';
			case 6:
				return 'Saturday';
		}
	}
} // axCronTaskSchedule