text:
# Contents [#](#contents 'Go To Here')

- [AttributeRoutingRegistration](#T-Nancy.AttributeRouting.AttributeRoutingRegistration 'Nancy.AttributeRouting.AttributeRoutingRegistration')
  - [#ctor(typeProvider)](#M-Nancy.AttributeRouting.AttributeRoutingRegistration.#ctor-Nancy.AttributeRouting.ITypeProvider- 'Nancy.AttributeRouting.AttributeRoutingRegistration.#ctor(Nancy.AttributeRouting.ITypeProvider)')
  - [CollectionTypeRegistrations](#P-Nancy.AttributeRouting.AttributeRoutingRegistration.CollectionTypeRegistrations 'Nancy.AttributeRouting.AttributeRoutingRegistration.CollectionTypeRegistrations')
  - [InstanceRegistrations](#P-Nancy.AttributeRouting.AttributeRoutingRegistration.InstanceRegistrations 'Nancy.AttributeRouting.AttributeRoutingRegistration.InstanceRegistrations')
  - [TypeRegistrations](#P-Nancy.AttributeRouting.AttributeRoutingRegistration.TypeRegistrations 'Nancy.AttributeRouting.AttributeRoutingRegistration.TypeRegistrations')
- [AttributeRoutingResolver](#T-Nancy.AttributeRouting.AttributeRoutingResolver 'Nancy.AttributeRouting.AttributeRoutingResolver')
  - [#ctor(container)](#M-Nancy.AttributeRouting.AttributeRoutingResolver.#ctor-Nancy.TinyIoc.TinyIoCContainer- 'Nancy.AttributeRouting.AttributeRoutingResolver.#ctor(Nancy.TinyIoc.TinyIoCContainer)')
- [BeforeAttribute](#T-Nancy.AttributeRouting.BeforeAttribute 'Nancy.AttributeRouting.BeforeAttribute')
  - [Process(container,context)](#M-Nancy.AttributeRouting.BeforeAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Nancy.AttributeRouting.BeforeAttribute.Process(Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext)')
- [DefaultTypeProvider](#T-Nancy.AttributeRouting.DefaultTypeProvider 'Nancy.AttributeRouting.DefaultTypeProvider')
  - [Types](#P-Nancy.AttributeRouting.DefaultTypeProvider.Types 'Nancy.AttributeRouting.DefaultTypeProvider.Types')
- [DeleteAttribute](#T-Nancy.AttributeRouting.DeleteAttribute 'Nancy.AttributeRouting.DeleteAttribute')
  - [#ctor(path)](#M-Nancy.AttributeRouting.DeleteAttribute.#ctor-System.String- 'Nancy.AttributeRouting.DeleteAttribute.#ctor(System.String)')
- [DuplicatedRoutingPathsException](#T-Nancy.AttributeRouting.Exceptions.DuplicatedRoutingPathsException 'Nancy.AttributeRouting.Exceptions.DuplicatedRoutingPathsException')
- [GetAttribute](#T-Nancy.AttributeRouting.GetAttribute 'Nancy.AttributeRouting.GetAttribute')
  - [#ctor(path)](#M-Nancy.AttributeRouting.GetAttribute.#ctor-System.String- 'Nancy.AttributeRouting.GetAttribute.#ctor(System.String)')
- [ITypeProvider](#T-Nancy.AttributeRouting.ITypeProvider 'Nancy.AttributeRouting.ITypeProvider')
  - [Types](#P-Nancy.AttributeRouting.ITypeProvider.Types 'Nancy.AttributeRouting.ITypeProvider.Types')
- [IUrlBuilder](#T-Nancy.AttributeRouting.IUrlBuilder 'Nancy.AttributeRouting.IUrlBuilder')
  - [GetUrl\`\`1(expression)](#M-Nancy.AttributeRouting.IUrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}}- 'Nancy.AttributeRouting.IUrlBuilder.GetUrl``1(System.Linq.Expressions.Expression{System.Func{``0,System.Object}})')
  - [GetUrl\`\`1(expression,parameters)](#M-Nancy.AttributeRouting.IUrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Object- 'Nancy.AttributeRouting.IUrlBuilder.GetUrl``1(System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Object)')
  - [GetUrl\`\`1(expression,parameters)](#M-Nancy.AttributeRouting.IUrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Collections.Generic.IDictionary{System.String,System.String}- 'Nancy.AttributeRouting.IUrlBuilder.GetUrl``1(System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Collections.Generic.IDictionary{System.String,System.String})')
- [MultipleBeforeAttributeException](#T-Nancy.AttributeRouting.Exceptions.MultipleBeforeAttributeException 'Nancy.AttributeRouting.Exceptions.MultipleBeforeAttributeException')
- [MultipleRouteAttributesException](#T-Nancy.AttributeRouting.Exceptions.MultipleRouteAttributesException 'Nancy.AttributeRouting.Exceptions.MultipleRouteAttributesException')
- [NoRouteAttributeException](#T-Nancy.AttributeRouting.Exceptions.NoRouteAttributeException 'Nancy.AttributeRouting.Exceptions.NoRouteAttributeException')
- [OptionsAttribute](#T-Nancy.AttributeRouting.OptionsAttribute 'Nancy.AttributeRouting.OptionsAttribute')
  - [#ctor(path)](#M-Nancy.AttributeRouting.OptionsAttribute.#ctor-System.String- 'Nancy.AttributeRouting.OptionsAttribute.#ctor(System.String)')
- [PatchAttribute](#T-Nancy.AttributeRouting.PatchAttribute 'Nancy.AttributeRouting.PatchAttribute')
  - [#ctor(path)](#M-Nancy.AttributeRouting.PatchAttribute.#ctor-System.String- 'Nancy.AttributeRouting.PatchAttribute.#ctor(System.String)')
- [PostAttribute](#T-Nancy.AttributeRouting.PostAttribute 'Nancy.AttributeRouting.PostAttribute')
  - [#ctor(path)](#M-Nancy.AttributeRouting.PostAttribute.#ctor-System.String- 'Nancy.AttributeRouting.PostAttribute.#ctor(System.String)')
- [PutAttribute](#T-Nancy.AttributeRouting.PutAttribute 'Nancy.AttributeRouting.PutAttribute')
  - [#ctor(path)](#M-Nancy.AttributeRouting.PutAttribute.#ctor-System.String- 'Nancy.AttributeRouting.PutAttribute.#ctor(System.String)')
- [RequiresAnyClaimAttribute](#T-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute 'Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute')
  - [#ctor(requiredClaims)](#M-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.#ctor-System.Collections.Generic.IEnumerable{System.String}- 'Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.#ctor(System.Collections.Generic.IEnumerable{System.String})')
  - [#ctor()](#M-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.#ctor-System.String[]- 'Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.#ctor(System.String[])')
  - [Process()](#M-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.Process(Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext)')
- [RequiresAuthenticationAttribute](#T-Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute 'Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute')
  - [Process()](#M-Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute.Process(Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext)')
- [RequiresClaimsAttribute](#T-Nancy.AttributeRouting.Security.RequiresClaimsAttribute 'Nancy.AttributeRouting.Security.RequiresClaimsAttribute')
  - [#ctor(claims)](#M-Nancy.AttributeRouting.Security.RequiresClaimsAttribute.#ctor-System.Collections.Generic.IEnumerable{System.String}- 'Nancy.AttributeRouting.Security.RequiresClaimsAttribute.#ctor(System.Collections.Generic.IEnumerable{System.String})')
  - [#ctor()](#M-Nancy.AttributeRouting.Security.RequiresClaimsAttribute.#ctor-System.String[]- 'Nancy.AttributeRouting.Security.RequiresClaimsAttribute.#ctor(System.String[])')
  - [Process()](#M-Nancy.AttributeRouting.Security.RequiresClaimsAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Nancy.AttributeRouting.Security.RequiresClaimsAttribute.Process(Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext)')
- [RequiresHttpsAttribute](#T-Nancy.AttributeRouting.Security.RequiresHttpsAttribute 'Nancy.AttributeRouting.Security.RequiresHttpsAttribute')
  - [#ctor()](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor 'Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor')
  - [#ctor()](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor-System.Boolean- 'Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor(System.Boolean)')
  - [#ctor(redirect,httpsPort)](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor-System.Boolean,System.Int32- 'Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor(System.Boolean,System.Int32)')
  - [Process()](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Nancy.AttributeRouting.Security.RequiresHttpsAttribute.Process(Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext)')
- [RequiresValidatedClaimsAttribute](#T-Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute 'Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute')
  - [IsValid(claims)](#M-Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute.IsValid-System.Collections.Generic.IEnumerable{System.String}- 'Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute.IsValid(System.Collections.Generic.IEnumerable{System.String})')
  - [Process()](#M-Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute.Process(Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext)')
- [RouteAttribute](#T-Nancy.AttributeRouting.RouteAttribute 'Nancy.AttributeRouting.RouteAttribute')
- [RouteInheritAttribute](#T-Nancy.AttributeRouting.RouteInheritAttribute 'Nancy.AttributeRouting.RouteInheritAttribute')
  - [#ctor(type)](#M-Nancy.AttributeRouting.RouteInheritAttribute.#ctor-System.Type- 'Nancy.AttributeRouting.RouteInheritAttribute.#ctor(System.Type)')
- [RoutePrefixAttribute](#T-Nancy.AttributeRouting.RoutePrefixAttribute 'Nancy.AttributeRouting.RoutePrefixAttribute')
  - [#ctor(prefix)](#M-Nancy.AttributeRouting.RoutePrefixAttribute.#ctor-System.String- 'Nancy.AttributeRouting.RoutePrefixAttribute.#ctor(System.String)')
- [UrlBuilder](#T-Nancy.AttributeRouting.UrlBuilder 'Nancy.AttributeRouting.UrlBuilder')
  - [#ctor()](#M-Nancy.AttributeRouting.UrlBuilder.#ctor-Nancy.Routing.IRouteSegmentExtractor- 'Nancy.AttributeRouting.UrlBuilder.#ctor(Nancy.Routing.IRouteSegmentExtractor)')
  - [GetUrl\`\`1()](#M-Nancy.AttributeRouting.UrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}}- 'Nancy.AttributeRouting.UrlBuilder.GetUrl``1(System.Linq.Expressions.Expression{System.Func{``0,System.Object}})')
  - [GetUrl\`\`1()](#M-Nancy.AttributeRouting.UrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Object- 'Nancy.AttributeRouting.UrlBuilder.GetUrl``1(System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Object)')
  - [GetUrl\`\`1()](#M-Nancy.AttributeRouting.UrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Collections.Generic.IDictionary{System.String,System.String}- 'Nancy.AttributeRouting.UrlBuilder.GetUrl``1(System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Collections.Generic.IDictionary{System.String,System.String})')
- [ViewAttribute](#T-Nancy.AttributeRouting.ViewAttribute 'Nancy.AttributeRouting.ViewAttribute')
  - [#ctor(path)](#M-Nancy.AttributeRouting.ViewAttribute.#ctor-System.String- 'Nancy.AttributeRouting.ViewAttribute.#ctor(System.String)')
- [ViewPrefixAttribute](#T-Nancy.AttributeRouting.ViewPrefixAttribute 'Nancy.AttributeRouting.ViewPrefixAttribute')
  - [#ctor(prefix)](#M-Nancy.AttributeRouting.ViewPrefixAttribute.#ctor-System.String- 'Nancy.AttributeRouting.ViewPrefixAttribute.#ctor(System.String)')

# Nancy.AttributeRouting [#](#assembly 'Go To Here') [^](#contents 'Back To Contents')

## AttributeRoutingRegistration [#](#T-Nancy.AttributeRouting.AttributeRoutingRegistration 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

*Inherit from parent.*

### #ctor(typeProvider) `constructor` [#](#M-Nancy.AttributeRouting.AttributeRoutingRegistration.#ctor-Nancy.AttributeRouting.ITypeProvider- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [AttributeRoutingRegistration](#T-Nancy.AttributeRouting.AttributeRoutingRegistration 'Nancy.AttributeRouting.AttributeRoutingRegistration') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| typeProvider | [Nancy.AttributeRouting.ITypeProvider](#T-Nancy.AttributeRouting.ITypeProvider 'Nancy.AttributeRouting.ITypeProvider') | The routing type provider. |

### CollectionTypeRegistrations `property` [#](#P-Nancy.AttributeRouting.AttributeRoutingRegistration.CollectionTypeRegistrations 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

### InstanceRegistrations `property` [#](#P-Nancy.AttributeRouting.AttributeRoutingRegistration.InstanceRegistrations 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

### TypeRegistrations `property` [#](#P-Nancy.AttributeRouting.AttributeRoutingRegistration.TypeRegistrations 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

## AttributeRoutingResolver [#](#T-Nancy.AttributeRouting.AttributeRoutingResolver 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The class to resolve routing attributes.

### #ctor(container) `constructor` [#](#M-Nancy.AttributeRouting.AttributeRoutingResolver.#ctor-Nancy.TinyIoc.TinyIoCContainer- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [AttributeRoutingResolver](#T-Nancy.AttributeRouting.AttributeRoutingResolver 'Nancy.AttributeRouting.AttributeRoutingResolver') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| container | [Nancy.TinyIoc.TinyIoCContainer](#T-Nancy.TinyIoc.TinyIoCContainer 'Nancy.TinyIoc.TinyIoCContainer') | The Nancy IoC container. |

## BeforeAttribute [#](#T-Nancy.AttributeRouting.BeforeAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

Before attribute provides a hook to execute before enter the view model execution.

### Process(container,context) `method` [#](#M-Nancy.AttributeRouting.BeforeAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Process the custom code and determine whether continue on view model execution.

##### Returns

The response. If this is `null`, it will continue on view model execution, otherwise it returns the this value directly.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| container | [Nancy.TinyIoc.TinyIoCContainer](#T-Nancy.TinyIoc.TinyIoCContainer 'Nancy.TinyIoc.TinyIoCContainer') | The Tiny IoC container. It provides [IUrlBuilder](#T-Nancy.AttributeRouting.IUrlBuilder 'Nancy.AttributeRouting.IUrlBuilder') and others to construct the response. |
| context | [Nancy.NancyContext](#T-Nancy.NancyContext 'Nancy.NancyContext') | The Nancy context. It provides user information and others to determine whether continue view model execution. |

## DefaultTypeProvider [#](#T-Nancy.AttributeRouting.DefaultTypeProvider 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The default type provider for routing register.

### Types `property` [#](#P-Nancy.AttributeRouting.DefaultTypeProvider.Types 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

## DeleteAttribute [#](#T-Nancy.AttributeRouting.DeleteAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The Delete attribute. It indicates that this method hit with HTTP DELETE method.

### #ctor(path) `constructor` [#](#M-Nancy.AttributeRouting.DeleteAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [DeleteAttribute](#T-Nancy.AttributeRouting.DeleteAttribute 'Nancy.AttributeRouting.DeleteAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The path to register into routing table. |

## DuplicatedRoutingPathsException [#](#T-Nancy.AttributeRouting.Exceptions.DuplicatedRoutingPathsException 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Exceptions

##### Summary

[DuplicatedRoutingPathsException](#T-Nancy.AttributeRouting.Exceptions.DuplicatedRoutingPathsException 'Nancy.AttributeRouting.Exceptions.DuplicatedRoutingPathsException') indicates two or more methods are decorated with a same routing path on a same HTTP method.

## GetAttribute [#](#T-Nancy.AttributeRouting.GetAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The Get attribute. It indicates that this method hit with HTTP GET method.

### #ctor(path) `constructor` [#](#M-Nancy.AttributeRouting.GetAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [GetAttribute](#T-Nancy.AttributeRouting.GetAttribute 'Nancy.AttributeRouting.GetAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The path to register into routing table. |

## ITypeProvider [#](#T-Nancy.AttributeRouting.ITypeProvider 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

Type provider to provide types for routing register.

### Types `property` [#](#P-Nancy.AttributeRouting.ITypeProvider.Types 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Gets the type list for routing register. Their methods decorated with [RouteAttribute](#T-Nancy.AttributeRouting.RouteAttribute 'Nancy.AttributeRouting.RouteAttribute') will be registed to routing table. By default, all types will be registed.

## IUrlBuilder [#](#T-Nancy.AttributeRouting.IUrlBuilder 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The URL builder interface. It accepts an expression related to a view model, then construct the URL string corresponding to the view model call.

### GetUrl\`\`1(expression) `method` [#](#M-Nancy.AttributeRouting.IUrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}}- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Gets URL from the method call of a `T` instance.

##### Returns

The constructed URL string.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| expression | [System.Linq.Expressions.Expression{System.Func{\`\`0,System.Object}}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Linq.Expressions.Expression 'System.Linq.Expressions.Expression{System.Func{``0,System.Object}}') | The method call lambda expression from a `T` instance. |

##### Generic Types

| Name | Description |
| ---- | ----------- |
| T | A view model class decorates with routing attributes. |

### GetUrl\`\`1(expression,parameters) `method` [#](#M-Nancy.AttributeRouting.IUrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Object- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Gets URL from the method call of a `T` instance.

##### Returns

The constructed URL string.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| expression | [System.Linq.Expressions.Expression{System.Func{\`\`0,System.Object}}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Linq.Expressions.Expression 'System.Linq.Expressions.Expression{System.Func{``0,System.Object}}') | The method call lambda expression from a `T` instance. |
| parameters | [System.Object](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Object 'System.Object') | The parameter object to provide additional information to construct the URL. The object will be converted into dictionary then invoke another overload. |

##### Generic Types

| Name | Description |
| ---- | ----------- |
| T | A view model class decorates with routing attributes. |

### GetUrl\`\`1(expression,parameters) `method` [#](#M-Nancy.AttributeRouting.IUrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Collections.Generic.IDictionary{System.String,System.String}- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Gets URL from the method call of a `T` instance.

##### Returns

The constructed URL string.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| expression | [System.Linq.Expressions.Expression{System.Func{\`\`0,System.Object}}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Linq.Expressions.Expression 'System.Linq.Expressions.Expression{System.Func{``0,System.Object}}') | The method call lambda expression from a `T` instance. |
| parameters | [System.Collections.Generic.IDictionary{System.String,System.String}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Collections.Generic.IDictionary 'System.Collections.Generic.IDictionary{System.String,System.String}') | The parameter dictionary to provide additional information to construct the URL. The dictionary key is the routing template placeholder, the dictionary value is the actual value to replace the placeholder. |

##### Generic Types

| Name | Description |
| ---- | ----------- |
| T | A view model class decorates with routing attributes. |

## MultipleBeforeAttributeException [#](#T-Nancy.AttributeRouting.Exceptions.MultipleBeforeAttributeException 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Exceptions

##### Summary

[MultipleBeforeAttributeException](#T-Nancy.AttributeRouting.Exceptions.MultipleBeforeAttributeException 'Nancy.AttributeRouting.Exceptions.MultipleBeforeAttributeException') indicates multiple before attributes are decorated on method or type.

## MultipleRouteAttributesException [#](#T-Nancy.AttributeRouting.Exceptions.MultipleRouteAttributesException 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Exceptions

##### Summary

[MultipleRouteAttributesException](#T-Nancy.AttributeRouting.Exceptions.MultipleRouteAttributesException 'Nancy.AttributeRouting.Exceptions.MultipleRouteAttributesException') indicates multiple route attributes are decorated on method.

## NoRouteAttributeException [#](#T-Nancy.AttributeRouting.Exceptions.NoRouteAttributeException 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Exceptions

##### Summary

[NoRouteAttributeException](#T-Nancy.AttributeRouting.Exceptions.NoRouteAttributeException 'Nancy.AttributeRouting.Exceptions.NoRouteAttributeException') indicates no route attribute is decorated on method.

## OptionsAttribute [#](#T-Nancy.AttributeRouting.OptionsAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The Options attribute. It indicates that this method hit with HTTP OPTIONS method.

### #ctor(path) `constructor` [#](#M-Nancy.AttributeRouting.OptionsAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [OptionsAttribute](#T-Nancy.AttributeRouting.OptionsAttribute 'Nancy.AttributeRouting.OptionsAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The path to register into routing table. |

## PatchAttribute [#](#T-Nancy.AttributeRouting.PatchAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The Patch attribute. It indicates that this method hit with HTTP PATCH method.

### #ctor(path) `constructor` [#](#M-Nancy.AttributeRouting.PatchAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [PatchAttribute](#T-Nancy.AttributeRouting.PatchAttribute 'Nancy.AttributeRouting.PatchAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The path to register into routing table. |

## PostAttribute [#](#T-Nancy.AttributeRouting.PostAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The Post attribute. It indicates that this method hit with HTTP POST method.

### #ctor(path) `constructor` [#](#M-Nancy.AttributeRouting.PostAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [PostAttribute](#T-Nancy.AttributeRouting.PostAttribute 'Nancy.AttributeRouting.PostAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The path to register into routing table. |

## PutAttribute [#](#T-Nancy.AttributeRouting.PutAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The Put attribute. It indicates that this method hit with HTTP PUT method.

### #ctor(path) `constructor` [#](#M-Nancy.AttributeRouting.PutAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [PutAttribute](#T-Nancy.AttributeRouting.PutAttribute 'Nancy.AttributeRouting.PutAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The path to register into routing table. |

## RequiresAnyClaimAttribute [#](#T-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Security

##### Summary

The member decorated with [RequiresAnyClaimAttribute](#T-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute 'Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute') indicates it requires authentication and any one of certain claims to be present.

### #ctor(requiredClaims) `constructor` [#](#M-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.#ctor-System.Collections.Generic.IEnumerable{System.String}- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [RequiresAnyClaimAttribute](#T-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute 'Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| requiredClaims | [System.Collections.Generic.IEnumerable{System.String}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Collections.Generic.IEnumerable 'System.Collections.Generic.IEnumerable{System.String}') | The claims to be present for authentication. |

### #ctor() `constructor` [#](#M-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.#ctor-System.String[]- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This constructor has no parameters.

### Process() `method` [#](#M-Nancy.AttributeRouting.Security.RequiresAnyClaimAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

## RequiresAuthenticationAttribute [#](#T-Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Security

##### Summary

The member decorated with [RequiresAuthenticationAttribute](#T-Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute 'Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute') indicates it requires authentication.

### Process() `method` [#](#M-Nancy.AttributeRouting.Security.RequiresAuthenticationAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

## RequiresClaimsAttribute [#](#T-Nancy.AttributeRouting.Security.RequiresClaimsAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Security

##### Summary

The member decorated with [RequiresClaimsAttribute](#T-Nancy.AttributeRouting.Security.RequiresClaimsAttribute 'Nancy.AttributeRouting.Security.RequiresClaimsAttribute') indicates it requires authentication and certain claims to be present.

### #ctor(claims) `constructor` [#](#M-Nancy.AttributeRouting.Security.RequiresClaimsAttribute.#ctor-System.Collections.Generic.IEnumerable{System.String}- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [RequiresClaimsAttribute](#T-Nancy.AttributeRouting.Security.RequiresClaimsAttribute 'Nancy.AttributeRouting.Security.RequiresClaimsAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| claims | [System.Collections.Generic.IEnumerable{System.String}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Collections.Generic.IEnumerable 'System.Collections.Generic.IEnumerable{System.String}') | The claims to be present for authentication. |

### #ctor() `constructor` [#](#M-Nancy.AttributeRouting.Security.RequiresClaimsAttribute.#ctor-System.String[]- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This constructor has no parameters.

### Process() `method` [#](#M-Nancy.AttributeRouting.Security.RequiresClaimsAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

## RequiresHttpsAttribute [#](#T-Nancy.AttributeRouting.Security.RequiresHttpsAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Security

##### Summary

The member decorated with [RequiresHttpsAttribute](#T-Nancy.AttributeRouting.Security.RequiresHttpsAttribute 'Nancy.AttributeRouting.Security.RequiresHttpsAttribute') indicates it requires HTTPS protocol.

### #ctor() `constructor` [#](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This constructor has no parameters.

### #ctor() `constructor` [#](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor-System.Boolean- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This constructor has no parameters.

### #ctor(redirect,httpsPort) `constructor` [#](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.#ctor-System.Boolean,System.Int32- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [RequiresHttpsAttribute](#T-Nancy.AttributeRouting.Security.RequiresHttpsAttribute 'Nancy.AttributeRouting.Security.RequiresHttpsAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| redirect | [System.Boolean](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Boolean 'System.Boolean') | True if the user should be redirected to HTTPS if the incoming request was made using HTTP, otherwise false if [Forbidden](#F-Nancy.HttpStatusCode.Forbidden 'Nancy.HttpStatusCode.Forbidden') should be returned. |
| httpsPort | [System.Int32](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Int32 'System.Int32') | The HTTPS port number to use |

### Process() `method` [#](#M-Nancy.AttributeRouting.Security.RequiresHttpsAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

## RequiresValidatedClaimsAttribute [#](#T-Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting.Security

##### Summary

The member decorated with [RequiresValidatedClaimsAttribute](#T-Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute 'Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute') indicates it requires claims to be validated.

### IsValid(claims) `method` [#](#M-Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute.IsValid-System.Collections.Generic.IEnumerable{System.String}- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

The implementation to validate claims.

##### Returns

True if the claims is valid, otherwise false.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| claims | [System.Collections.Generic.IEnumerable{System.String}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Collections.Generic.IEnumerable 'System.Collections.Generic.IEnumerable{System.String}') | The claims from request. |

### Process() `method` [#](#M-Nancy.AttributeRouting.Security.RequiresValidatedClaimsAttribute.Process-Nancy.TinyIoc.TinyIoCContainer,Nancy.NancyContext- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

## RouteAttribute [#](#T-Nancy.AttributeRouting.RouteAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The Route attribute indicates the routing path to handle the request.

## RouteInheritAttribute [#](#T-Nancy.AttributeRouting.RouteInheritAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

[RouteInheritAttribute](#T-Nancy.AttributeRouting.RouteInheritAttribute 'Nancy.AttributeRouting.RouteInheritAttribute') indicates a type inherit another type's routing information, including routing prefix, view prefix and before hooks.

### #ctor(type) `constructor` [#](#M-Nancy.AttributeRouting.RouteInheritAttribute.#ctor-System.Type- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [RouteInheritAttribute](#T-Nancy.AttributeRouting.RouteInheritAttribute 'Nancy.AttributeRouting.RouteInheritAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| type | [System.Type](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Type 'System.Type') | The type to inherit its routing information. |

## RoutePrefixAttribute [#](#T-Nancy.AttributeRouting.RoutePrefixAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The RoutePrefix attribute. It decorates on class, indicates the path from route attribute on the class and child class will be prefixed.

### #ctor(prefix) `constructor` [#](#M-Nancy.AttributeRouting.RoutePrefixAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [RoutePrefixAttribute](#T-Nancy.AttributeRouting.RoutePrefixAttribute 'Nancy.AttributeRouting.RoutePrefixAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| prefix | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The prefix string for the route attribute path. |

## UrlBuilder [#](#T-Nancy.AttributeRouting.UrlBuilder 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

*Inherit from parent.*

### #ctor() `constructor` [#](#M-Nancy.AttributeRouting.UrlBuilder.#ctor-Nancy.Routing.IRouteSegmentExtractor- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This constructor has no parameters.

### GetUrl\`\`1() `method` [#](#M-Nancy.AttributeRouting.UrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}}- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

### GetUrl\`\`1() `method` [#](#M-Nancy.AttributeRouting.UrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Object- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

### GetUrl\`\`1() `method` [#](#M-Nancy.AttributeRouting.UrlBuilder.GetUrl``1-System.Linq.Expressions.Expression{System.Func{``0,System.Object}},System.Collections.Generic.IDictionary{System.String,System.String}- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

*Inherit from parent.*

##### Parameters

This method has no parameters.

## ViewAttribute [#](#T-Nancy.AttributeRouting.ViewAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The View attribute indicates the view path to render from request.

##### Example

The following code will render `View/index.html` with routing instance.

```
View('View/index.html')
```

### #ctor(path) `constructor` [#](#M-Nancy.AttributeRouting.ViewAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [ViewAttribute](#T-Nancy.AttributeRouting.ViewAttribute 'Nancy.AttributeRouting.ViewAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The view path for rendering. |

## ViewPrefixAttribute [#](#T-Nancy.AttributeRouting.ViewPrefixAttribute 'Go To Here') [^](#contents 'Back To Contents')

##### Namespace

Nancy.AttributeRouting

##### Summary

The ViewPrefix attribute. It decorates on class, indicates the View attribute works with this prefix to locate paths.

### #ctor(prefix) `constructor` [#](#M-Nancy.AttributeRouting.ViewPrefixAttribute.#ctor-System.String- 'Go To Here') [^](#contents 'Back To Contents')

##### Summary

Initializes a new instance of the [ViewPrefixAttribute](#T-Nancy.AttributeRouting.ViewPrefixAttribute 'Nancy.AttributeRouting.ViewPrefixAttribute') class.

##### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| prefix | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The path prefix. |


text:
Inserts a dimension of 1 into a tensor's shape.

Given a tensor `input`, this operation inserts a dimension of 1 at the
dimension index `dim` of `input`'s shape. The dimension index `dim` starts at
zero; if you specify a negative number for `dim` it is counted backward from
the end.

This operation is useful if you want to add a batch dimension to a single
element. For example, if you have a single image of shape `[height, width,
channels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`,
which will make the shape `[1, height, width, channels]`.

Other examples:

```prettyprint
# 't' is a tensor of shape [2]
shape(expand_dims(t, 0)) ==> [1, 2]
shape(expand_dims(t, 1)) ==> [2, 1]
shape(expand_dims(t, -1)) ==> [2, 1]

# 't2' is a tensor of shape [2, 3, 5]
shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]
shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]
shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]
```

This operation requires that:

`-1-input.dims() <= dim <= input.dims()`

This operation is related to `squeeze()`, which removes dimensions of
size 1.

##### Args:

*  <b>`input`</b>: A `Tensor`.
*  <b>`dim`</b>: A `Tensor` of type `int32`.
    0-D (scalar). Specifies the dimension index at which to
    expand the shape of `input`.
*  <b>`name`</b>: A name for the operation (optional).

##### Returns:

  A `Tensor`. Has the same type as `input`.
  Contains the same data as `input`, but its shape has an additional
  dimension of size 1 added.

redpajama_set_name: RedPajamaGithub


text:
SkipDict
========

A skip dict is a Python dictionary which is permanently sorted by
value. This package provides a fast, idiomatic implementation written
in C with an extensive test suite.

The data structure uses a `skip list
<http://en.wikipedia.org/wiki/Skip_list>`_ internally.

An example use is a leaderboard where the skip dict provides
logarithmic access to the score and ranking of each user, as well as
efficient iteration in either direction from any node.

Compatible with Python 2.7+ and Python 3.3+.

Usage
-----

The skip dict works just like a normal dictionary except it maps only
to floating point values::

  from skipdict import SkipDict

  skipdict = SkipDict(maxlevel=4)

  skipdict['foo'] = 1.0
  skipdict['bar'] = 2.0

The ``SkipDict`` optionally takes a dictionary or a sequence of
``(key, value)`` pairs::

  skipdict = SkipDict({'foo': 1.0, 'bar': 2.0})
  skipdict = SkipDict(('foo', 1.0), ('bar', 1.0), ('bar', 1.0))

Note that duplicates are automatically aggregated to a sum. To
illustrate this, we can count the occurrences of letters in a text::

  skipdict = SkipDict(
      (char, 1) for char in
      "Everything popular is wrong. - Oscar Wilde"
  )

  # The most frequent letter is a space.
  skipdict.keys()[-1] == " "

The ``skipdict`` is sorted by value which means that iteration and
standard mapping protocol methods such as ``keys()``, ``values()`` and
``items()`` return items in sorted order.

Each of these methods have been extended with optional range arguments
``min`` and ``max`` which limit iteration based on value. In addition,
the iterator objects support the item and slice protocols:

>>> skipdict.keys(min=2.0)[0]
'bar'
>>> skipdict.keys(max=2.0)[1:]
['bar']

Note that the methods always return an iterator. Use ``list`` to
expand to a sequence:

>>> iterator = skipdict.keys()
>>> list(iterator)
['bar']

The ``index(value)`` method returns the first key that has exactly the
required value. If the value is not found then a ``KeyError``
exception is raised.

>>> skipdict.index(2.0)
'bar'

Alternatives
------------

Francesco Romani wrote `pyskiplist
<https://bitbucket.org/mojaves/pyskiplist>`_ which also provides an
implementation of the skip list datastructure for CPython written
in C.

Paul Colomiets wrote `sortedsets
<https://github.com/tailhook/sortedsets>`_ which is an implementation
in pure Python. The randomized test cases were adapted from this
package.

License
-------

Copyright (c) 204 Malthe Borch <mborch@gmail.com>

This software is provided "as-is" under the BSD License.


text:
package org.netlight.server;

import io.netty.channel.group.ChannelGroup;
import org.netlight.messaging.MessageQueueLoopGroup;

import java.util.Objects;

/**
 * @author ahmad
 */
public final class NetLightServerContext implements ServerContext {

    private final ChannelGroup channels;
    private final MessageQueueLoopGroup loopGroup;

    public NetLightServerContext(ChannelGroup channels, MessageQueueLoopGroup loopGroup) {
        Objects.requireNonNull(channels);
        Objects.requireNonNull(loopGroup);
        this.channels = channels;
        this.loopGroup = loopGroup;
    }

    @Override
    public ChannelGroup channels() {
        return channels;
    }

    @Override
    public MessageQueueLoopGroup loopGroup() {
        return loopGroup;
    }

    @Override
    public void close() {
        channels.close().awaitUninterruptibly();
        loopGroup.shutdownGracefully();
    }

}


text:
class CreateLinks < ActiveRecord::Migration

  def self.up
  create_table "links", :force => true do |t|
    t.string   "subject_type",       :null => false
    t.integer  "subject_id",         :null => false
    t.string   "predicate",          :null => false
    t.string   "object_type",        :null => false
    t.integer  "object_id",          :null => false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "subject_field_name"
    t.string   "object_field_name"
  end
end

  def self.down
    drop_table "links"
  end
end


text:
#include "config.h"
#include "JSDOMWindowShell.h"

#include "Frame.h"
#include "JSDOMWindow.h"
#include "DOMWindow.h"
#include "ScriptController.h"
#include <runtime/JSObject.h>

using namespace JSC;

namespace WebCore {

ASSERT_CLASS_FITS_IN_CELL(JSDOMWindowShell);

const ClassInfo JSDOMWindowShell::s_info = { "JSDOMWindowShell", &Base::s_info, 0, 0 };

JSDOMWindowShell::JSDOMWindowShell(PassRefPtr<DOMWindow> window, DOMWrapperWorld* world)
    : Base(*world->globalData(), JSDOMWindowShell::createStructure(*world->globalData(), jsNull()))
    , m_world(world)
{
    ASSERT(inherits(&s_info));
    setWindow(window);
}

JSDOMWindowShell::~JSDOMWindowShell()
{
}

void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
{
    // Explicitly protect the global object's prototype so it isn't collected
    // when we allocate the global object. (Once the global object is fully
    // constructed, it can mark its own prototype.)
    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(*JSDOMWindow::commonJSGlobalData(), jsNull());
    Strong<JSDOMWindowPrototype> prototype(*JSDOMWindow::commonJSGlobalData(), new JSDOMWindowPrototype(*JSDOMWindow::commonJSGlobalData(), 0, prototypeStructure));

    Structure* structure = JSDOMWindow::createStructure(*JSDOMWindow::commonJSGlobalData(), prototype.get());
    JSDOMWindow* jsDOMWindow = new (JSDOMWindow::commonJSGlobalData()) JSDOMWindow(*JSDOMWindow::commonJSGlobalData(), structure, domWindow, this);
    prototype->putAnonymousValue(*JSDOMWindow::commonJSGlobalData(), 0, jsDOMWindow);
    setWindow(*JSDOMWindow::commonJSGlobalData(), jsDOMWindow);
}

// ----
// JSObject methods
// ----

void JSDOMWindowShell::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);
    if (m_window)
        markStack.append(&m_window);
}

UString JSDOMWindowShell::className() const
{
    return m_window->className();
}

bool JSDOMWindowShell::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return m_window->getOwnPropertySlot(exec, propertyName, slot);
}

bool JSDOMWindowShell::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
    return m_window->getOwnPropertyDescriptor(exec, propertyName, descriptor);
}

void JSDOMWindowShell::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
    m_window->put(exec, propertyName, value, slot);
}

void JSDOMWindowShell::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
{
    m_window->putWithAttributes(exec, propertyName, value, attributes);
}

bool JSDOMWindowShell::defineOwnProperty(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor, bool shouldThrow)
{
    return m_window->defineOwnProperty(exec, propertyName, descriptor, shouldThrow);
}

bool JSDOMWindowShell::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
    return m_window->deleteProperty(exec, propertyName);
}

void JSDOMWindowShell::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
    m_window->getPropertyNames(exec, propertyNames, mode);
}

void JSDOMWindowShell::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
    m_window->getOwnPropertyNames(exec, propertyNames, mode);
}

void JSDOMWindowShell::defineGetter(ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes)
{
    m_window->defineGetter(exec, propertyName, getterFunction, attributes);
}

void JSDOMWindowShell::defineSetter(ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes)
{
    m_window->defineSetter(exec, propertyName, setterFunction, attributes);
}

JSValue JSDOMWindowShell::lookupGetter(ExecState* exec, const Identifier& propertyName)
{
    return m_window->lookupGetter(exec, propertyName);
}

JSValue JSDOMWindowShell::lookupSetter(ExecState* exec, const Identifier& propertyName)
{
    return m_window->lookupSetter(exec, propertyName);
}

JSObject* JSDOMWindowShell::unwrappedObject()
{
    return m_window.get();
}

// ----
// JSDOMWindow methods
// ----

DOMWindow* JSDOMWindowShell::impl() const
{
    return m_window->impl();
}

void* JSDOMWindowShell::operator new(size_t size)
{
    return JSDOMWindow::commonJSGlobalData()->heap.allocate(size);
}

// ----
// Conversion methods
// ----

JSValue toJS(ExecState* exec, Frame* frame)
{
    if (!frame)
        return jsNull();
    return frame->script()->windowShell(currentWorld(exec));
}

JSDOMWindowShell* toJSDOMWindowShell(Frame* frame, DOMWrapperWorld* isolatedWorld)
{
    if (!frame)
        return 0;
    return frame->script()->windowShell(isolatedWorld);
}

} // namespace WebCore


text:
using System;
using Org.Apache.REEF.IMRU.API;
using Org.Apache.REEF.Tang.Annotations;
using Org.Apache.REEF.Utilities.Diagnostics;
using Org.Apache.REEF.Utilities.Logging;

namespace Org.Apache.REEF.IMRU.Examples.PipelinedBroadcastReduce
{
    /// <summary>
    /// Map function for integer array broadcast and reduce
    /// </summary>
    internal sealed class BroadcastReceiverReduceSenderMapFunction : IMapFunction<int[], int[]>
    {
        private static readonly Logger Logger = Logger.GetLogger(typeof(BroadcastReceiverReduceSenderMapFunction));

        private int _iterations;

        [Inject]
        private BroadcastReceiverReduceSenderMapFunction()
        {
        }

        /// <summary>
        /// Map function
        /// </summary>
        /// <param name="mapInput">integer array</param>
        /// <returns>The same integer array</returns>
        int[] IMapFunction<int[], int[]>.Map(int[] mapInput)
        {
            _iterations++;

            Logger.Log(Level.Info, string.Format("Received value {0}", mapInput[0]));

            if (mapInput[0] != _iterations)
            {
                Exceptions.Throw(new Exception("Expected value in mappers different from actual value"), Logger);
            }

            return mapInput;
        }
    }
}


text:
/* global debuggerModule */
debuggerModule.controller("packetLogController",["$scope",function(scope) {
    scope.logging=false;
    scope.viewFilter="";
    scope.viewFilterValidation="";
    scope.packets=[];
    scope.maxShown=50;
    scope.filterError="";
    scope.selectedPacket=null;
    scope.setSelectedPacket=function(p) {
        scope.selectedPacket=p;
    };

    var filterFunction=function() {
        return true;
    };

    /* jshint evil:true */
    var createFilterFunction=function(filter) {
        if(!filter) { filter="true";}
        var f=new Function("srcPeer","sequence","data","return ("+filter+");");
        try {
            f("123456",123,{});
            return f;
        }catch (e) {
            if(e instanceof TypeError) {
                // likely an data field that is null/undefined, so let it slide
                return f;
            } else {
                throw e;
            }
        }
    };

    scope.updateFilter=function(filter){
        try {
            scope.filterError="";
            scope.viewFilterValidation="hasSuccess";
            filterFunction=createFilterFunction(filter);
        } catch (e) {
            scope.filterError=e.message;
            scope.viewFilterValidation="has-error";
        }
    };

    scope.$watch("viewFilter",function() {
        try {
            scope.filterError="";
            scope.viewFilterValidation="hasSuccess";
            createFilterFunction(scope.viewFilter);
        } catch (e) {
            console.log("Filter error ",e);
            scope.filterError=e.message;
            scope.viewFilterValidation="has-error";
        }
    });
    scope.logicalFilter=function() {
        return function(p) {
            try { return filterFunction(p.srcPeer,p.sequence,p.data); }
            catch(e) {
                return false;
            }
        };

    };

    var logPacket=function(msg) {
        if(!scope.logging) {
            return;
        }

        var packet=msg.packet;
        scope.$apply(function() {
           scope.packets.push(packet);
        });
    };

    ozpIwc.defaultPeer.on("receive",logPacket);
    ozpIwc.defaultPeer.on("send",logPacket);

}]);

debuggerModule.directive( "trafficSnooper", [function() {
    return {
        restrict: 'E',
        templateUrl: 'templates/trafficSnooper.tpl.html'
    };
}]);


text:
title: Ted Yoho, Florida Congressperson
name: Ted Yoho
avatar: /ui/img/avatars/Ted_Yoho.jpg
party: republican
state: florida
type: congressperson
lasthall: 2017-03-04
phone: 202-225-5744
never:
twitter: TedYoho
---


text:
@implementation NSObject (Cache)

static NSMapTable * cache;

+ (void)load{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        cache = [NSMapTable mapTableWithKeyOptions:NSPointerFunctionsCopyIn valueOptions:NSPointerFunctionsWeakMemory];
    });
}

#pragma mark - Public
+ (id)modelByDic:(NSDictionary *)dic{
    NSString *pkValue = dic[[self db_pk]];

    NSObject *model = [cache objectForKey:[NSString stringWithFormat:@"%@_%@",NSStringFromClass(self),pkValue]];

    if (!model) {
        model = [[self alloc] init];
    }

    for (NSString *key in dic.allKeys) {
        [model db_setValue:dic[key] forKey:key];
    }
    return model;
}

+ (instancetype)memoryByKey:(id)modelKey{
    id result = [cache objectForKey:[NSString stringWithFormat:@"%@_%@",NSStringFromClass(self),modelKey]];
    return result;
}
//获取模型
+ (instancetype)modelByKey:(id)modelKey{
    return [self modelByKey:modelKey allowNull:NO];
}

//获取模型
+ (instancetype)modelByKey:(id)modelKey allowNull:(BOOL)allowNull{
    if (!modelKey) {
        if (allowNull) {
            return nil;
        }else{
            return [[self alloc] init];
        }
    }

    id result = [cache objectForKey:[NSString stringWithFormat:@"%@_%@",NSStringFromClass(self),modelKey]];
    if (!result) {
        result = [[self db_search:modelKey forKey:[self db_pk]] lastObject];
    }
    if ((!allowNull) && (!result)) {
        result = [[self alloc] init];

        [result db_setValue:modelKey forKey:[self db_pk]];
    }

    return result;
}

+ (NSDictionary *)modelsByKeys:(NSArray *)modelKeys{
    if (!modelKeys || [modelKeys count] == 0) {
        return @{};
    }
    NSMutableDictionary *result = [NSMutableDictionary dictionary];
    NSMutableArray *searchKeys = [NSMutableArray array];
    for (NSString *modelKey in modelKeys) {
        id cachedModel = [cache objectForKey:[NSString stringWithFormat:@"%@_%@",NSStringFromClass(self),modelKey]];
        if (cachedModel) {
            [result setObject:cachedModel forKey:modelKey];
        }else{
            [searchKeys addObject:modelKey];
        }
    }

    NSDictionary *searchedModel = [self db_searchValues:searchKeys forKey:[self db_pk]];
    NSMutableArray *modesNeedCheck = [NSMutableArray array];
    for (NSString *key in searchedModel.allKeys) {
        NSArray *values = [searchedModel objectForKey:key];
        id obj = [values lastObject];
        if (obj) {
            [result setObject:obj forKey:key];
            [modesNeedCheck addObject:obj];
        }
    }
    [modesNeedCheck checkPointer];
    return [result copy];
}

+ (void)saveModelByKey:(id)modelKey model:(NSObject *)model{
    if (modelKey) {
        [cache setObject:model forKey:[NSString stringWithFormat:@"%@_%@",NSStringFromClass(self),modelKey]];
    }
}

@end


text:
package ariba.util.core;

    // If there are any bugs in this Sort, it would be worth checking the
    // IntCompanionSort to see if the same bug exists.

/**
    Sort provides functions for sorting arrays of objects.

    @aribaapi documented
*/
public class Sort
{
    /*-----------------------------------------------------------------------
        Public Constants
      -----------------------------------------------------------------------*/

        // directions for sorting

    /**
        Constant to specify an ascending sort order
        @aribaapi documented
    */
    public static final int SortAscending  =  1;

    /**
        @aribaapi private
    */
    public static final int SortNone       =  0;

    /**
        Constant to specify a descending sort order
        @aribaapi documented
    */
    public static final int SortDescending = -1;

    /*-----------------------------------------------------------------------
        Object Sorting
      -----------------------------------------------------------------------*/

    /**
        Sort an array of objects into an ascending sort order.

        @param a an array of objects to sort
        @param c an object to that implements the comparison interface
        @aribaapi documented
    */
    public static void objects (Object[] a, Compare c)
    {
        objects(a, c, SortAscending);
    }

    /**
        Sort an array of objects in a specified direction.

        @param a an array of objects to sort
        @param c an object to that implements the comparison interface
        @param dir the direction to sort the objects in. Must be
        SortAscending or SortDescending

        @see #SortAscending
        @see #SortDescending
        @aribaapi documented
    */
    public static void objects (Object[] a, Compare c, int dir)
    {
        objects(a, null, null, c, dir);
    }

    /**
        Sort two arrays in ascending order, using one array for the
        keys. One array has the keys used for the sort, and another
        companion array is also sorted with the key array.

        @param a an array of objects to sort
        @param c1 a companion array to sort in parallel with the array
        a. The values in c1 do not affect the sort.
        @param c an object to that implements the comparison interface
        @aribaapi documented
    */
    public static void objects (Object[] a, Object[] c1, Compare c)
    {
        objects(a, c1, c, SortAscending);
    }

    /**
        Sort two arrays in a specified order, using one array for the
        keys. One array has the keys used for the sort, and another
        companion array is also sorted with the key array.

        @param a an array of objects to sort
        @param c1 a companion array to sort in parallel with the array
        a. The values in c1 do not affect the sort.
        @param c an object to that implements the comparison interface
        @param dir the direction to sort the objects in. Must be
        SortAscending or SortDescending

        @see #SortAscending
        @see #SortDescending
        @aribaapi documented
    */
    public static void objects (Object[] a, Object[] c1, Compare c, int dir)
    {
        objects(a, c1, null, c, dir);
    }

    /**
        Sort three arrays in ascending order, using one array for the
        keys. One array has the keys used for the sort, and the other
        two companion arrays are also sorted with the key array.

        @param a an array of objects to sort
        @param c1 a companion array to sort in parallel with the array
        a. The values in c1 do not affect the sort.
        @param c2 a companion array to sort in parallel with the array
        a. The values in c2 do not affect the sort.
        @param c an object to that implements the comparison interface
        @aribaapi documented
    */
    public static void objects (
        Object[] a, Object[] c1, Object[] c2, Compare c)
    {
        objects(a, c1, c2, c, SortAscending);
    }

    /**
        Sort three arrays in a specified order, using one array for
        the keys. One array has the keys used for the sort, and the
        other two companion arrays are also sorted with the key array.

        @param a an array of objects to sort
        @param c1 a companion array to sort in parallel with the array
        a. The values in c1 do not affect the sort.
        @param c2 a companion array to sort in parallel with the array
        a. The values in c2 do not affect the sort.
        @param c an object to that implements the comparison interface
        @param dir the direction to sort the objects in. Must be
        SortAscending or SortDescending

        @see #SortAscending
        @see #SortDescending
        @aribaapi documented
    */
    public static void objects (
        Object[] a, Object[] c1, Object[] c2, Compare c, int dir)
    {
        Compare compare = (dir == SortDescending) ? new ReverseCompare(c) : c;
        objects(a, c1, c2, 0, a.length, compare);
    }

    /**
        Sort a range of elements in three arrays in ascending order,
        using one array for the keys. Sorts elements first
        through first + n - 1 of the object array a,
        using the Compare object c to compare elements.  The
        companion arrays c1 and c2 are also sorted in
        parallel with a.

        @param a an array of objects to sort
        @param c1 a companion array to sort in parallel with the array
        a. The values in c1 do not affect the sort.
        @param c2 a companion array to sort in parallel with the array
        a. The values in c2 do not affect the sort.
        @param first the first element to sort
        @param n the number of elements to sort
        @param c an object to that implements the comparison interface
        @aribaapi documented
    */
    public static void objects (
        Object[] a, Object[] c1, Object[] c2, int first, int n, Compare c)
    {
        if (a.length >= MinQuickSortLength) {
            quickSort(a, c1, c2, first, first + n - 1, c);
        }
        insertionSort(a, c1, c2, first, first + n - 1, c);
    }

    /**
        Sort a range of elements in three arrays in a specified order,
        using one array for the keys. Sorts elements first
        through first + n - 1 of the object array a,
        using the Compare object c to compare elements.  The
        companion arrays c1 and c2 are also sorted in
        parallel with a.

        @param a an array of objects to sort
        @param c1 a companion array to sort in parallel with the array
        a. The values in c1 do not affect the sort.
        @param c2 a companion array to sort in parallel with the array
        a. The values in c2 do not affect the sort.
        @param first the first element to sort
        @param n the number of elements to sort
        @param c an object to that implements the comparison interface
        @aribaapi documented
        @param dir the direction to sort the objects in. Must be
        SortAscending or SortDescending

        @see #SortAscending
        @see #SortDescending
    */
    public static void objects (Object[] a, Object[] c1, Object[] c2, int first, int n,
                                Compare c, int dir)
    {
        Compare compare = (dir == SortDescending) ? new ReverseCompare(c) : c;
        objects(a, c1, c2, first, n, compare);
    }

    /**
        Returns the opposite of the given sort direction.

        @param direction either SortAscending or SortDescending
        @return the other direction

        @see #SortAscending
        @see #SortDescending
        @aribaapi documented
    */
    public static int getSwapDirection (int direction)
    {
        return -direction;
    }

    /*-----------------------------------------------------------------------
        Private Methods
      -----------------------------------------------------------------------*/

    /**
        QuickSorts a[ first .. last ] down to partitions of length
        MinQuickSortLength and larger. The final insertion sort above
        will then sort each of the final partitions.
    */
    private static void quickSort (
        Object[] a, Object[] c1, Object[] c2, int first, int last, Compare c)
    {
        while (last - first + 1 >= MinQuickSortLength) {

                // partition a such that a[ first ... m - 1 ] <= v <=
                // a[ m ... last ], for some m and v and first < m. */
            int m = partition(a, c1, c2, first, last, c);

                // recursively quickSort the smaller partition and
                // tail-recursively quickSort the larger partition.  This
                // ensures that we'll use at most O (log n) stack space, even
                // on degenerate inputs.
            if (m - first < last - m + 1) {
                quickSort(a, c1, c2, first, m - 1, c);
                first = m;
            }
            else {
                quickSort(a, c1, c2, m, last, c);
                last = m - 1;
            }
        }
    }

    /**
        Reorders the elements in

        a[ first ... last ]

        such that

        a[ first ... m - 1 ] <= median <= a[ m ... last ]

        for some m, where "median" is the median value of the first,
        middle, and last elements. Returns m.
    */
    private static int partition (
        Object[] a, Object[] c1, Object[] c2, int first, int last, Compare c)
    {
        /* Find the median of the first, middle, and last elements */
        Object af = a[first];
        Object am = a[(first+last)/2];
        Object al = a[last];
        Object median;

        if (c.compare(af, am) < 0) {
            if (c.compare(am, al) < 0) {
                median = am; /* af < am, am < al */
            }
            else {
                /* af < am, al <= am */
                if (c.compare(af, al) < 0) {
                    median = al; /* af < al, al <= am */
                }
                else {
                    median = af; /* al <= af, af < am */
                }
            }
        }
        else {
            /* m <= f */
            if (c.compare(af, al) < 0) {
                median = af; /* am <= af, af < al */
            }
            else {
                /* am <= af, al <= af */
                if (c.compare(am, al) < 0) {
                    median = al; /* am < al, al <= af */
                }
                else {
                    median = am; /* al <= am, am <= af */
                }
            }
        }

        /* partition such that a[ first ... m ] <= median <= a[ m ... last ],
            for some m. */
        for (int i = first, j = last;;) {

            /* Advance i forward until median <= a[ i ]. */
            for (; c.compare(a[i], median) < 0; i++) {
                ;
            }

            /* Advance j backward until a[ j ] <= median. */
            for (; c.compare(median, a[j]) < 0; j--) {
                ;
            }

            /* If i and j have crossed, then we know that
                a[ i - 1 ] <= median <= a[ i ] and i > first. */
            if (i >= j) {
                return i;
            }

            /* Swap a[i] and a[j]. */
            Object temp = a[i];
            a[i] = a[j];
            a[j] = temp;
            if (c1 != null) {
                temp = c1[i];
                c1[i] = c1[j];
                c1[j] = temp;
            }
            if (c2 != null) {
                temp = c2[i];
                c2[i] = c2[j];
                c2[j] = temp;
            }

            /* Now, a[ first ... i ] <= median <= a[ j ... last ]. */
            i++;
            j--;
        }
    }

    /** Sorts a[ first ... last ], using an insertion sort. */
    private static void insertionSort (
        Object[] a, Object[] c1, Object[] c2, int first, int last, Compare c)
    {
        for (int i = first + 1; i <= last; i++) {
            int j;
            Object ai = a[i];
            Object temp1 = null;
            Object temp2 = null;
            if (c1 != null) {
                temp1 = c1[i];
            }
            if (c2 != null) {
                temp2 = c2[i];
            }
            for (j = i - 1; j >= first; j--) {
                Object aj = a[j];
                if (c.compare(ai, aj) < 0) {
                    a[j+1] = aj;
                    if (c1 != null) {
                        c1[j+1] = c1[j];
                    }
                    if (c2 != null) {
                        c2[j+1] = c2[j];
                    }
                }
                else {
                    break;
                }
            }
            a[j+1] = ai;
            if (c1 != null) {
                c1[j+1] = temp1;
            }
            if (c2 != null) {
                c2[j+1] = temp2;
            }
        }
    }

    /*-----------------------------------------------------------------------
        Package Private Constructor
      -----------------------------------------------------------------------*/

    /** Package Private constructor to prevent instances of this class. */
    Sort ()
    {
    }

    /*-----------------------------------------------------------------------
        Private Constants
      -----------------------------------------------------------------------*/

        // lower bound for quick sort; partitions smaller than this will be
        // sorted using insertion sort
    static final int MinQuickSortLength = 16;
    public static final Compare reverseCompare (Compare c)
    {
        return new ReverseCompare(c);
    }

}
class ReverseCompare implements Compare
{
    Compare c;

    ReverseCompare (Compare c)
    {
        this.c = c;
    }

    public int compare (Object o1, Object o2)
    {
            // reverse the comparison
        return c.compare(o2, o1);
    }
}