text:
import { dirname, fragment, join, normalize, Path, PathFragment, strings } from '@angular-devkit/core';
import { DirEntry, Tree } from '@angular-devkit/schematics';

export const PREFIX = '';
export const FEATURE_MODULE_EXT = '.module.ts';
export const ROUTING_MODULE_EXT = '-routing.module.ts';
export const PLAYGROUND_PATH: Path = normalize('/src/playground/');
export const PLAYGROUND_ROUTING_MODULE_PATH: Path = join(PLAYGROUND_PATH, `playground${ROUTING_MODULE_EXT}`);

export const LAYOUT_DIR_NAME = 'with-layout';
export const LAYOUT_DIR_PATH = join(PLAYGROUND_PATH, LAYOUT_DIR_NAME);
export const LAYOUT_MODULE_PATH = join(LAYOUT_DIR_PATH, `${LAYOUT_DIR_NAME}${FEATURE_MODULE_EXT}`);
export const LAYOUT_ROUTING_MODULE_PATH = join(LAYOUT_DIR_PATH, `${LAYOUT_DIR_NAME}${ROUTING_MODULE_EXT}`);
export const LAYOUT_MODULE_CLASS = 'WithLayoutModule';
export const LAYOUT_COMPONENT_CLASS = 'PlaygroundLayoutComponent';

export const NO_LAYOUT_DIR_NAME = 'without-layout';
export const NO_LAYOUT_DIR_PATH = join(PLAYGROUND_PATH, NO_LAYOUT_DIR_NAME);
export const NO_LAYOUT_MODULE_PATH = join(NO_LAYOUT_DIR_PATH, `${NO_LAYOUT_DIR_NAME}${FEATURE_MODULE_EXT}`);
export const NO_LAYOUT_ROUTING_MODULE_PATH = join(NO_LAYOUT_DIR_PATH, `${NO_LAYOUT_DIR_NAME}${ROUTING_MODULE_EXT}`);
export const NO_LAYOUT_MODULE_CLASS = 'WithoutLayoutModule';
export const NO_LAYOUT_COMPONENT_CLASS = 'PlaygroundBaseComponent';

export const INCLUDE_DIRS: string[] = [LAYOUT_DIR_PATH, NO_LAYOUT_DIR_PATH];

/**
 * Returns root playground directory.
 * Don't use it to iterate through all playground directories,
 * since some directories should be ignored. To get all allowed directories
 * use `getPlaygroundDirs` instead.
 * @param tree
 */
export function getPlaygroundRootDir(tree: Tree): DirEntry {
  return tree.getDir(PLAYGROUND_PATH);
}

/**
 * Returns DirEntries of root playground directories excluding ignored.
 * @param tree
 */
export function getPlaygroundDirs(tree: Tree): DirEntry[] {
  const pgDir = getPlaygroundRootDir(tree);

  return pgDir.subdirs
    .filter((dirName: PathFragment) => INCLUDE_DIRS.includes(join(pgDir.path, dirName)))
    .map((path) => pgDir.dir(path));
}

/**
 * Returns root modules dirs from all included dirs.
 * @param tree
 */
export function getModuleDirs(tree: Tree): DirEntry[] {
  const baseDirs = getPlaygroundDirs(tree);
  const baseDirectChildren = baseDirs.reduce((dirs: DirEntry[], dir: DirEntry) => {
    return dirs.concat(dir.subdirs.map((subDir) => dir.dir(subDir)));
  }, []);
  return baseDirs.concat(baseDirectChildren);
}

export function isRootPlaygroundModule(moduleDir: Path): boolean {
  return moduleDir === PLAYGROUND_PATH;
}

export function isBasePlaygroundModule(moduleDir: Path): boolean {
  return moduleDir === LAYOUT_DIR_PATH || moduleDir === NO_LAYOUT_DIR_PATH;
}

/**
 * Returns dashed module file name.
 */
export function generateFeatureModuleFileName(moduleName: string): PathFragment {
  return fragment(strings.dasherize(moduleName) + FEATURE_MODULE_EXT);
}

/**
 * Returns dashed module file name.
 */
export function generateRoutingModuleFileName(moduleName: string): PathFragment {
  return fragment(strings.dasherize(moduleName) + ROUTING_MODULE_EXT);
}

/**
 * Returns pascal cased module class name.
 */
export function generateFeatureModuleClassName(moduleName: string): string {
  return `${PREFIX}${strings.classify(moduleName)}Module`;
}

/**
 * Returns pascal cased module class name.
 */
export function generateRoutingModuleClassName(dashedName: string): string {
  return `${PREFIX}${strings.classify(dashedName)}RoutingModule`;
}

export function isLayoutPath(modulePath: Path): boolean {
  return modulePath.startsWith(LAYOUT_DIR_PATH);
}

export function isService(fileName: PathFragment): boolean {
  return fileName.endsWith('.service.ts');
}

export function isDirective(fileName: PathFragment): boolean {
  return fileName.endsWith('.directive.ts');
}

export function isComponent(fileName: PathFragment): boolean {
  return fileName.endsWith('.component.ts');
}

export function isFeatureModule(fileName: PathFragment): boolean {
  return fileName.endsWith(FEATURE_MODULE_EXT) && !isRoutingModule(fileName);
}

export function isRoutingModule(fileName: PathFragment): boolean {
  return fileName.endsWith(ROUTING_MODULE_EXT);
}

export function getServicesFromDir(dir: DirEntry): Path[] {
  return dir.subfiles.filter(isService).map((fileName) => join(dir.path, fileName));
}

export function getComponentsFromDir(dir: DirEntry): Path[] {
  return dir.subfiles.filter(isComponent).map((fileName) => join(dir.path, fileName));
}

export function getDirectivesFromDir(dir: DirEntry): Path[] {
  return dir.subfiles.filter(isDirective).map((fileName) => join(dir.path, fileName));
}

export function getFeatureModuleFromDir(dir: DirEntry): Path | null {
  const moduleFileName = dir.subfiles.find(isFeatureModule);
  return moduleFileName ? join(dir.path, moduleFileName) : null;
}

export function getRoutingModuleFromDir(dir: DirEntry): Path | null {
  const moduleFileName = dir.subfiles.find(isRoutingModule);
  return moduleFileName ? join(dir.path, moduleFileName) : null;
}

export function hasFeatureModuleInDir(dir: DirEntry): boolean {
  return dir.subfiles.some(isFeatureModule);
}

export function hasRoutingModuleInDir(dir: DirEntry): boolean {
  return dir.subfiles.some(isRoutingModule);
}

export function hasComponentsInDir(dir: DirEntry): boolean {
  return dir.subfiles.some(isComponent);
}

function isOutsidePlayground(path: Path): boolean {
  return !path.startsWith(PLAYGROUND_PATH);
}

export function findFeatureModule(tree: Tree, path: Path): Path | undefined {
  if (isOutsidePlayground(path)) {
    return;
  }

  const moduleFile = tree.getDir(path).subfiles.find(isFeatureModule);
  return moduleFile ? join(path, moduleFile) : findFeatureModule(tree, dirname(path));
}

export function findRoutingModule(tree: Tree, path: Path): Path | undefined {
  if (isOutsidePlayground(path)) {
    return;
  }

  const moduleFile = tree.getDir(path).subfiles.find(isRoutingModule);
  return moduleFile ? join(path, moduleFile) : findRoutingModule(tree, dirname(path));
}

export function isInPlaygroundRoot(filePath: Path): boolean {
  return dirname(filePath) === PLAYGROUND_PATH;
}


text:
+ (UIImage *)ds_imageNamed:(NSString *)name waterMark:(NSString *)mark;

// 截取一个圆形图片
+ (UIImage *)ds_circleImageWithNamed:(NSString *)name;

// 绘制一张纯色图片
+ (UIImage *)ds_imageWithUIColor:(UIColor *)color;

redpajama_set_name: RedPajamaGithub


text: docker build -t hnakamur/nginx_base `dirname $0`


text:
<?php

class Settings_Workflows_TasksList_View extends Settings_Vtiger_Index_View {

	public function process(Vtiger_Request $request) {
		$viewer = $this->getViewer($request);
		$moduleName = $request->getModule();
		$qualifiedModuleName = $request->getModule(false);

		$recordId = $request->get('record');
		$workflowModel = Settings_Workflows_Record_Model::getInstance($recordId);

		$viewer->assign('WORKFLOW_MODEL', $workflowModel);

		$viewer->assign('TASK_LIST', $workflowModel->getTasks());
		$viewer->assign('MODULE', $moduleName);
		$viewer->assign('RECORD',$recordId);
		$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
		$viewer->view('TasksList.tpl', $qualifiedModuleName);
	}
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Web;
namespace GeneratorBase.MVC
{
    /// <summary>
    /// Uses reflection to create lists of entities and their properties.
    /// </summary>
    public class ModelReflector
    {
        public static List<Entity> Entities { get; private set; }
        static ModelReflector()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var types = GetTypesWithTableAttribute(assembly);
            Entities = types.Select(t =>
                new Entity()
                {
                    Name = t.Name,
                    DisplayName = GetDisplayName(t) ?? t.Name,
                    IsDefault = GetDisplayName(t) == null || Enum.IsDefined(typeof(IgnoreEntities), t.Name) ? true : false,
                    IsExternalEntity = GetDBTableAttribute(t),
                    Properties = GetDisplayPropertiesForEntity(t).OrderBy(prop => prop.DisplayName).ToList(),
                    Associations = GetAssociationsForEntity(t).OrderBy(asso => asso.DisplayName).ToList(),
                    //code for verb action security
                    Verbs = GetVerbsForEntity(t).OrderBy(verb => verb.DisplayName).ToList(),
                    //
                    IsAdminEntity = (Enum.IsDefined(typeof(AdminEntities), t.Name))
                }
            ).OrderBy(p => p.IsDefault).ThenBy(p => p.DisplayName).ToList();
        }
        private static bool GetDBTableAttribute(Type t)
        {
            var result = false;
            var attr = t.GetCustomAttribute<TableAttribute>(false);
            if (attr != null)
            {
                result = false;
            }
            else result = true;
            return result;
        }
        private static string GetDisplayName(Type t)
        {
            string result = string.Empty;
            var attr = t.GetCustomAttribute<DisplayNameAttribute>(false);
            if (attr != null)
            {
                result = attr.DisplayName;
            }
            return string.IsNullOrEmpty(result) ? null : result;
        }
        private static IEnumerable<Type> GetTypesWithTableAttribute(Assembly assembly)
        {
            var tableAttr = typeof(System.ComponentModel.DataAnnotations.Schema.TableAttribute);
            foreach (Type type in assembly.GetTypes())
            {
                if (type.Name == "UserBasedSecurity" || type.Name == "UserDefinePages" || type.Name == "UserDefinePagesRole") continue;
                var attr = type.GetCustomAttribute<TableAttribute>(true);
                var attr1 = type.GetCustomAttribute<DisplayNameAttribute>(true);
                if (attr != null || attr1 != null)
                {
                    yield return type;
                }
            }
        }
        private static IEnumerable<Property> GetDisplayPropertiesForEntity(Type type)
        {
            foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.Name.ToLower().EndsWith("workflowinstanceid")))
            {
                var attr = property.GetCustomAttribute<DisplayNameAttribute>(false);
                Attribute[] allattr = (Attribute[])Attribute.GetCustomAttributes(property, false);// property.GetCustomAttribute<System.ComponentModel.DataAnnotations.DataTypeAttribute>(false);
                var datatypeattr = allattr.FirstOrDefault(p => p.GetType() == typeof(System.ComponentModel.DataAnnotations.DataTypeAttribute));

                if (attr != null)
                {
                    yield return new Property()
                    {
                        Name = property.Name,
                        DisplayName = attr.DisplayName,
                        DataType = (property.PropertyType.IsGenericType &&
                            property.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) ? property.PropertyType.GetGenericArguments()[0].Name : property.PropertyType.Name,
                        IsRequired = property.IsDefined(typeof(System.ComponentModel.DataAnnotations.RequiredAttribute), false),
                        IsEmailValidation = property.IsDefined(typeof(System.ComponentModel.DataAnnotations.EmailAddressAttribute), false),
                        DataTypeAttribute = datatypeattr!=null?((System.ComponentModel.DataAnnotations.DataTypeAttribute)datatypeattr).DataType.ToString() :""
                    };
                }
            }
        }
        private static IEnumerable<Association> GetAssociationsForEntity(Type type)
        {
            var proplist = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            foreach (var property in proplist.Where(p => p.GetCustomAttribute<DisplayNameAttribute>(false) == null))
            {
                if (property.Name == "Id") continue;
                var targetProperty = proplist.Where(p => p.Name.ToLower() == property.Name.ToLower() + "id").ToList();
                if (targetProperty.Count > 0)
                {
                    var name = targetProperty[0].Name;
                    yield return new Association()
                    {
                        Name = name.TrimEnd("ID".ToCharArray()),
                        DisplayName = targetProperty[0].GetCustomAttribute<DisplayNameAttribute>(false).DisplayName,
                        AssociationProperty = name,
                        Target = property.PropertyType.Name
                    };
                }
            }
        }
        //code for verb action security
        private static IEnumerable<Verb> GetVerbsForEntity(Type type)
        {

            string controllerName = "GeneratorBase.MVC.Controllers." + type.Name + "Controller";
            Type VerbTypeCls = Type.GetType(controllerName);

            if (VerbTypeCls != null)
            {
                MethodInfo VerbTypeMethod = VerbTypeCls.GetMethod("getVerbsName");
                if (VerbTypeMethod != null)
                {
                    object clsInstance = Activator.CreateInstance(VerbTypeCls);
                    string[] result = (string[])VerbTypeMethod.Invoke(clsInstance, null);
                    foreach (var verbName in result)
                    {
                        var name = verbName;
                        yield return new Verb()
                        {
                            Name = name,
                            DisplayName = name,
                        };
                    }
                }

            }
        }
        //
        [DebuggerDisplay("{Name,nq}")]
        public class Entity
        {
            public string Name { get; set; }
            public string DisplayName { get; set; }
            public List<Property> Properties { get; set; }
            public List<Association> Associations { get; set; }
            //code for verb action security
            public List<Verb> Verbs { get; set; }
            //
            public bool IsAdminEntity { get; set; }
            public bool IsDefault { get; set; }
            public bool IsExternalEntity { get; set; }
        }
        [DebuggerDisplay("{DisplayName,nq}")]
        public class Property
        {
            public string Name { get; set; }
            public string DisplayName { get; set; }
            public string DataType { get; set; }
            public bool IsRequired { get; set; }
            public bool IsEmailValidation { get; set; }
            public string DataTypeAttribute { get; set; }

        }
        public class Association
        {
            public string Name { get; set; }
            public string DisplayName { get; set; }
            public string AssociationProperty { get; set; }
            public string Target { get; set; }
        }

        //code for verb action security
        public class Verb
        {
            public string Name { get; set; }
            public string DisplayName { get; set; }

        }
        //
        public enum AdminEntities
        {
            ActionArgs,
            ActionType,
            BusinessRule,
            BusinessRuleType,
            Condition,
            Permission,
            RuleAction
        }
        public enum IgnoreEntities
        {
            PropertyMapping,
            T_RecurrenceDays,
            T_RecurringEndType,
            T_RecurringFrequency,
            T_RecurringScheduleDetailstype,
            T_RepeatOn,
            T_Schedule,
            T_Scheduletype,
            DataSourceParameters,
            Document,
            EntityDataSource,
            T_MonthlyRepeatType,
 	    ApiToken,
            MultiTenantExtraAccess,
            MultiTenantLoginSelected,
        }
    }
}


text:
# PortfolioEffectHFT Toolbox for MATLAB
MATLAB Toolbox/API to PortfolioEffect Quant service for high frequency trading (HFT) strategy backtests, intraday portfolio
analysis and portfolio optimization.

## About PortfolioEffect

PortfolioEffect platform employes high frequency microstructure model pipeline, cloud computing and server-side
market data to enable classic portfolio analysis at intraday horizons.

## Toolbox Installation

After checkout add inner PortfolioEffectHFT folder to MATLAB's path using "Set Path" menu.
Then call any method of the package in MATLAB editor to continue with the set-up:

	+++++++++++++++++++++++++++++++++++++++++++++++++
	Welcome to PortfolioEffect HFT Toolbox.
	Setup will download required binary files (~5mb).
	Please, wait...
	SUCCESS. File downloaded to:
	/home/appadmin/.matlab/R2015a/portfolioeffect-quant-client-1.0-allinone.jar
	Updating java class path file...
	SUCCESS. Java class path updated.

	Setup complete! Restart Matlab session now.
	+++++++++++++++++++++++++++++++++++++++++++++++++

Restart MATLAB to complete PortfolioEffect HFT toolbox set-up.

## Account Credentials

### Locate API Credentials

All portfolio computations are performed on PortfolioEffect cloud servers.
To obtain a free non-professional account, you need to follow a quick sign-up
process on our [website][]

Please use a valid sign-up address - it will be used to email your
account activation link to enable API access then log in to you account and
locate your API credentials on the main page:

### Set API Credentials

Run the following commands to set your account API credentials for the
PortfolioEffect HFT MATLAB Toolbox.

	util_setCredentials('API Username', 'API Password', 'API Key');

You will need to do it only once as your credentials are stored between sessions
on your local machine to speed up future logons. You would need to repeat
this procedure if you change your account password or install PortfolioEffect HFT
toolbox on another computer.

You are now ready to call PortfolioEffect methods.

## Portfolio Construction

### User Data

Users may supply their own historical datasets for index and position entries.
This external data could be one a OHLC bar column element (e.g. 1-second close prices) or a vector of actual transaction prices that contains non-equidistant data points.
You might want to pre-pend at least N =(4 x windowLength) data points to the
beginning of the interval of interest which would be used for initial calibration of portfolio metrics.

#### Create Portfolio

Method [portfolio_create()][] takes a vector of index prices in the format (UTC timestamp, price) with UTC
timestamp expressed in milliseconds from 1970-01-01 00:00:00 EST.

	Time          Value
	[1,] 1412256601000 99.30
	[2,] 1412256602000 99.33
	[3,] 1412256603000 99.30
	[4,] 1412256604000 99.26
	[5,] 1412256605000 99.36
	[6,] 1412256606000 99.36
	[7,] 1412256607000 99.36
	[8,] 1412256608000 99.38
	[9,] 1412256609000 99.40
	[10,] 1412256610000 99.37

If index symbol is specified, it is silently ignored.

	data_spy=importdata('data_spy.mat');

	% Create portfolio
	portfolio=portfolio_create('priceDataIx',data_spy);

#### Add Positions

Positions are added using [portfolio_addPosition()][]
with 'priceData' in the same format as index price.

	data_goog=importdata('data_goog.mat');
	data_aapl=importdata('data_aapl.mat');

	% Single position without rebalancing
	portfolio_addPosition(portfolio,'GOOG',100,'priceData',data_goog);

	% Single position with rebalancing
	portfolio_addPosition(portfolio,'AAPL',[300,150],'time',[1412266600000,1412276600000],'priceData',data_aapl);

### Server Data

At PortfolioEffect we are capturing and storing 1-second intraday bar history for a
all NASDAQ traded equites (see [symbology][]).

This server-side dataset spans from January 2013 to the latest trading time minus five minutes.
It could be used to construct asset portfolios and compute intraday portfolio metrics.

#### Create Portfolio

Method [portfolio_create()][] creates new asset portfolio or overwrites an existing portfolio object with the
same name.

When using server-side data, it only requires a time interval that would be
treated as a default position holding period unless positions are added with rebalancing.
Index symbol could be specified as well with a default value of "SPY" - SPDR S&P 500 ETF Trust.

Interval boundaries are passed in the following format:

* 'yyyy-MM-dd HH:MM:SS' (e.g. '2014-10-01 09:30:00')
* 'yyyy-MM-dd' (e.g. '2014-10-01')
* 't-N' (e.g. 't-5' is latest trading time minus 5 days)
*  UTC timestamp in milliseconds (mills from '1970-01-01 00:00:00') in EST time zone

For example:

	% Timestamp in "yyyy-MM-dd HH:MM:SS" format
	portfolio=portfolio_create('fromTime','2014-10-01 09:30:00','toTime','2014-10-02 16:00:00');

	% Timestamp in "yyyy-MM-dd" format
	portfolio=portfolio_create('fromTime','2014-10-01','toTime','2014-10-02');

	% Timestamp in "t-N" format
	portfolio=portfolio_create('fromTime','t-5','toTime','t');

#### Add Positions
Positions are added by calling [portfolio_addPosition()][]
method on a portfolio object with a list of symbols and quantities. For
positions that were rebalanced or had non-default holding periods a 'time' argument could be used to specify rebalancing timestamps.

	% Single position without rebalancing
	portfolio_addPosition(portfolio,'GOOG',200);

	% Multiple positions without rebalancing
	portfolio_addPosition(portfolio,{'C','GOOG'},[300,200]);

	% Single position with rebalancing
	portfolio_addPosition(portfolio,'AAPL',[300,150],'time',['2014-10-02 09:30:01';'2014-10-02 11:30:01']);

## License

This toolbox is released under the BSD license. See the file LICENSE.

Usage of this toolbox with PortfolioEffect services shall be subject to the [Terms of Service][PortfolioEffect Terms].

## Copyright

Copyright © 2015 PortfolioEffect

[PortfolioEffect Terms]: https://www.portfolioeffect.com/docs/terms
[website]: https://www.portfolioeffect.com/registration
[portfolio_create()]: https://www.portfolioeffect.com/docs/platform/quant/functions/general-functions/portfolio-create
[portfolio_addPosition()]: https://www.portfolioeffect.com/docs/platform/quant/functions/general-functions/portfolio-add-position
[symbology]: https://www.portfolioeffect.com/docs/symbology


text:
class CurvedActivity : public GradedActivity
{
	protected:
		double rawScore;
		double percentage;
	public:
		CurvedActivity() : GradedActivity() {
			rawScore = 0.0;
			percentage = 0.0;
		}

		void setScore(double s){
			rawScore = s;
			GradedActivity::setScore(rawScore * percentage);
		}

		void setPercentage(double c){
			percentage = c;
		}

		double getPercentage() const {
			return percentage;
		}

		double getRawScore() const {
			return rawScore;
		}
};
#endif


text:
<?php

namespace app\classes\cli;

class streams {

	private static $in  = STDIN;
	private static $out = STDOUT;
	private static $err = STDERR;

	public static function call( $method,$args ) {
		return call_user_func_array( __CLASS__ . "::{$method}",$args );
	}

	public static function render() {
		$args = func_get_args();
		$data = array_shift( $args );
		if ( count( $args ) === 0 ) {
			return $data;
		}
		$data = preg_replace( '#(%([^\w]|$))#','%$1',$data );
		return vsprintf( $data,$args );
	}

	public static function out() {
		fwrite( self::$out,self::call( 'render',func_get_args() ) );
	}

	public static function line() {
		$args = array_merge( func_get_args(),array('') );
		$args[0] .= "\n";
		self::call( 'out',$args );
	}

	public static function err() {
		$args = array_merge( func_get_args(),array('') );
		$args[0] .= "\n";
		fwrite( self::$err,self::call( 'render',$args ) );
	}

	public static function input() {
		$line = fgets( self::$in );
		if ( $line === false ) {
			throw new app_exception('Caught ^D during input');
		}
		return trim( $line );
	}

	public static function prompt( $question,$config=array() ) {
		if ( isset( $config['default'] ) && strpos( $question,'[' ) === false ) {
			$question .= " [{$config['default']}]";
		}
		if ( !isset( $config['marker'] ) ) {
			$config['marker'] = ': ';
		}
		while(true) {
			self::out( $question . $config['marker'] );
			$line = self::input();
			if ( $line !== '' ) {
				if ( isset( $config['validation'] ) && is_callable( $config['validation'] ) && !call_user_func( $config['validation'],$line ) ) {
					continue;
				}
				return $line;
			}
			if ( isset( $config['default'] ) ) {
				return $config['default'];
			}
		}
	}

	public static function menu( $options,$config=array() ) {
		if ( isset( $config['default'] ) && !isset( $options[$config['default']] ) ) {
			throw new app_exception('Default selection must be a valid option');
		}
		if ( !isset( $config['title'] ) ) {
			$config['title'] = 'Choose an item';
		}
		if ( isset( $config['default'] ) && strpos( $config['title'],'[' ) === false ) {
			$config['title'] .= " [{$options[$config['default']]}]";
		}
		$list = array_values( $options );
		if ( isset( $config['cancel'] ) && $config['cancel'] ) {
			$cancel_idx = count( $list );
			$list[$cancel_idx] = ( isset( $config['cancel_title'] ) ? $config['cancel_title'] : 'Cancel' );
		}
		$list_count = count( $list );
		foreach( $list as $idx => $item ) {
			self::line( '  %d. %s',( $idx + 1 ),$item );
		}
		self::line();
		while(true) {
			self::out( '%s: ',$config['title'] );
			$line = self::input();
			if ( is_numeric( $line ) ) {
				$line = ( (int) $line - 1 );
				if ( isset( $cancel_idx ) && $line === $cancel_idx ) {
					return false;
				}
				if ( isset( $list[$line] ) ) {
					return array_search( $list[$line],$options );
				}
				if ( $line < 0 || $line >= $list_count ) {
					self::err('Invalid menu selection: out of range');
				}
			}
			elseif ( isset( $config['default'] ) ) {
				return $config['default'];
			}
		}
	}

	public static function choose( $question,$choices=array('y','n'),$config=array() ) {
		if ( !is_array( $choices ) ) {
			$choices = str_split( $choices );
		}
		$choices = $_choices = array_map( 'strtolower',$choices );
		$prompt_config = array();
		if ( isset( $config['default'] ) && ( $d_key = array_search( $config['default'],$_choices ) ) !== false ) {
			$_choices[$d_key] = strtoupper( $_choices[$d_key] );
			$prompt_config['default'] = $config['default'];
		}
		$_choices = trim( implode( '/',$_choices ),'/' );
		while(true) {
			$line = self::prompt( "{$question} [{$_choices}]",$prompt_config );
			$line = strtolower( $line );
			if ( in_array( $line,$choices ) ) {
				return $line;
			}
			if ( isset( $config['default'] ) ) {
				return $config['default'];
			}
		}
	}

}

?>


text:
description = '''
Roman numerals
Problem 89
The rules for writing Roman numerals allow for many ways of writing each number (see About Roman Numerals...). However, there is always a "best" way of writing a particular number.

For example, the following represent all of the legitimate ways of writing the number sixteen:

IIIIIIIIIIIIIIII
VIIIIIIIIIII
VVIIIIII
XIIIIII
VVVI
XVI

The last example being considered the most efficient, as it uses the least number of numerals.

The 11K text file, roman.txt (right click and 'Save Link/Target As...'), contains one thousand numbers written in valid, but not necessarily minimal, Roman numerals; that is, they are arranged in descending units and obey the subtractive pair rule (see About Roman Numerals... for the definitive rules for this problem).

Find the number of characters saved by writing each of these in their minimal form.

Note: You can assume that all the Roman numerals in the file contain no more than four consecutive identical units.
'''

# roman ::= SubtractiveGroup+
# subtractiveGroup ::= D1*D2+ where D1 < D2

digitValues = {
  'I' : 1,
  'V' : 5,
  'X' : 10,
  'L' : 50,
  'C' : 100,
  'D' : 500,
  'M' : 1000
}

def addUnits(s):
  total = 0
  i = 0
  while i < len(s) and s[i] == s[0]:
    total += digitValues[s[i]]
    i += 1
  return (total, i)

def parseSubtractiveGroup(s):
  total1, i = addUnits(s)
  if i == len(s) or digitValues[s[i]] < digitValues[s[0]]:
    return (total1, s[i:])
  total2, j = addUnits(s[i:])
  return (total2 - total1, s[i+j:])

def parseRoman(s):
  total = 0
  while len(s) > 0:
    v, s = parseSubtractiveGroup(s)
    total += v
  return total

def printRoman(n):
  def gen(n):
    while n > 0:
      sn = str(n)
      if n >= 1000: yield 'M';  n -= 1000
      elif sn[0] not in ['4', '9']:
        if n >= 500: yield 'D'; n -= 500
        elif n >= 100: yield 'C'; n -= 100
        elif n >= 50: yield 'L';  n -= 50
        elif n >= 10: yield 'X';  n -= 10
        elif n >= 5: yield 'V';   n -= 5
        else: yield 'I';          n -= 1
      else:
         if n >= 100: yield 'C';  n += 100
         elif n >= 10: yield 'X'; n += 10
         else: yield 'I';         n += 1
  return ''.join(gen(n))

with open('roman.txt', 'r') as f:
  numerals = [line.strip() for line in f]

saved = 0
for n in numerals:
  m = parseRoman(n)
  s = printRoman(m)
  saved += (len(n) - len(s))

print('characters saved:', saved)


text:
require 'travis/build/addons/base'
require 'shellwords'

module Travis
  module Build
    class Addons
      class Apt < Base
        SUPER_USER_SAFE = true
        SUPPORTED_OPERATING_SYSTEMS = %w(
          linux
        ).freeze

        class << self
          def package_whitelist
            @package_whitelist ||= load_package_whitelist
          end

          def source_whitelist
            @source_whitelist ||= load_source_whitelist
          end

          private

          def load_package_whitelist
            require 'faraday'
            response = fetch_package_whitelist
            response.split.map(&:strip).sort.uniq
          rescue => e
            warn e
            []
          end

          def load_source_whitelist
            require 'faraday'
            response = fetch_source_whitelist
            entries = JSON.parse(response)
            Hash[entries.reject { |e| !e.key?('alias') }.map { |e| [e.fetch('alias'), e] }]
          rescue => e
            warn e
            {}
          end

          def fetch_package_whitelist
            Faraday.get(package_whitelist_url).body.to_s
          end

          def fetch_source_whitelist
            Faraday.get(source_whitelist_url).body.to_s
          end

          def package_whitelist_url
            ENV['TRAVIS_BUILD_APT_PACKAGE_WHITELIST'] || ENV['TRAVIS_BUILD_APT_WHITELIST']
          end

          def source_whitelist_url
            ENV['TRAVIS_BUILD_APT_SOURCE_WHITELIST']
          end
        end

        def before_prepare?
          SUPPORTED_OPERATING_SYSTEMS.include?(data[:config][:os].to_s)
        end

        def before_prepare
          sh.fold('apt') do
            add_apt_sources unless config_sources.empty?
            add_apt_packages unless config_packages.empty?
          end
        end

        private

          def add_apt_sources
            sh.echo "Adding APT Sources (BETA)", ansi: :yellow

            whitelisted = []
            disallowed = []

            config_sources.each do |source_alias|
              source = source_whitelist[source_alias]
              whitelisted << source.clone if source && source['sourceline']
              disallowed << source_alias if source.nil?
            end

            unless disallowed.empty?
              sh.echo "Disallowing sources: #{disallowed.map { |source| Shellwords.escape(source) }.join(', ')}", ansi: :red
              sh.echo 'If you require these sources, please review the source ' \
                'approval process at: ' \
                'https://github.com/travis-ci/apt-source-whitelist#source-approval-process'
            end

            unless whitelisted.empty?
              sh.export 'DEBIAN_FRONTEND', 'noninteractive', echo: true
              whitelisted.each do |source|
                sh.cmd "curl -sSL #{source['key_url'].untaint.inspect} | sudo -E apt-key add -", echo: true, assert: true, timing: true if source['key_url']
                if source['sourceline'].start_with? 'ppa:'
                  sh.cmd "sudo -E apt-add-repository -y #{source['sourceline'].untaint.inspect}", echo: true, assert: true, timing: true
                else
                  # Avoid adding deb-src lines to work around https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/987264
                  sh.cmd "echo #{source['sourceline'].untaint.inspect} | sudo tee -a /etc/apt/sources.list > /dev/null", echo: true, assert: true, timing: true
                end
              end
            end
          end

          def add_apt_packages
            sh.echo "Installing APT Packages (BETA)", ansi: :yellow

            whitelisted = []
            disallowed = []

            config_packages.each do |package|
              if package_whitelist.include?(package)
                whitelisted << package
              else
                disallowed << package
              end
            end

            unless disallowed.empty?
              sh.echo "Disallowing packages: #{disallowed.map { |package| Shellwords.escape(package) }.join(', ')}", ansi: :red
              sh.echo 'If you require these packages, please review the package ' \
                'approval process at: ' \
                'https://github.com/travis-ci/apt-package-whitelist#package-approval-process'
            end

            unless whitelisted.empty?
              sh.export 'DEBIAN_FRONTEND', 'noninteractive', echo: true
              sh.cmd "sudo -E apt-get -yq update &>> ~/apt-get-update.log", echo: true, timing: true
              sh.cmd 'sudo -E apt-get -yq --no-install-suggests --no-install-recommends ' \
                "--force-yes install #{whitelisted.join(' ')}", echo: true, timing: true
            end
          end

          def config
            @config ||= Hash(super)
          end

          def config_sources
            @config_sources ||= Array(config[:sources]).flatten.compact
          end

          def config_packages
            @config_packages ||= Array(config[:packages]).flatten.compact
          end

          def package_whitelist
            ::Travis::Build::Addons::Apt.package_whitelist
          end

          def source_whitelist
            ::Travis::Build::Addons::Apt.source_whitelist
          end
      end
    end
  end
end


text:
import * as Preact from '#preact';
import {CSS as COMPONENT_CSS} from './component.jss';
import {PreactBaseElement} from '#preact/base-element';
import {Sidebar} from './component';
import {dict} from '#core/types/object';
import {pauseAll} from '../../../src/utils/resource-container-helper';
import {realChildNodes} from '#core/dom/query';
import {toggle} from '#core/dom/style';
import {toggleAttribute} from '#core/dom';
import {useToolbarHook} from './sidebar-toolbar-hook';
import {useValueRef} from '#preact/component';

export class BaseElement extends PreactBaseElement {
  /** @override */
  static deferredMount(unusedElement) {
    return false;
  }

  /** @param {!AmpElement} element */
  constructor(element) {
    super(element);

    /** @private {boolean} */
    this.open_ = false;
  }

  /** @override */
  init() {
    return dict({
      'onBeforeOpen': () => this.beforeOpen(),
      'onAfterOpen': () => this.afterOpen(),
      'onAfterClose': () => this.afterClose(),
    });
  }

  /** @override */
  updatePropsForRendering(props) {
    realChildNodes(this.element).map((child) => {
      if (
        child.nodeName === 'NAV' &&
        child.hasAttribute('toolbar') &&
        child.hasAttribute('toolbar-target')
      ) {
        props['children'].push(
          <ToolbarShim
            toolbar={child.getAttribute('toolbar')}
            toolbarTarget={child.getAttribute('toolbar-target')}
            domElement={child}
          ></ToolbarShim>
        );
      }
    });
  }

  /** @protected */
  beforeOpen() {
    this.open_ = true;
    toggleAttribute(this.element, 'open', true);
    toggle(this.element, true);
  }

  /** @protected */
  afterOpen() {}

  /** @protected */
  afterClose() {
    this.open_ = false;
    toggleAttribute(this.element, 'open', false);
    toggle(this.element, false);

    pauseAll(this.element, /* includeSelf */ false);
  }

  /** @override */
  mutationObserverCallback() {
    const open = this.element.hasAttribute('open');
    if (open === this.open_) {
      return;
    }
    this.open_ = open;
    open ? this.api().open() : this.api().close();
  }
}

/** @override */
BaseElement['Component'] = Sidebar;

/** @override */
BaseElement['usesShadowDom'] = true;

/** @override */
BaseElement['shadowCss'] = COMPONENT_CSS;

/** @override */
BaseElement['props'] = {
  'children': {passthrough: true},
  'side': {attr: 'side', type: 'string'},
};

/**
 * @param {!SidebarDef.ToolbarShimProps} props
 */
function ToolbarShim({
  domElement,
  toolbar: mediaQueryProp,
  toolbarTarget: toolbarTargetProp,
}) {
  const ref = useValueRef(domElement);
  useToolbarHook(ref, mediaQueryProp, toolbarTargetProp);
}


text:
package org.jasig.portal.portlets.statistics;

import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;

import org.jasig.portal.events.aggr.BaseAggregation;
import org.jasig.portal.events.aggr.BaseAggregationDateTimeComparator;
import org.jasig.portal.events.aggr.BaseAggregationKey;
import org.jasig.portal.events.aggr.BaseGroupedAggregationDiscriminator;
import org.jasig.portal.events.aggr.groups.AggregatedGroupMapping;

/**
 * Extension of {@link BaseStatisticsReportController} for reports that only need to differentiate columns
 * by group
 *
 * @author Eric Dalquist
 */
public abstract class BaseSimpleGroupedStatisticsReportController<
            T extends BaseAggregation<K, D>,
            K extends BaseAggregationKey,
            D extends BaseGroupedAggregationDiscriminator,
            F extends BaseReportForm>
        extends BaseStatisticsReportController<T, K, D, F> {

    /**
     * Default implementation to create a map of the report column discriminators based on the submitted form to
     * collate the aggregation data into each column of a report when the only grouping parameter is
     * AggregatedGroupMapping.
     *
     * The map entries are a time-ordered sorted set of aggregation data points.
     *
     * @param form Form submitted by the user
     * @return Map of report column discriminators to sorted set of time-based aggregation data
     */
    protected Map<D, SortedSet<T>>
            getDefaultGroupedColumnDiscriminatorMap (F form){
        List<Long> groups = form.getGroups();
        //Collections used to track the queried groups and the results
        final Map<D, SortedSet<T>> groupedAggregations =
                new TreeMap<D, SortedSet<T>>((Comparator<? super D>) getDiscriminatorComparator());

        //Get concrete group mapping objects that are being queried for
        for (final Long queryGroupId : groups) {
            final D groupMapping = createGroupedDiscriminatorInstance(this.aggregatedGroupDao.getGroupMapping(queryGroupId));

            //Create the set the aggregations for this report column will be stored in, sorted chronologically
            final SortedSet<T> aggregations = new TreeSet<T>(BaseAggregationDateTimeComparator.INSTANCE);

            //Map the group to the set
            groupedAggregations.put(groupMapping, aggregations);
        }

        return groupedAggregations;
    }

    /**
     * Creates an instance of a BaseGroupedAggregationDiscriminator or any descendants that only
     * require an AggregatedGroupMapping (e.g. won't work for TabRender or other reports that have
     * item other than group (user group) being queried on.
     * @param groupMapping group mapping
     * @return Fully populated child instance of BaseGroupedAggregationDiscriminator
     */
    protected abstract D createGroupedDiscriminatorInstance(AggregatedGroupMapping groupMapping);

}


text:
<!DOCTYPE html>

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

    <title>About - Business Casual - Start Bootstrap Theme</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/business-casual.css" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600,700,100italic,300italic,400italic,600italic,700italic" rel="stylesheet" type="text/css">

Lê Gia

Cửa hàng vật liệu xây dựng và trang trí nội thất

    <?php include "partials/nav.php";?>

LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT

This is a great place to introduce your company or project and describe what you do.

Lid est laborum dolo rumes fugats untras. Etharums ser quidem rerum facilis dolores nemis omnis fugats vitaes nemo minima rerums unsers sadips amets.

Xem thêm »

LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT

This is a great place to introduce your company or project and describe what you do.

Lid est laborum dolo rumes fugats untras. Etharums ser quidem rerum facilis dolores nemis omnis fugats vitaes nemo minima rerums unsers sadips amets.

Xem thêm »

LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT

This is a great place to introduce your company or project and describe what you do.

Lid est laborum dolo rumes fugats untras. Etharums ser quidem rerum facilis dolores nemis omnis fugats vitaes nemo minima rerums unsers sadips amets.

Xem thêm »

                            LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT

This is a great place to introduce your company or project and describe what you do.

Lid est laborum dolo rumes fugats untras. Etharums ser quidem rerum facilis dolores nemis omnis fugats vitaes nemo minima rerums unsers sadips amets.

Xem thêm »

    <?php include "partials/footer.php"?>


text:
<?php
/**
 * Stripe Update Credit Card Request
 */

namespace Omnipay\Stripe\Message;

/**
 * Stripe Update Credit Card Request
 *
 * This needs further work and/or explanation because it requires
 * a customer ID.
 *
 * @link https://stripe.com/docs/api#update_card
 */
class UpdateCardRequest extends AbstractRequest
{
    public function getData()
    {
        $data = array();
        $data['description'] = $this->getDescription();

        if ($this->getSource()) {
            $data['source'] = $this->getSource();
        } elseif ($this->getToken()) {
            $data['source'] = $this->getToken();
        } elseif ($this->getCard()) {
            $data['source'] = $this->getCardData();
            $data['email'] = $this->getCard()->getEmail();
        }

        $this->validate('cardReference');

        return $data;
    }

    public function getEndpoint()
    {
        return $this->endpoint.'/customers/'.$this->getCardReference();
    }
}


text:
<?php

namespace GraphAware\Bolt\Result\Type;

use GraphAware\Common\Type\Relationship as RelationshipInterface;

class Relationship extends MapAccess implements RelationshipInterface
{
    /**
     * @var int
     */
    protected $identity;

    /**
     * @var int
     */
    protected $startNodeIdentity;

    /**
     * @var int
     */
    protected $endNodeIdentity;

    /**
     * @var string
     */
    protected $type;

    /**
     * @param int    $identity
     * @param int    $startNodeIdentity
     * @param int    $endNodeIdentity
     * @param string $type
     * @param array  $properties
     */
    public function __construct($identity, $startNodeIdentity, $endNodeIdentity, $type, array $properties = array())
    {
        $this->identity = $identity;
        $this->startNodeIdentity = $startNodeIdentity;
        $this->endNodeIdentity = $endNodeIdentity;
        $this->type = $type;
        $this->properties = $properties;
    }

    /**
     * {@inheritdoc}
     */
    public function identity()
    {
        return $this->identity;
    }

    /**
     * @return int
     */
    public function startNodeIdentity()
    {
        return $this->startNodeIdentity;
    }

    /**
     * @return int
     */
    public function endNodeIdentity()
    {
        return $this->endNodeIdentity;
    }

    /**
     * {@inheritdoc}
     */
    public function type()
    {
        return $this->type;
    }

    /**
     * {@inheritdoc}
     */
    public function hasType($type)
    {
        return $this->type === $type;
    }
}


text:
title: "Contributors"
linkTitle: "Contributors"
menu:
  main:
    weight: 30
    pre: ""
---

Contributors

            {{< contributor user="cchesser" name="Carl Chesser" >}}
            {{< contributor user="AnEmortalKid" name="Jan Monterrubio" >}}


text:
package azblob

// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"encoding/base64"
	"encoding/xml"
	"github.com/Azure/azure-pipeline-go/pipeline"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"strconv"
	"time"
)

// pageBlobClient is the client for the PageBlob methods of the Azblob service.
type pageBlobClient struct {
	managementClient
}

// newPageBlobClient creates an instance of the pageBlobClient client.
func newPageBlobClient(url url.URL, p pipeline.Pipeline) pageBlobClient {
	return pageBlobClient{newManagementClient(url, p)}
}

// ClearPages the Clear Pages operation clears a set of pages from a page blob
//
// contentLength is the length of the request. timeout is the timeout parameter is expressed in seconds. For more
// information, see Setting
// Timeouts for Blob Service Operations. rangeParameter is return only the bytes of the blob in the specified
// range. leaseID is if specified, the operation only succeeds if the container's lease is active and matches this ID.
// ifSequenceNumberLessThanOrEqualTo is specify this header value to operate only on a blob if it has a sequence number
// less than or equal to the specified. ifSequenceNumberLessThan is specify this header value to operate only on a blob
// if it has a sequence number less than the specified. ifSequenceNumberEqualTo is specify this header value to operate
// only on a blob if it has the specified sequence number. ifModifiedSince is specify this header value to operate only
// on a blob if it has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to
// operate only on a blob if it has not been modified since the specified date/time. ifMatches is specify an ETag value
// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
// recorded in the analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) ClearPages(ctx context.Context, contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobClearPagesResponse, error) {
	if err := validate([]validation{
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.clearPagesPreparer(contentLength, timeout, rangeParameter, leaseID, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.clearPagesResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageBlobClearPagesResponse), err
}

// clearPagesPreparer prepares the ClearPages request.
func (client pageBlobClient) clearPagesPreparer(contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("PUT", client.url, nil)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	params.Set("comp", "page")
	req.URL.RawQuery = params.Encode()
	req.Header.Set("Content-Length", strconv.FormatInt(contentLength, 10))
	if rangeParameter != nil {
		req.Header.Set("x-ms-range", *rangeParameter)
	}
	if leaseID != nil {
		req.Header.Set("x-ms-lease-id", *leaseID)
	}
	if ifSequenceNumberLessThanOrEqualTo != nil {
		req.Header.Set("x-ms-if-sequence-number-le", strconv.FormatInt(*ifSequenceNumberLessThanOrEqualTo, 10))
	}
	if ifSequenceNumberLessThan != nil {
		req.Header.Set("x-ms-if-sequence-number-lt", strconv.FormatInt(*ifSequenceNumberLessThan, 10))
	}
	if ifSequenceNumberEqualTo != nil {
		req.Header.Set("x-ms-if-sequence-number-eq", strconv.FormatInt(*ifSequenceNumberEqualTo, 10))
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	req.Header.Set("x-ms-page-write", "clear")
	return req, nil
}

// clearPagesResponder handles the response to the ClearPages request.
func (client pageBlobClient) clearPagesResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK, http.StatusCreated)
	if resp == nil {
		return nil, err
	}
	io.Copy(ioutil.Discard, resp.Response().Body)
	resp.Response().Body.Close()
	return &PageBlobClearPagesResponse{rawResponse: resp.Response()}, err
}

// CopyIncremental the Copy Incremental operation copies a snapshot of the source page blob to a destination page blob.
// The snapshot is copied such that only the differential changes between the previously copied snapshot are
// transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or
// copied from as usual. This API is supported since REST version 2016-05-31.
//
// copySource is specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that
// specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob
// must either be public or must be authenticated via a shared access signature. timeout is the timeout parameter is
// expressed in seconds. For more information, see Setting
// Timeouts for Blob Service Operations. metadata is optional. Specifies a user-defined name-value pair associated
// with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or
// file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with
// the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version
// 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing
// Containers, Blobs, and Metadata for more information. ifModifiedSince is specify this header value to operate only
// on a blob if it has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to
// operate only on a blob if it has not been modified since the specified date/time. ifMatches is specify an ETag value
// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
// recorded in the analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) CopyIncremental(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobCopyIncrementalResponse, error) {
	if err := validate([]validation{
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}},
		{targetValue: metadata,
			constraints: []constraint{{target: "metadata", name: null, rule: false,
				chain: []constraint{{target: "metadata", name: pattern, rule: `^[a-zA-Z]+$`, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.copyIncrementalPreparer(copySource, timeout, metadata, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.copyIncrementalResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageBlobCopyIncrementalResponse), err
}

// copyIncrementalPreparer prepares the CopyIncremental request.
func (client pageBlobClient) copyIncrementalPreparer(copySource string, timeout *int32, metadata map[string]string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("PUT", client.url, nil)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	params.Set("comp", "incrementalcopy")
	req.URL.RawQuery = params.Encode()
	if metadata != nil {
		for k, v := range metadata {
			req.Header.Set("x-ms-meta-"+k, v)
		}
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	req.Header.Set("x-ms-copy-source", copySource)
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	return req, nil
}

// copyIncrementalResponder handles the response to the CopyIncremental request.
func (client pageBlobClient) copyIncrementalResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK, http.StatusAccepted)
	if resp == nil {
		return nil, err
	}
	io.Copy(ioutil.Discard, resp.Response().Body)
	resp.Response().Body.Close()
	return &PageBlobCopyIncrementalResponse{rawResponse: resp.Response()}, err
}

// Create the Create operation creates a new page blob.
//
// contentLength is the length of the request. timeout is the timeout parameter is expressed in seconds. For more
// information, see Setting
// Timeouts for Blob Service Operations. blobContentType is optional. Sets the blob's content type. If specified,
// this property is stored with the blob and returned with a read request. blobContentEncoding is optional. Sets the
// blob's content encoding. If specified, this property is stored with the blob and returned with a read request.
// blobContentLanguage is optional. Set the blob's content language. If specified, this property is stored with the
// blob and returned with a read request. blobContentMD5 is optional. An MD5 hash of the blob content. Note that this
// hash is not validated, as the hashes for the individual blocks were validated when each was uploaded.
// blobCacheControl is optional. Sets the blob's cache control. If specified, this property is stored with the blob and
// returned with a read request. metadata is optional. Specifies a user-defined name-value pair associated with the
// blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the
// destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified
// metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19,
// metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and
// Metadata for more information. leaseID is if specified, the operation only succeeds if the container's lease is
// active and matches this ID. blobContentDisposition is optional. Sets the blob's Content-Disposition header.
// ifModifiedSince is specify this header value to operate only on a blob if it has been modified since the specified
// date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if it has not been modified
// since the specified date/time. ifMatches is specify an ETag value to operate only on blobs with a matching value.
// ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. blobContentLength is this
// header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte
// boundary. blobSequenceNumber is set for page blobs only. The sequence number is a user-controlled value that you can
// use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled.
func (client pageBlobClient) Create(ctx context.Context, contentLength int64, timeout *int32, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentLength *int64, blobSequenceNumber *int64, requestID *string) (*PageBlobCreateResponse, error) {
	if err := validate([]validation{
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}},
		{targetValue: metadata,
			constraints: []constraint{{target: "metadata", name: null, rule: false,
				chain: []constraint{{target: "metadata", name: pattern, rule: `^[a-zA-Z]+$`, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.createPreparer(contentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobContentLength, blobSequenceNumber, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.createResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageBlobCreateResponse), err
}

// createPreparer prepares the Create request.
func (client pageBlobClient) createPreparer(contentLength int64, timeout *int32, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobContentLength *int64, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("PUT", client.url, nil)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	req.URL.RawQuery = params.Encode()
	req.Header.Set("Content-Length", strconv.FormatInt(contentLength, 10))
	if blobContentType != nil {
		req.Header.Set("x-ms-blob-content-type", *blobContentType)
	}
	if blobContentEncoding != nil {
		req.Header.Set("x-ms-blob-content-encoding", *blobContentEncoding)
	}
	if blobContentLanguage != nil {
		req.Header.Set("x-ms-blob-content-language", *blobContentLanguage)
	}
	if blobContentMD5 != nil {
		req.Header.Set("x-ms-blob-content-md5", base64.StdEncoding.EncodeToString(blobContentMD5))
	}
	if blobCacheControl != nil {
		req.Header.Set("x-ms-blob-cache-control", *blobCacheControl)
	}
	if metadata != nil {
		for k, v := range metadata {
			req.Header.Set("x-ms-meta-"+k, v)
		}
	}
	if leaseID != nil {
		req.Header.Set("x-ms-lease-id", *leaseID)
	}
	if blobContentDisposition != nil {
		req.Header.Set("x-ms-blob-content-disposition", *blobContentDisposition)
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	if blobContentLength != nil {
		req.Header.Set("x-ms-blob-content-length", strconv.FormatInt(*blobContentLength, 10))
	}
	if blobSequenceNumber != nil {
		req.Header.Set("x-ms-blob-sequence-number", strconv.FormatInt(*blobSequenceNumber, 10))
	}
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	req.Header.Set("x-ms-blob-type", "PageBlob")
	return req, nil
}

// createResponder handles the response to the Create request.
func (client pageBlobClient) createResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK, http.StatusCreated)
	if resp == nil {
		return nil, err
	}
	io.Copy(ioutil.Discard, resp.Response().Body)
	resp.Response().Body.Close()
	return &PageBlobCreateResponse{rawResponse: resp.Response()}, err
}

// GetPageRanges the Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a
// page blob
//
// snapshot is the snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to
// retrieve. For more information on working with blob snapshots, see Creating
// a Snapshot of a Blob. timeout is the timeout parameter is expressed in seconds. For more information, see Setting
// Timeouts for Blob Service Operations. rangeParameter is return only the bytes of the blob in the specified
// range. leaseID is if specified, the operation only succeeds if the container's lease is active and matches this ID.
// ifModifiedSince is specify this header value to operate only on a blob if it has been modified since the specified
// date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if it has not been modified
// since the specified date/time. ifMatches is specify an ETag value to operate only on blobs with a matching value.
// ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled.
func (client pageBlobClient) GetPageRanges(ctx context.Context, snapshot *string, timeout *int32, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageList, error) {
	if err := validate([]validation{
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.getPageRangesPreparer(snapshot, timeout, rangeParameter, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.getPageRangesResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageList), err
}

// getPageRangesPreparer prepares the GetPageRanges request.
func (client pageBlobClient) getPageRangesPreparer(snapshot *string, timeout *int32, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("GET", client.url, nil)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if snapshot != nil && len(*snapshot) > 0 {
		params.Set("snapshot", *snapshot)
	}
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	params.Set("comp", "pagelist")
	req.URL.RawQuery = params.Encode()
	if rangeParameter != nil {
		req.Header.Set("x-ms-range", *rangeParameter)
	}
	if leaseID != nil {
		req.Header.Set("x-ms-lease-id", *leaseID)
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	return req, nil
}

// getPageRangesResponder handles the response to the GetPageRanges request.
func (client pageBlobClient) getPageRangesResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK)
	if resp == nil {
		return nil, err
	}
	result := &PageList{rawResponse: resp.Response()}
	if err != nil {
		return result, err
	}
	defer resp.Response().Body.Close()
	b, err := ioutil.ReadAll(resp.Response().Body)
	if err != nil {
		return result, NewResponseError(err, resp.Response(), "failed to read response body")
	}
	if len(b) > 0 {
		b = removeBOM(b)
		err = xml.Unmarshal(b, result)
		if err != nil {
			return result, NewResponseError(err, resp.Response(), "failed to unmarshal response body")
		}
	}
	return result, nil
}

// GetPageRangesDiff [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob
// that were changed between target blob and previous snapshot.
//
// snapshot is the snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to
// retrieve. For more information on working with blob snapshots, see Creating
// a Snapshot of a Blob. timeout is the timeout parameter is expressed in seconds. For more information, see Setting
// Timeouts for Blob Service Operations. prevsnapshot is optional in version 2015-07-08 and newer. The prevsnapshot
// parameter is a DateTime value that specifies that the response will contain only pages that were changed between
// target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a
// snapshot, as long as the snapshot specified by prevsnapshot is the older of the two. Note that incremental snapshots
// are currently supported only for blobs created on or after January 1, 2016. rangeParameter is return only the bytes
// of the blob in the specified range. leaseID is if specified, the operation only succeeds if the container's lease is
// active and matches this ID. ifModifiedSince is specify this header value to operate only on a blob if it has been
// modified since the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if
// it has not been modified since the specified date/time. ifMatches is specify an ETag value to operate only on blobs
// with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value.
// requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics
// logs when storage analytics logging is enabled.
func (client pageBlobClient) GetPageRangesDiff(ctx context.Context, snapshot *string, timeout *int32, prevsnapshot *string, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageList, error) {
	if err := validate([]validation{
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.getPageRangesDiffPreparer(snapshot, timeout, prevsnapshot, rangeParameter, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.getPageRangesDiffResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageList), err
}

// getPageRangesDiffPreparer prepares the GetPageRangesDiff request.
func (client pageBlobClient) getPageRangesDiffPreparer(snapshot *string, timeout *int32, prevsnapshot *string, rangeParameter *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("GET", client.url, nil)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if snapshot != nil && len(*snapshot) > 0 {
		params.Set("snapshot", *snapshot)
	}
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	if prevsnapshot != nil && len(*prevsnapshot) > 0 {
		params.Set("prevsnapshot", *prevsnapshot)
	}
	params.Set("comp", "pagelist")
	req.URL.RawQuery = params.Encode()
	if rangeParameter != nil {
		req.Header.Set("x-ms-range", *rangeParameter)
	}
	if leaseID != nil {
		req.Header.Set("x-ms-lease-id", *leaseID)
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	return req, nil
}

// getPageRangesDiffResponder handles the response to the GetPageRangesDiff request.
func (client pageBlobClient) getPageRangesDiffResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK)
	if resp == nil {
		return nil, err
	}
	result := &PageList{rawResponse: resp.Response()}
	if err != nil {
		return result, err
	}
	defer resp.Response().Body.Close()
	b, err := ioutil.ReadAll(resp.Response().Body)
	if err != nil {
		return result, NewResponseError(err, resp.Response(), "failed to read response body")
	}
	if len(b) > 0 {
		b = removeBOM(b)
		err = xml.Unmarshal(b, result)
		if err != nil {
			return result, NewResponseError(err, resp.Response(), "failed to unmarshal response body")
		}
	}
	return result, nil
}

// Resize resize the Blob
//
// blobContentLength is this header specifies the maximum size for the page blob, up to 1 TB. The page blob size must
// be aligned to a 512-byte boundary. timeout is the timeout parameter is expressed in seconds. For more information,
// see Setting
// Timeouts for Blob Service Operations. leaseID is if specified, the operation only succeeds if the container's
// lease is active and matches this ID. ifModifiedSince is specify this header value to operate only on a blob if it
// has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a
// blob if it has not been modified since the specified date/time. ifMatches is specify an ETag value to operate only
// on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching
// value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
// analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) Resize(ctx context.Context, blobContentLength int64, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobResizeResponse, error) {
	if err := validate([]validation{
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.resizePreparer(blobContentLength, timeout, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.resizeResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageBlobResizeResponse), err
}

// resizePreparer prepares the Resize request.
func (client pageBlobClient) resizePreparer(blobContentLength int64, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("PUT", client.url, nil)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	params.Set("comp", "properties")
	req.URL.RawQuery = params.Encode()
	if leaseID != nil {
		req.Header.Set("x-ms-lease-id", *leaseID)
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	req.Header.Set("x-ms-blob-content-length", strconv.FormatInt(blobContentLength, 10))
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	return req, nil
}

// resizeResponder handles the response to the Resize request.
func (client pageBlobClient) resizeResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK)
	if resp == nil {
		return nil, err
	}
	io.Copy(ioutil.Discard, resp.Response().Body)
	resp.Response().Body.Close()
	return &PageBlobResizeResponse{rawResponse: resp.Response()}, err
}

// UpdateSequenceNumber update the sequence number of the blob
//
// sequenceNumberAction is required if the x-ms-blob-sequence-number header is set for the request. This property
// applies to page blobs only. This property indicates how the service should modify the blob's sequence number timeout
// is the timeout parameter is expressed in seconds. For more information, see Setting
// Timeouts for Blob Service Operations. leaseID is if specified, the operation only succeeds if the container's
// lease is active and matches this ID. ifModifiedSince is specify this header value to operate only on a blob if it
// has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a
// blob if it has not been modified since the specified date/time. ifMatches is specify an ETag value to operate only
// on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching
// value. blobSequenceNumber is set for page blobs only. The sequence number is a user-controlled value that you can
// use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled.
func (client pageBlobClient) UpdateSequenceNumber(ctx context.Context, sequenceNumberAction SequenceNumberActionType, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobSequenceNumber *int64, requestID *string) (*PageBlobUpdateSequenceNumberResponse, error) {
	if err := validate([]validation{
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.updateSequenceNumberPreparer(sequenceNumberAction, timeout, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, blobSequenceNumber, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.updateSequenceNumberResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageBlobUpdateSequenceNumberResponse), err
}

// updateSequenceNumberPreparer prepares the UpdateSequenceNumber request.
func (client pageBlobClient) updateSequenceNumberPreparer(sequenceNumberAction SequenceNumberActionType, timeout *int32, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, blobSequenceNumber *int64, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("PUT", client.url, nil)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	params.Set("comp", "properties")
	req.URL.RawQuery = params.Encode()
	if leaseID != nil {
		req.Header.Set("x-ms-lease-id", *leaseID)
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	req.Header.Set("x-ms-sequence-number-action", string(sequenceNumberAction))
	if blobSequenceNumber != nil {
		req.Header.Set("x-ms-blob-sequence-number", strconv.FormatInt(*blobSequenceNumber, 10))
	}
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	return req, nil
}

// updateSequenceNumberResponder handles the response to the UpdateSequenceNumber request.
func (client pageBlobClient) updateSequenceNumberResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK)
	if resp == nil {
		return nil, err
	}
	io.Copy(ioutil.Discard, resp.Response().Body)
	resp.Response().Body.Close()
	return &PageBlobUpdateSequenceNumberResponse{rawResponse: resp.Response()}, err
}

// UploadPages the Upload Pages operation writes a range of pages to a page blob
//
// body is initial data body will be closed upon successful return. Callers should ensure closure when receiving an
// error.contentLength is the length of the request. timeout is the timeout parameter is expressed in seconds. For more
// information, see Setting
// Timeouts for Blob Service Operations. rangeParameter is return only the bytes of the blob in the specified
// range. leaseID is if specified, the operation only succeeds if the container's lease is active and matches this ID.
// ifSequenceNumberLessThanOrEqualTo is specify this header value to operate only on a blob if it has a sequence number
// less than or equal to the specified. ifSequenceNumberLessThan is specify this header value to operate only on a blob
// if it has a sequence number less than the specified. ifSequenceNumberEqualTo is specify this header value to operate
// only on a blob if it has the specified sequence number. ifModifiedSince is specify this header value to operate only
// on a blob if it has been modified since the specified date/time. ifUnmodifiedSince is specify this header value to
// operate only on a blob if it has not been modified since the specified date/time. ifMatches is specify an ETag value
// to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
// recorded in the analytics logs when storage analytics logging is enabled.
func (client pageBlobClient) UploadPages(ctx context.Context, body io.ReadSeeker, contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (*PageBlobUploadPagesResponse, error) {
	if err := validate([]validation{
		{targetValue: body,
			constraints: []constraint{{target: "body", name: null, rule: true, chain: nil}}},
		{targetValue: timeout,
			constraints: []constraint{{target: "timeout", name: null, rule: false,
				chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
		return nil, err
	}
	req, err := client.uploadPagesPreparer(body, contentLength, timeout, rangeParameter, leaseID, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatches, ifNoneMatch, requestID)
	if err != nil {
		return nil, err
	}
	resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.uploadPagesResponder}, req)
	if err != nil {
		return nil, err
	}
	return resp.(*PageBlobUploadPagesResponse), err
}

// uploadPagesPreparer prepares the UploadPages request.
func (client pageBlobClient) uploadPagesPreparer(body io.ReadSeeker, contentLength int64, timeout *int32, rangeParameter *string, leaseID *string, ifSequenceNumberLessThanOrEqualTo *int64, ifSequenceNumberLessThan *int64, ifSequenceNumberEqualTo *int64, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatches *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
	req, err := pipeline.NewRequest("PUT", client.url, body)
	if err != nil {
		return req, pipeline.NewError(err, "failed to create request")
	}
	params := req.URL.Query()
	if timeout != nil {
		params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
	}
	params.Set("comp", "page")
	req.URL.RawQuery = params.Encode()
	req.Header.Set("Content-Length", strconv.FormatInt(contentLength, 10))
	if rangeParameter != nil {
		req.Header.Set("x-ms-range", *rangeParameter)
	}
	if leaseID != nil {
		req.Header.Set("x-ms-lease-id", *leaseID)
	}
	if ifSequenceNumberLessThanOrEqualTo != nil {
		req.Header.Set("x-ms-if-sequence-number-le", strconv.FormatInt(*ifSequenceNumberLessThanOrEqualTo, 10))
	}
	if ifSequenceNumberLessThan != nil {
		req.Header.Set("x-ms-if-sequence-number-lt", strconv.FormatInt(*ifSequenceNumberLessThan, 10))
	}
	if ifSequenceNumberEqualTo != nil {
		req.Header.Set("x-ms-if-sequence-number-eq", strconv.FormatInt(*ifSequenceNumberEqualTo, 10))
	}
	if ifModifiedSince != nil {
		req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifUnmodifiedSince != nil {
		req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
	}
	if ifMatches != nil {
		req.Header.Set("If-Match", string(*ifMatches))
	}
	if ifNoneMatch != nil {
		req.Header.Set("If-None-Match", string(*ifNoneMatch))
	}
	req.Header.Set("x-ms-version", ServiceVersion)
	if requestID != nil {
		req.Header.Set("x-ms-client-request-id", *requestID)
	}
	req.Header.Set("x-ms-page-write", "update")
	return req, nil
}

// uploadPagesResponder handles the response to the UploadPages request.
func (client pageBlobClient) uploadPagesResponder(resp pipeline.Response) (pipeline.Response, error) {
	err := validateResponse(resp, http.StatusOK, http.StatusCreated)
	if resp == nil {
		return nil, err
	}
	io.Copy(ioutil.Discard, resp.Response().Body)
	resp.Response().Body.Close()
	return &PageBlobUploadPagesResponse{rawResponse: resp.Response()}, err
}


text:
'use strict';
import 'babel-polyfill';
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { Router, Route, Redirect, IndexRoute, hashHistory } from 'react-router';
import store from './redux/store';

import UhOh from './views/uhoh';
import App from './views/app';
import Home from './views/home';
import Editor from './views/editor';
import Tasks from './views/tasks';
import Explore from './views/explore';
import Assets from './views/assets';
import AssetsIndex from './views/assets-index';
import AssetsAA from './views/assets-admin-area';
import AssetsDetail from './views/assets-detail';
import Upload from './views/upload';
import Faq from './views/faq';
import Job from './views/job';

const validateLanguage = ({ params: { lang } }, replace) => {
  if (lang !== 'en' && lang !== 'vi') {
    replace('/en/404');
  }
};

render((
  <Provider store={store}>
    <Router history={hashHistory}>
      <Redirect from='/' to='/en' />
      <Route path='/:lang' component={App} onEnter={validateLanguage}>
        <Route path='tasks' component={Tasks} pageClass='tasks' />
        <Route path='upload' component={Upload} pageClass='upload' />
        <Route path='editor' component={Editor} pageClass='editor' />
        <Route path='editor/*' component={Editor} pageClass='editor' />
        <Route path='explore' component={Explore} pageClass='explore' />
        <Route path='faq' component={Faq} pageClass='faq' />
        <Route path='jobs/:id' component={Job} pageClass='job' />
        <Route path='assets' component={Assets}>
          <IndexRoute component={AssetsIndex} pageClass='assets' />
          <Route path='road/:vpromm' component={AssetsDetail} pageClass='assets-inner-canvas' />
          <Route path=':aaId' component={AssetsAA} pageClass='assets-inner-canvas' />
          <Route path=':aaId/:aaIdSub' component={AssetsAA} pageClass='assets-inner-canvas' />
        </Route>
        <IndexRoute component={Home} pageClass='page--landing' />
        <Route path='*' component={UhOh}/>
      </Route>
    </Router>
  </Provider>
), document.querySelector('.site-canvas'));


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Hugo 0.83.1">
    <title>Product example · Bootstrap v5.0</title>

    <link rel="canonical" href="https://getbootstrap.com/docs/5.0/examples/product/">

<link href="../assets/dist/css/bootstrap.min.css" rel="stylesheet">

    <link href="product.css" rel="stylesheet">

      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="d-block mx-auto" role="img" viewBox="0 0 24 24"><title>Product</title><circle cx="12" cy="12" r="10"/><path d="M14.31 8l5.74 9.94M9.69 8h11.48M7.38 12l5.74-9.94M9.69 16L3.95 6.06M14.31 16H2.83m13.79-4l-5.74 9.94"/></svg>

    Tour
    Product
    Features
    Enterprise
    Support
    Pricing
    Cart

Sensor Dispenser Reinvented

And an even wittier subheading to boot. Jumpstart your marketing efforts with this example based on Apple's marketing pages.

      Coming soon

Another headline

And an even wittier subheading.

Another headline

And an even wittier subheading.

Another headline

And an even wittier subheading.

Another headline

And an even wittier subheading.

Another headline

And an even wittier subheading.

Another headline

And an even wittier subheading.

Another headline

And an even wittier subheading.

Another headline

And an even wittier subheading.

      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="d-block mb-2" role="img" viewBox="0 0 24 24"><title>Product</title><circle cx="12" cy="12" r="10"/><path d="M14.31 8l5.74 9.94M9.69 8h11.48M7.38 12l5.74-9.94M9.69 16L3.95 6.06M14.31 16H2.83m13.79-4l-5.74 9.94"/></svg>
      © 2017–2021

Features

Cool stuff

Random feature

Team feature

Stuff for developers

Another one

Last time

Resources

Resource name

Resource

Another resource

Final resource

Resources

Business

Education

Government

Gaming

About

Team

Locations

Privacy

Terms


text:
module Mongoid
  module Tags
    module Arent
      module Hard
        VERSION = "1.1.5"
      end
    end
  end
end


text:
Book notes - ZeroMQ by Pieter Hintjens, published by O'Reilly.

## Notes

## Table of Contents - Highlights

### I. Learning to Work with ØMQ

* 1. Basics
* 2. Sockets and Patterns
  * The Socket API
  * Messaging Patterns
  * Handling Errors and Interrupts
* 3. Advanced Request-Reply Patterns
  * The Request-Reply Mechanisms
  * Request-Reply Combinations
  * Exploring ROUTER Sockets
  * The Load-Balancing Pattern
  * A High-Level API for ØMQ
  * The Asynchronous Client/Server Pattern
  * Worked Example: Inter-Broker Routing
* 4. Reliable Request-Reply Patterns
* 5. Advanced Publish-Subscribe Patterns

### II. Software Engineering Using ØMQ

6. The ØMQ Community
7. Advanced Architecture Using ØMQ
8. A Framework for Distributed Computing

### Getting the Source

Example sources are maintained on [GitHub](https://github.com/booksbyus/zguide/tree/master/examples)

``
git clone https://github.com/booksbyus/zguide
```

## Credits and References

* [ZeroMQ](https://learning.oreilly.com/library/view/zeromq/9781449334437/) - O'Reilly
* [ZeroMQ](https://www.goodreads.com/book/show/15812621-zeromq) - goodreads
* [example code source](https://github.com/booksbyus/zguide/tree/master/examples)


text:
/*
 * The example requires a mySQL database "eclairjstesting" with a people table
 * the JDBC drivers must be added to the java class path
 *
 * Note to run this example you must include the JDBC jar file in the SPARK_CLASSPATH
 * as described https://spark.apache.org/docs/latest/sql-programming-guide.html#jdbc-to-other-databases
 * Another option is to include the --driver-class-path option on the command line for example:
 * <path to EclairJS>/bin/eclairjs.sh  --jars <path to JDBC jar file> --driver-class-path <path to JDBC jar file> <path to EclairJS>/examples/sql/sparkjdbc.js
 */
var SparkConf = require('eclairjs/SparkConf');
var SparkContext = require('eclairjs/SparkContext');
var SQLContext = require('eclairjs/sql/SQLContext');
var sparkContext = new SparkContext("local[*]", "dataframe");
var sqlContext = new SQLContext(sparkContext);
var url="jdbc:mysql://localhost:3306/eclairjstesting";
var prop = {};
prop["user"] = "root";
prop["password"] = "eclairjstestPW";
var peopleDF = sqlContext.read().jdbc(url, "people", prop);
peopleDF.show();
var peopleDF = sqlContext.read().jdbc(url, "people", ["age > 20"], prop);
peopleDF.show();
var writer = peopleDF.write();
try {
	writer.jdbc(url, "peoplewritetest", prop);
} catch (e) {
	print(" exception " + e);
	print("saving in overwrite mode");
	writer.mode('overwrite').jdbc(url, "peoplewritetest", prop);
}

//scala> val males = sqlContext.read.jdbc(url,"person",Array("gender='M'"),prop)


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

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="Blog and website of Lakshadeep Naik, blogging mainly for tech. Opinions expressed are mine." />
    <meta name="author" content="" />
    <meta name="keywords" content="lakshadeep, naik, lakshadeep naik, technology, nit goa, vacation labs, cloud, cloud robotics, nio, robotics, embedded, ros" />
    <link rel="canonical" href="http://lakshadeep.github.io//tags/software.html">

    <title>Lakshadeep Naik  | software</title>

    <link href="/css/bootstrap.min.css" rel="stylesheet">

    <link href="/css/grayscale.css" rel="stylesheet">
    <link href="/css/timeline.css" rel="stylesheet">

    <link href="/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="/css/pygments/default.css">

    <link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico">

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">

            </button>

  Lakshadeep Naik

                         About

                         Blog

                         Career

                         Contact

#software

26 Sep 2015 . tech .  beware!! robot is following you   Comments

Copyright ©  2016


text:
.class public Lcom/htc/wrap/com/android/internal/telephony/HtcWrapOperatorInfo;
.super Ljava/lang/Object;
.source "HtcWrapOperatorInfo.java"

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 5
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public getAct(Lcom/android/internal/telephony/OperatorInfo;)Ljava/lang/String;
    .locals 1
    .parameter "instance"

    .prologue
    .line 23
    invoke-virtual {p1}, Lcom/android/internal/telephony/OperatorInfo;->getAct()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getOperatorInfoInstance(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/android/internal/telephony/OperatorInfo;
    .locals 7
    .parameter "operatorAlphaLong"
    .parameter "operatorAlphaShort"
    .parameter "operatorNumeric"
    .parameter "stateString"
    .parameter "onsLevel"
    .parameter "AcT"

    .prologue
    .line 16
    new-instance v0, Lcom/android/internal/telephony/OperatorInfo;

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v5, p5

    move-object v6, p6

    invoke-direct/range {v0 .. v6}, Lcom/android/internal/telephony/OperatorInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    return-object v0
.end method


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 32(3/4): 284 (1934)

#### Original name
Allonema Sydow, 1934

### Remarks
null


text:
package org.swingeasy;

import java.awt.AWTEvent;
import java.awt.Cursor;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent;

import javax.swing.JPanel;
import javax.swing.SwingUtilities;

/**
 * GlassPane tutorial "A well-behaved GlassPane" http://weblogs.java.net/blog/alexfromsun/
 * <p/>
 * This is the final version of the GlassPane it is transparent for MouseEvents, and respects underneath component's cursors by default, it is also
 * friedly for other users, if someone adds a mouseListener to this GlassPane or set a new cursor it will respect them
 *
 * @author Alexander Potochkin
 */
public class NonBlockingGlassPane extends JPanel implements AWTEventListener {

    private static final long serialVersionUID = -2073312139654377382L;

    private final Window frame;

    public NonBlockingGlassPane(Window frame) {
        super(null);
        this.frame = frame;
        this.setOpaque(false);
        Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    }

    /**
     * If someone adds a mouseListener to the GlassPane or set a new cursor we expect that he knows what he is doing and return the super.contains(x,
     * y) otherwise we return false to respect the cursors for the underneath components
     */
    @Override
    public boolean contains(int x, int y) {
        if ((this.getMouseListeners().length == 0) && (this.getMouseMotionListeners().length == 0) && (this.getMouseWheelListeners().length == 0)
                && (this.getCursor() == Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR))) {
            return false;
        }
        return super.contains(x, y);
    }

    /**
     *
     * @see java.awt.event.AWTEventListener#eventDispatched(java.awt.AWTEvent)
     */
    @Override
    public void eventDispatched(AWTEvent event) {
        if (event instanceof MouseEvent) {
            MouseEvent me = (MouseEvent) event;
            if (me.getComponent() == null) {
                return;
            }
            if (!SwingUtilities.isDescendingFrom(me.getComponent(), this.frame)) {
                return;
            }
        }
    }
}