text:
# LeL

> Lambda Expression Library
> > Single header (after fusing) library with no external dependencies.

```cpp
auto is_right_triangle = _a * _a + _b *_b == _c * _c;

is_right_triangle(3, 4, 5);
```

[![Language][Language-img]][Language-url]
[![License][License-img]][License-url]

[![Master][Master-img]][Master-url]
[![MasterLinuxBuild][MasterLinuxBuild-img]][MasterLinuxBuild-url]
[![MasterWindowsBuild][MasterWindowsBuild-img]][MasterWindowsBuild-url]
[![MasterCoverage][MasterCoverage-img]][MasterCoverage-url]

---

## About

Lambda functions in c++ are cool, very cool. But they give quite some overhead
in syntax requirements, which obscures very little functions. Consider:

```cpp
auto is_even = [](auto i) { return i % 2 == 0; };
```

It is very short, nice lambda, but the actual condition is only around half of
its body. Now lets see how it would look in lambda expression:

```cpp
auto is_even = _i % 2 == 0;
```

Shorted, right? And, for me, much cleaner.

## Examples

[//]:#(EXAMPLES_BEGIN)

###

```cpp
  using namespace lel;
```

### simple

```cpp
  auto plus_one = _x + 1;
  auto multiply = _x * _y;
  auto is_less  = _1 < _2;

  assert(plus_one(2) == 3);
  assert(multiply(2, 3) == 6);
  assert(is_less(2, 5));
```

### more arguments

```cpp
  auto compute_something = 1 + _x * 3 - _y * _y + _x * _z;

  assert(3 == compute_something(1, 2, 3));
```

### own placeholders

```cpp
  auto first_arg  = lel::placeholder<'1'>();
  auto second_arg = lel::placeholder<'2'>();

  auto not_equal = first_arg != second_arg;

  assert(not_equal(2, 3));
```

### more complex

```cpp
  auto add_of_vectors = *((*_x)[_1]) + **(_y[_2]);

  auto x_vec = std::make_unique<std::vector<std::unique_ptr<int>>>();
  x_vec->push_back(std::make_unique<int>(1));
  x_vec->push_back(std::make_unique<int>(2));
  x_vec->push_back(std::make_unique<int>(3));
  x_vec->push_back(std::make_unique<int>(4));

  auto y_vec = std::vector<std::unique_ptr<std::unique_ptr<int>>>();
  y_vec.push_back(std::make_unique<std::unique_ptr<int>>(std::make_unique<int>(6)));
  y_vec.push_back(std::make_unique<std::unique_ptr<int>>(std::make_unique<int>(7)));
  y_vec.push_back(std::make_unique<std::unique_ptr<int>>(std::make_unique<int>(8)));
  y_vec.push_back(std::make_unique<std::unique_ptr<int>>(std::make_unique<int>(9)));

  assert((4+7) == (add_of_vectors(3, 1, x_vec, y_vec)));
```

### references

```cpp
  int x = 5;

  auto add_to_x = _(x) += _y;

  add_to_x(8);

  assert(x == 13);
```

### currying

```cpp
  auto sum = _x + _y + _z;

  assert(6 == sum(1, 2, 3));
  assert(6 == sum(1)(2, 3));
  assert(6 == sum(1, 2)(3));
  assert(6 == sum(1)(2)(3));
```

### function call

```cpp
  auto duplicate = [](int i) {
    return i * 2;
  };

  auto call_with = _x._(_y);
  assert(8 == call_with(duplicate, 4));

  auto do_with_three = _x._(3);
  assert(6 == do_with_three(duplicate));

  auto times_two = _(duplicate)._(_y);
  assert(10 == times_two(5));

  auto agregate = [](int a, int b, int c, int d) {
    return a + b + c + d;
  };

  auto reduce = _(agregate)._(_a, _b, _c, _d);
  assert(20 == reduce(2, 4, 6, 8));
```

### objects

```cpp
  struct Object {
    Object(int value) : value(value) {}

    int Method(int arg) { return value * arg; }

    int value;
  };

  Object object(5);
```

### field

```cpp
  auto get_value = (&_x->*_y);
  auto set_value = get_value = _z;

  set_value(object, &Object::value, 8);
  assert(get_value(object, &Object::value) == 8);
```

### method call

```cpp
  auto call_method = get_value._(_z);

  assert(call_method(object, &Object::Method, 3) == 24);
```

[//]:#(EXAMPLES_END)

## Usage

**Files** There are two ways of including **LeL**:

 * in multiple headers, as it is in repository;
   everything is in `include` directory

 * in one fused-header;

   `script/fuse` will fuse all into `build/lel.hpp`

**API** The only things that should be used are:

  * `namespace lel`    - with predefined placeholders
    * `_`              - instance of `lel::reference` class
    * `_1` ... `_9`    / instances of `lel::placeholder` class
    * `_A` ... `_Z`    |
    * `_a` ... `_z`    /
    * `placeholder`    - template alias for placeholders creation
    * `reference`      - class for wrapping objects in a reference

```cpp
#include "lel.hpp"

auto use_with_namespace = lel::_x + 2;

auto create_your_own    = lel::placeholder<'a'>();

/* or */ using namespace lel;
auto like_that          = 1 * _2;
```

**Implementation** Templates, so many templates. Cool stuff!

The separate types of placeholders are distinguist by template variable of
type (by default, can be changed) **char**.
So `Placeholder<'a'>` and `Placeholder<'A'>` are different types.

You can use any combination of them (only numbers, numbers and letters,
etc) in any order or degree. The important thing is the arguments during
evaluation will be assigned with alphabetic (ASCII alphabetic) order.

So:

```cpp
auto expr = _1 - _x;

assert(-1 == expr(2, 3));
assert( 1 == expr(3, 2));
```

## Tests

There is a bunch of tests but they are not needed for normal usage. You can run
all of them with **cmake**:

```bash
mkdir build
cd build
cmake .. -DENABLE_TESTING=ON
cmake --build .
ctest -VV
```

## Benchmarks

TBD

## BLL - Boost Lambda Library

Yes, the same concept but this one uses a little bit newer C++.
However the idea for this library came out independently.

---

[Language-img]: https://img.shields.io/badge/language-C++14-d65d0e.svg?style=flat-square
[Language-url]: https://isocpp.org
[Release-img]: https://img.shields.io/github/release/dawikur/lel.svg?style=flat-square
[Release-url]: https://github.com/dawikur/lel/releases
[License-img]: https://img.shields.io/github/license/dawikur/lel.svg?style=flat-square
[License-url]: https://github.com/dawikur/lel/blob/master/LICENSE

[Master-img]: https://img.shields.io/badge/-%20master-grey.svg?style=flat-square
[Master-url]: https://github.com/dawikur/lel
[MasterLinuxBuild-img]: https://img.shields.io/travis/dawikur/lel/master.svg?label=linux&style=flat-square
[MasterLinuxBuild-url]: https://travis-ci.org/dawikur/lel
[MasterWindowsBuild-img]: https://img.shields.io/appveyor/ci/dawikur/lel/master.svg?label=windows&style=flat-square
[MasterWindowsBuild-url]: https://ci.appveyor.com/project/dawikur/lel
[MasterCoverage-img]: https://img.shields.io/codecov/c/github/dawikur/lel/master.svg?label=coverage&style=flat-square
[MasterCoverage-url]: https://codecov.io/gh/dawikur/lel

[Develop-img]: https://img.shields.io/badge/-develop-lightgrey.svg?style=flat-square
[Develop-url]: https://github.com/dawikur/lel/tree/develop
[DevelopLinuxBuild-img]: https://img.shields.io/travis/dawikur/lel/develop.svg?label=linux&style=flat-square
[DevelopLinuxBuild-url]: https://travis-ci.org/dawikur/lel
[DevelopWindowsBuild-img]: https://img.shields.io/appveyor/ci/dawikur/lel/develop.svg?label=windows&style=flat-square
[DevelopWindowsBuild-url]: https://ci.appveyor.com/project/dawikur/lel
[DevelopCoverage-img]: https://img.shields.io/codecov/c/github/dawikur/lel/develop.svg?label=coverage&style=flat-square
[DevelopCoverage-url]: https://codecov.io/gh/dawikur/lel


text:
package api

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"

	"github.com/micro/go-plugins/registry/kubernetes/client/watch"
)

// Request is used to construct a http request for the k8s API.
type Request struct {
	client    *http.Client
	header    http.Header
	params    url.Values
	method    string
	host      string
	namespace string

	resource     string
	resourceName *string
	body         io.Reader

	err error
}

// Params is the object to pass in to set paramaters
// on a request.
type Params struct {
	LabelSelector map[string]string
	Watch         bool
}

// verb sets method
func (r *Request) verb(method string) *Request {
	r.method = method
	return r
}

// Get request
func (r *Request) Get() *Request {
	return r.verb("GET")
}

// Post request
func (r *Request) Post() *Request {
	return r.verb("POST")
}

// Put request
func (r *Request) Put() *Request {
	return r.verb("PUT")
}

// Patch request
// https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api-conventions.md#patch-operations
func (r *Request) Patch() *Request {
	return r.verb("PATCH").SetHeader("Content-Type", "application/strategic-merge-patch+json")
}

// Delete request
func (r *Request) Delete() *Request {
	return r.verb("DELETE")
}

// Namespace is to set the namespace to operate on
func (r *Request) Namespace(s string) *Request {
	r.namespace = s
	return r
}

// Resource is the type of resource the operation is
// for, such as "services", "endpoints" or "pods"
func (r *Request) Resource(s string) *Request {
	r.resource = s
	return r
}

// Name is for targeting a specific resource by id
func (r *Request) Name(s string) *Request {
	r.resourceName = &s
	return r
}

// Body pass in a body to set, this is for POST, PUT
// and PATCH requests
func (r *Request) Body(in interface{}) *Request {
	b := new(bytes.Buffer)
	if err := json.NewEncoder(b).Encode(&in); err != nil {
		r.err = err
		return r
	}
	r.body = b
	return r
}

// Params isused to set paramters on a request
func (r *Request) Params(p *Params) *Request {
	for k, v := range p.LabelSelector {
		r.params.Add("labelSelectors", k+"="+v)
	}

	return r
}

// SetHeader sets a header on a request with
// a `key` and `value`
func (r *Request) SetHeader(key, value string) *Request {
	r.header.Add(key, value)
	return r
}

// request builds the http.Request from the options
func (r *Request) request() (*http.Request, error) {
	url := fmt.Sprintf("%s/api/v1/namespaces/%s/%s/", r.host, r.namespace, r.resource)

	// append resourceName if it is present
	if r.resourceName != nil {
		url += *r.resourceName
	}

	// append any query params
	if len(r.params) > 0 {
		url += "?" + r.params.Encode()
	}

	// build request
	req, err := http.NewRequest(r.method, url, r.body)
	if err != nil {
		return nil, err
	}

	// set headers on request
	req.Header = r.header
	return req, nil
}

// Do builds and triggers the request
func (r *Request) Do() *Response {
	if r.err != nil {
		return &Response{
			err: r.err,
		}
	}

	req, err := r.request()
	if err != nil {
		return &Response{
			err: err,
		}
	}

	res, err := r.client.Do(req)
	if err != nil {
		return &Response{
			err: err,
		}
	}

	// return res, err
	return newResponse(res, err)
}

// Watch builds and triggers the request, but
// will watch instead of return an object
func (r *Request) Watch() (watch.Watch, error) {
	if r.err != nil {
		return nil, r.err
	}

	r.params.Set("watch", "true")

	req, err := r.request()
	if err != nil {
		return nil, err
	}

	w, err := watch.NewBodyWatcher(req, r.client)
	return w, err
}

// Options ...
type Options struct {
	Host        string
	Namespace   string
	BearerToken *string
	Client      *http.Client
}

// NewRequest creates a k8s api request
func NewRequest(opts *Options) *Request {
	req := &Request{
		header:    make(http.Header),
		params:    make(url.Values),
		client:    opts.Client,
		namespace: opts.Namespace,
		host:      opts.Host,
	}

	if opts.BearerToken != nil {
		req.SetHeader("Authorization", "Bearer "+*opts.BearerToken)
	}

	return req
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<webcast id="2">
  <title>2 Minutes on BrightTALK: Media is Responsible for Listening</title>
  <description>"The media company of today has to be as much of a listener as a publisher." In 2004, C Presenter became the first journalist to leave a major newspaper, the Financial Times, to make a living as a full-time journalist blogger. Join C as he discusses how online community listening is a competitive advantage.</description>
  <presenter>C Presenter, Pulisher, Silicon Valley Watcher</presenter>
  <duration>142</duration>
  <start>2013-06-11T15:25:00Z</start>
  <keywords>"Social Listening", "Content Publishing"</keywords>
  <published>true</published>
  <visibility>public</visibility>
  <clientBookingRef>campaign-ref-2013-08-05-2</clientBookingRef>
  <url>https://www.test.brighttalk.net/webcast/1/2</url>
  <categories>
    <category>Social Media/Twitter</category>
    <category>Content Marketing/BrightTALK</category>
  </categories>
  <status>upcoming</status>
  <syndicationType>in</syndicationType>
  <created>2013-06-11T16:47:15Z</created>
  <lastUpdated>2013-08-04T10:19:43Z</lastUpdated>
  <link rel="self" href="https://api.test.brighttalk.net/v1/channel/1/webcast/2"/>
  <link rel="https://api.brighttalk.com/rel/webcast_registrations" href="https://api.test.brighttalk.net/v1/channel/1/webcast/2/registrations"/>
  <link rel="https://api.brighttalk.com/rel/webcast_viewings" href="https://api.test.brighttalk.net/v1/channel/1/webcast/2/viewings"/>
  <link rel="https://api.brighttalk.com/rel/subscribers_webcast_activity" href="https://api.test.brighttalk.net/v1/channel/1/webcast/2/subscribers_webcast_activity"/>
</webcast>


text:
struct node * AddToHead ( struct node * head , int value )
{
// Create a new node out of raw memory
struct node * new = malloc ( sizeof ( struct node ));
// Should do an error check here , but let 's live dangerously for simplicity
new -> value = value ;
new -> next = 0; // Null pointer means nothing after this node
if( head ) // non - empty list
 new -> next = head ; // Insert node in front of head
return new ; // Return my new node as the new head of the list
}
// Print out a list in order
 void PrintList ( struct node * head )
{
// Walk through list.printing out values
while(head)
{
 printf ("%d->",head -> value ); // Print current node
head = head -> next ; // Move to next node
}
printf ("\n");
}

// Delete my list
void KillList ( struct node * head )
{
struct node * next = 0;
// Walk through my list , releasing memory
while ( head ) // Any nodes left ?
{
next = head -> next ; // Grab a handle to second node
free ( head ); // Let go of first node
 head = next ; // Make second node the first one
}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebSocketServer.Models
{
    class ConnectionResponse: BaseCommand
    {
        public ConnectionResponse()
            : base("ConnectionResponse")
        {

        }

        public string Username { get; set; }

    }
}


text:
<?php

namespace kalibao\backend\modules\attributeType\components\attributeType\crud;

/**
 * Class Setting
 *
 * @package kalibao\backend\modules\attributeType\components\attributeType\crud
 * @version 1.0
 */
class Setting extends \kalibao\common\components\crud\Setting
{}


text:
function New-ParameterBlockFromResourceDefinition {
[CmdletBinding(DefaultParameterSetName = 'AsString')]
[OutputType([String], ParameterSetName = 'AsString')]
[OutputType([String[]], ParameterSetName = 'AsArray')]
param(
    [Parameter(
        Mandatory,
        ValueFromPipeline
    )]
    [Microsoft.PowerShell.DesiredStateConfiguration.DscResourceInfo]
    $Resource ,

    [Parameter(
        ParameterSetName = 'AsString'
    )]
    [ValidateNotNull()]
    [AllowEmptyString()]
    $Delimiter = " ,`n`n" ,

    [Parameter(
        Mandatory,
        ParameterSetName = 'AsArray'
    )]
    [Switch]
    $AsArray ,

    [Parameter()]
    [Switch]
    $NoValidateSet ,

    [Parameter()]
    [AllowEmptyCollection()]
    [SupportsWildcards()]
    [ResourcePropertyPattern[]]
    $ExcludeProperty ,

    [Parameter()]
    [Switch]
    $ExcludeMandatory
)

    Process {
        $params = $Resource.Properties |
            Where-Object -FilterScript {
                $thisProp = $_
                -not (
                    $ExcludeProperty.Where({
                        $thisExclusion = $_
                        $thisExclusion.Match($Resource, $thisProp) -and (
                            $ExcludeMandatory -or
                            -not $thisProp.IsMandatory
                        )
                    },[System.Management.Automation.WhereOperatorSelectionMode]::First)
                )
            } |
            New-ParameterFromResourcePropertyInfo -NoValidateSet:$NoValidateSet

        if ($AsArray.IsPresent) {
            $params
        } else {
            $params -join $Delimiter
        }
    }
}


text:
package com.google.inject.assistedinject;

import com.google.inject.ConfigurationException;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Provider;
import com.google.inject.TypeLiteral;
import static com.google.inject.internal.Annotations.getKey;
import com.google.inject.internal.BytecodeGen;
import com.google.inject.internal.Errors;
import com.google.inject.internal.ErrorsException;
import com.google.inject.internal.ImmutableMap;
import com.google.inject.internal.ImmutableSet;
import com.google.inject.internal.Lists;
import com.google.inject.internal.Maps;
import com.google.inject.spi.Dependency;
import com.google.inject.spi.HasDependencies;
import com.google.inject.spi.Message;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Obsolete. Prefer {@link FactoryModuleBuilder} for its more concise API and
 * additional capability.
 *
 *
Provides a factory that combines the caller's arguments with injector-supplied values to
 * construct objects.
 *
 *
Defining a factory

 * Create an interface whose methods return the constructed type, or any of its supertypes. The
 * method's parameters are the arguments required to build the constructed type.
 *
public interface PaymentFactory {
 *   Payment create(Date startDate, Money amount);
 * }

 * You can name your factory methods whatever you like, such as create, createPayment
 * or newPayment.
 *
 *
Creating a type that accepts factory parameters

 * {@code constructedType} is a concrete class with an {@literal @}{@link Inject}-annotated
 * constructor. In addition to injector-supplied parameters, the constructor should have
 * parameters that match each of the factory method's parameters. Each factory-supplied parameter
 * requires an {@literal @}{@link Assisted} annotation. This serves to document that the parameter
 * is not bound by your application's modules.
 *
public class RealPayment implements Payment {
 *   {@literal @}Inject
 *   public RealPayment(
 *      CreditService creditService,
 *      AuthService authService,
 *      {@literal @}Assisted Date startDate,
 *      {@literal @}Assisted Money amount) {
 *     ...
 *   }
 * }

 * Any parameter that permits a null value should also be annotated {@code @Nullable}.
 *
 *
Configuring factories

 * In your {@link com.google.inject.Module module}, bind the factory interface to the returned
 * factory:
 *
bind(PaymentFactory.class).toProvider(
 *     FactoryProvider.newFactory(PaymentFactory.class, RealPayment.class));

 * As a side-effect of this binding, Guice will inject the factory to initialize it for use. The
 * factory cannot be used until the injector has been initialized.
 *
 *
Using the factory

 * Inject your factory into your application classes. When you use the factory, your arguments
 * will be combined with values from the injector to construct an instance.
 *
public class PaymentAction {
 *   {@literal @}Inject private PaymentFactory paymentFactory;
 *
 *   public void doPayment(Money amount) {
 *     Payment payment = paymentFactory.create(new Date(), amount);
 *     payment.apply();
 *   }
 * }

 *
 *
Making parameter types distinct

 * The types of the factory method's parameters must be distinct. To use multiple parameters of
 * the same type, use a named {@literal @}{@link Assisted} annotation to disambiguate the
 * parameters. The names must be applied to the factory method's parameters:
 *
 *
public interface PaymentFactory {
 *   Payment create(
 *       {@literal @}Assisted("startDate") Date startDate,
 *       {@literal @}Assisted("dueDate") Date dueDate,
 *       Money amount);
 * }

 * ...and to the concrete type's constructor parameters:
 *
public class RealPayment implements Payment {
 *   {@literal @}Inject
 *   public RealPayment(
 *      CreditService creditService,
 *      AuthService authService,
 *      {@literal @}Assisted("startDate") Date startDate,
 *      {@literal @}Assisted("dueDate") Date dueDate,
 *      {@literal @}Assisted Money amount) {
 *     ...
 *   }
 * }

 *
 *
Values are created by Guice

 * Returned factories use child injectors to create values. The values are eligible for method
 * interception. In addition, {@literal @}{@literal Inject} members will be injected before they are
 * returned.
 *
 *
Backwards compatibility using {@literal @}AssistedInject

 * Instead of the {@literal @}Inject annotation, you may annotate the constructed classes with
 * {@literal @}{@link AssistedInject}. This triggers a limited backwards-compatability mode.
 *
 *
Instead of matching factory method arguments to constructor parameters using their names, the
 * parameters are matched by their order. The first factory method argument is
 * used for the first {@literal @}Assisted constructor parameter, etc.. Annotation names have no
 * effect.
 *
 *
Returned values are not created by Guice. These types are not eligible for
 * method interception. They do receive post-construction member injection.
 *
 * @param <F> The factory interface
 *
 * @author jmourits@google.com (Jerome Mourits)
 * @author jessewilson@google.com (Jesse Wilson)
 * @author dtm@google.com (Daniel Martin)
 *
 * @deprecated use {@link FactoryModuleBuilder} instead.
 */
@Deprecated
public class FactoryProvider<F> implements Provider<F>, HasDependencies {

  /*
   * This class implements the old @AssistedInject implementation that manually matches constructors
   * to factory methods. The new child injector implementation lives in FactoryProvider2.
   */

  private Injector injector;

  private final TypeLiteral<F> factoryType;
  private final Map<Method, AssistedConstructor<?>> factoryMethodToConstructor;

  public static <F> Provider<F> newFactory(Class<F> factoryType, Class<?> implementationType){
    return newFactory(TypeLiteral.get(factoryType), TypeLiteral.get(implementationType));
  }

  public static <F> Provider<F> newFactory(
      TypeLiteral<F> factoryType, TypeLiteral<?> implementationType) {
    Map<Method, AssistedConstructor<?>> factoryMethodToConstructor
        = createMethodMapping(factoryType, implementationType);

    if (!factoryMethodToConstructor.isEmpty()) {
      return new FactoryProvider<F>(factoryType, factoryMethodToConstructor);
    } else {
      BindingCollector collector = new BindingCollector();

      // Preserving backwards-compatibility:  Map all return types in a factory
      // interface to the passed implementation type.
      Errors errors = new Errors();
      Key<?> implementationKey = Key.get(implementationType);

      if (implementationType != null) {
        try {
          for (Method method : factoryType.getRawType().getMethods()) {
            Key<?> returnType = getKey(factoryType.getReturnType(method), method,
                method.getAnnotations(), errors);
            if (!implementationKey.equals(returnType)) {
              collector.addBinding(returnType, implementationType);
            }
          }
        } catch (ErrorsException e) {
          throw new ConfigurationException(e.getErrors().getMessages());
        }
      }

      return new FactoryProvider2<F>(factoryType, collector);
    }
  }

  private FactoryProvider(TypeLiteral<F> factoryType,
      Map<Method, AssistedConstructor<?>> factoryMethodToConstructor) {
    this.factoryType = factoryType;
    this.factoryMethodToConstructor = factoryMethodToConstructor;
    checkDeclaredExceptionsMatch();
  }

  @Inject
  void setInjectorAndCheckUnboundParametersAreInjectable(Injector injector) {
    this.injector = injector;
    for (AssistedConstructor<?> c : factoryMethodToConstructor.values()) {
      for (Parameter p : c.getAllParameters()) {
        if(!p.isProvidedByFactory() && !paramCanBeInjected(p, injector)) {
          // this is lame - we're not using the proper mechanism to add an
          // error to the injector. Throughout this class we throw exceptions
          // to add errors, which isn't really the best way in Guice
          throw newConfigurationException("Parameter of type '%s' is not injectable or annotated "
                + "with @Assisted for Constructor '%s'", p, c);
        }
      }
    }
  }

  private void checkDeclaredExceptionsMatch() {
    for (Map.Entry<Method, AssistedConstructor<?>> entry : factoryMethodToConstructor.entrySet()) {
      for (Class<?> constructorException : entry.getValue().getDeclaredExceptions()) {
        if (!isConstructorExceptionCompatibleWithFactoryExeception(
            constructorException, entry.getKey().getExceptionTypes())) {
          throw newConfigurationException("Constructor %s declares an exception, but no compatible "
              + "exception is thrown by the factory method %s", entry.getValue(), entry.getKey());
        }
      }
    }
  }

  private boolean isConstructorExceptionCompatibleWithFactoryExeception(
      Class<?> constructorException, Class<?>[] factoryExceptions) {
    for (Class<?> factoryException : factoryExceptions) {
      if (factoryException.isAssignableFrom(constructorException)) {
        return true;
      }
    }
    return false;
  }

  private boolean paramCanBeInjected(Parameter parameter, Injector injector) {
    return parameter.isBound(injector);
  }

  private static Map<Method, AssistedConstructor<?>> createMethodMapping(
      TypeLiteral<?> factoryType, TypeLiteral<?> implementationType) {
    List<AssistedConstructor<?>> constructors = Lists.newArrayList();

    for (Constructor<?> constructor : implementationType.getRawType().getDeclaredConstructors()) {
      if (constructor.getAnnotation(AssistedInject.class) != null) {
        @SuppressWarnings("unchecked") // the constructor type and implementation type agree
        AssistedConstructor assistedConstructor = new AssistedConstructor(
            constructor, implementationType.getParameterTypes(constructor));
        constructors.add(assistedConstructor);
      }
    }

    if (constructors.isEmpty()) {
      return ImmutableMap.of();
    }

    Method[] factoryMethods = factoryType.getRawType().getMethods();

    if (constructors.size() != factoryMethods.length) {
      throw newConfigurationException("Constructor mismatch: %s has %s @AssistedInject "
          + "constructors, factory %s has %s creation methods", implementationType,
          constructors.size(), factoryType, factoryMethods.length);
    }

    Map<ParameterListKey, AssistedConstructor> paramsToConstructor = Maps.newHashMap();

    for (AssistedConstructor c : constructors) {
      if (paramsToConstructor.containsKey(c.getAssistedParameters())) {
        throw new RuntimeException("Duplicate constructor, " + c);
      }
      paramsToConstructor.put(c.getAssistedParameters(), c);
    }

    Map<Method, AssistedConstructor<?>> result = Maps.newHashMap();
    for (Method method : factoryMethods) {
      if (!method.getReturnType().isAssignableFrom(implementationType.getRawType())) {
        throw newConfigurationException("Return type of method %s is not assignable from %s",
            method, implementationType);
      }

      List<Type> parameterTypes = Lists.newArrayList();
      for (TypeLiteral<?> parameterType : factoryType.getParameterTypes(method)) {
        parameterTypes.add(parameterType.getType());
      }
      ParameterListKey methodParams = new ParameterListKey(parameterTypes);

      if (!paramsToConstructor.containsKey(methodParams)) {
        throw newConfigurationException("%s has no @AssistInject constructor that takes the "
            + "@Assisted parameters %s in that order. @AssistInject constructors are %s",
            implementationType, methodParams, paramsToConstructor.values());
      }

      method.getParameterAnnotations();
      for (Annotation[] parameterAnnotations : method.getParameterAnnotations()) {
        for (Annotation parameterAnnotation : parameterAnnotations) {
          if (parameterAnnotation.annotationType() == Assisted.class) {
            throw newConfigurationException("Factory method %s has an @Assisted parameter, which "
                + "is incompatible with the deprecated @AssistedInject annotation. Please replace "
                + "@AssistedInject with @Inject on the %s constructor.",
                method, implementationType);
          }
        }
      }

      AssistedConstructor matchingConstructor = paramsToConstructor.remove(methodParams);

      result.put(method, matchingConstructor);
    }
    return result;
  }

  public Set<Dependency<?>> getDependencies() {
    List<Dependency<?>> dependencies = Lists.newArrayList();
    for (AssistedConstructor<?> constructor : factoryMethodToConstructor.values()) {
      for (Parameter parameter : constructor.getAllParameters()) {
        if (!parameter.isProvidedByFactory()) {
          dependencies.add(Dependency.get(parameter.getPrimaryBindingKey()));
        }
      }
    }
    return ImmutableSet.copyOf(dependencies);
  }

  public F get() {
    InvocationHandler invocationHandler = new InvocationHandler() {
      public Object invoke(Object proxy, Method method, Object[] creationArgs) throws Throwable {
        // pass methods from Object.class to the proxy
        if (method.getDeclaringClass().equals(Object.class)) {
          return method.invoke(this, creationArgs);
        }

        AssistedConstructor<?> constructor = factoryMethodToConstructor.get(method);
        Object[] constructorArgs = gatherArgsForConstructor(constructor, creationArgs);
        Object objectToReturn = constructor.newInstance(constructorArgs);
        injector.injectMembers(objectToReturn);
        return objectToReturn;
      }

      public Object[] gatherArgsForConstructor(
          AssistedConstructor<?> constructor,
          Object[] factoryArgs) {
        int numParams = constructor.getAllParameters().size();
        int argPosition = 0;
        Object[] result = new Object[numParams];

        for (int i = 0; i < numParams; i++) {
          Parameter parameter = constructor.getAllParameters().get(i);
          if (parameter.isProvidedByFactory()) {
            result[i] = factoryArgs[argPosition];
            argPosition++;
          } else {
            result[i] = parameter.getValue(injector);
          }
        }
        return result;
      }
    };

    @SuppressWarnings("unchecked") // we imprecisely treat the class literal of T as a Class<T>
    Class<F> factoryRawType = (Class) factoryType.getRawType();
    return factoryRawType.cast(Proxy.newProxyInstance(BytecodeGen.getClassLoader(factoryRawType),
        new Class[] { factoryRawType }, invocationHandler));
  }

  private static ConfigurationException newConfigurationException(String format, Object... args) {
    return new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args))));
  }
}


text:
#ifndef USEARCH_H
#define USEARCH_H

#include "unicode/utypes.h"

#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION

#include "unicode/localpointer.h"
#include "unicode/ucol.h"
#include "unicode/ucoleitr.h"
#include "unicode/ubrk.h"

/**
 * \file
 * \brief C API: StringSearch
 *
 * C Apis for an engine that provides language-sensitive text searching based
 * on the comparison rules defined in a <tt>UCollator</tt> data struct,
 * see <tt>ucol.h</tt>. This ensures that language eccentricity can be
 * handled, e.g. for the German collator, characters ß and SS will be matched
 * if case is chosen to be ignored.
 * See the
 * "ICU Collation Design Document" for more information.
 *

 * The implementation may use a linear search or a modified form of the Boyer-Moore
 * search; for more information on the latter see
 *
 * "Efficient Text Searching in Java", published in Java Report
 * in February, 1999.
 *

 * There are 2 match options for selection:

 * Let S' be the sub-string of a text string S between the offsets start and
 * end <start, end>.
 *

 * A pattern string P matches a text string S at the offsets <start, end>
 * if
 *

 * option 1. Some canonical equivalent of P matches some canonical equivalent
 *           of S'
 * option 2. P matches S' and if P starts or ends with a combining mark,
 *           there exists no non-ignorable combining mark before or after S'
 *           in S respectively.
 *

 * Option 2. will be the default.
 *

 * This search has APIs similar to that of other text iteration mechanisms
 * such as the break iterators in <tt>ubrk.h</tt>. Using these
 * APIs, it is easy to scan through text looking for all occurances of
 * a given pattern. This search iterator allows changing of direction by
 * calling a <tt>reset</tt> followed by a <tt>next</tt> or <tt>previous</tt>.
 * Though a direction change can occur without calling <tt>reset</tt> first,
 * this operation comes with some speed penalty.
 * Generally, match results in the forward direction will match the result
 * matches in the backwards direction in the reverse order
 *

 * <tt>usearch.h</tt> provides APIs to specify the starting position
 * within the text string to be searched, e.g. <tt>usearch_setOffset</tt>,
 * <tt>usearch_preceding</tt> and <tt>usearch_following</tt>. Since the
 * starting position will be set as it is specified, please take note that
 * there are some dangerous positions which the search may render incorrect
 * results:
 *

 *
 The midst of a substring that requires normalization.
 *
 If the following match is to be found, the position should not be the
 *      second character which requires to be swapped with the preceding
 *      character. Vice versa, if the preceding match is to be found,
 *      position to search from should not be the first character which
 *      requires to be swapped with the next character. E.g certain Thai and
 *      Lao characters require swapping.
 *
 If a following pattern match is to be found, any position within a
 *      contracting sequence except the first will fail. Vice versa if a
 *      preceding pattern match is to be found, a invalid starting point
 *      would be any character within a contracting sequence except the last.
 *

 *

 * A breakiterator can be used if only matches at logical breaks are desired.
 * Using a breakiterator will only give you results that exactly matches the
 * boundaries given by the breakiterator. For instance the pattern "e" will
 * not be found in the string "\u00e9" if a character break iterator is used.
 *

 * Options are provided to handle overlapping matches.
 * E.g. In English, overlapping matches produces the result 0 and 2
 * for the pattern "abab" in the text "ababab", where else mutually
 * exclusive matches only produce the result of 0.
 *

 * Options are also provided to implement "asymmetric search" as described in
 *
 * UTS #10 Unicode Collation Algorithm, specifically the USearchAttribute
 * USEARCH_ELEMENT_COMPARISON and its values.
 *

 * Though collator attributes will be taken into consideration while
 * performing matches, there are no APIs here for setting and getting the
 * attributes. These attributes can be set by getting the collator
 * from <tt>usearch_getCollator</tt> and using the APIs in <tt>ucol.h</tt>.
 * Lastly to update String Search to the new collator attributes,
 * usearch_reset() has to be called.
 *

 * Restriction:

 * Currently there are no composite characters that consists of a
 * character with combining class > 0 before a character with combining
 * class == 0. However, if such a character exists in the future, the
 * search mechanism does not guarantee the results for option 1.
 *
 *

 * Example of use:

 *

 * char *tgtstr = "The quick brown fox jumped over the lazy fox";
 * char *patstr = "fox";
 * UChar target[64];
 * UChar pattern[16];
 * UErrorCode status = U_ZERO_ERROR;
 * u_uastrcpy(target, tgtstr);
 * u_uastrcpy(pattern, patstr);
 *
 * UStringSearch *search = usearch_open(pattern, -1, target, -1, "en_US",
 *                                  NULL, &status);
 * if (U_SUCCESS(status)) {
 *     for (int pos = usearch_first(search, &status);
 *          pos != USEARCH_DONE;
 *          pos = usearch_next(search, &status))
 *     {
 *         printf("Found match at %d pos, length is %d\n", pos,
 *                                        usearch_getMatchLength(search));
 *     }
 * }
 *
 * usearch_close(search);
 *

 * @stable ICU 2.4
 */

/**
* DONE is returned by previous() and next() after all valid matches have
* been returned, and by first() and last() if there are no matches at all.
* @stable ICU 2.4
*/
#define USEARCH_DONE -1

/**
* Data structure for searching
* @stable ICU 2.4
*/
struct UStringSearch;
/**
* Data structure for searching
* @stable ICU 2.4
*/
typedef struct UStringSearch UStringSearch;

/**
* @stable ICU 2.4
*/
typedef enum {
    /**
     * Option for overlapping matches
     * @stable ICU 2.4
     */
    USEARCH_OVERLAP = 0,
#ifndef U_HIDE_DEPRECATED_API
    /**
     * Option for canonical matches; option 1 in header documentation.
     * The default value will be USEARCH_OFF.
     * Note: Setting this option to USEARCH_ON currently has no effect on
     * search behavior, and this option is deprecated. Instead, to control
     * canonical match behavior, you must set UCOL_NORMALIZATION_MODE
     * appropriately (to UCOL_OFF or UCOL_ON) in the UCollator used by
     * the UStringSearch object.
     * @see usearch_openFromCollator
     * @see usearch_getCollator
     * @see usearch_setCollator
     * @see ucol_getAttribute
     * @deprecated ICU 53
     */
    USEARCH_CANONICAL_MATCH = 1,
#endif  /* U_HIDE_DEPRECATED_API */
    /**
     * Option to control how collation elements are compared.
     * The default value will be USEARCH_STANDARD_ELEMENT_COMPARISON.
     * @stable ICU 4.4
     */
    USEARCH_ELEMENT_COMPARISON = 2,

    /**
     * Count of attribute types
     * @stable ICU 2.4
     */
    USEARCH_ATTRIBUTE_COUNT = 3
} USearchAttribute;

/**
* @stable ICU 2.4
*/
typedef enum {
    /**
     * Default value for any USearchAttribute
     * @stable ICU 2.4
     */
    USEARCH_DEFAULT = -1,
    /**
     * Value for USEARCH_OVERLAP and USEARCH_CANONICAL_MATCH
     * @stable ICU 2.4
     */
    USEARCH_OFF,
    /**
     * Value for USEARCH_OVERLAP and USEARCH_CANONICAL_MATCH
     * @stable ICU 2.4
     */
    USEARCH_ON,
    /**
     * Value (default) for USEARCH_ELEMENT_COMPARISON;
     * standard collation element comparison at the specified collator
     * strength.
     * @stable ICU 4.4
     */
    USEARCH_STANDARD_ELEMENT_COMPARISON,
    /**
     * Value for USEARCH_ELEMENT_COMPARISON;
     * collation element comparison is modified to effectively provide
     * behavior between the specified strength and strength - 1. Collation
     * elements in the pattern that have the base weight for the specified
     * strength are treated as "wildcards" that match an element with any
     * other weight at that collation level in the searched text. For
     * example, with a secondary-strength English collator, a plain 'e' in
     * the pattern will match a plain e or an e with any diacritic in the
     * searched text, but an e with diacritic in the pattern will only
     * match an e with the same diacritic in the searched text.
     *
     * This supports "asymmetric search" as described in
     *
     * UTS #10 Unicode Collation Algorithm.
     *
     * @stable ICU 4.4
     */
    USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD,
    /**
     * Value for USEARCH_ELEMENT_COMPARISON.
     * collation element comparison is modified to effectively provide
     * behavior between the specified strength and strength - 1. Collation
     * elements in either the pattern or the searched text that have the
     * base weight for the specified strength are treated as "wildcards"
     * that match an element with any other weight at that collation level.
     * For example, with a secondary-strength English collator, a plain 'e'
     * in the pattern will match a plain e or an e with any diacritic in the
     * searched text, but an e with diacritic in the pattern will only
     * match an e with the same diacritic or a plain e in the searched text.
     *
     * This option is similar to "asymmetric search" as described in
     *
     * UTS #10 Unicode Collation Algorithm</a, but also allows unmarked
     * characters in the searched text to match marked or unmarked versions of
     * that character in the pattern.
     *
     * @stable ICU 4.4
     */
    USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD,

    /**
     * Count of attribute values
     * @stable ICU 2.4
     */
    USEARCH_ATTRIBUTE_VALUE_COUNT
} USearchAttributeValue;

/* open and close ------------------------------------------------------ */

/**
* Creating a search iterator data struct using the argument locale language
* rule set. A collator will be created in the process, which will be owned by
* this search and will be deleted in <tt>usearch_close</tt>.
* @param pattern for matching
* @param patternlength length of the pattern, -1 for null-termination
* @param text text string
* @param textlength length of the text string, -1 for null-termination
* @param locale name of locale for the rules to be used
* @param breakiter A BreakIterator that will be used to restrict the points
*                  at which matches are detected. If a match is found, but
*                  the match's start or end index is not a boundary as
*                  determined by the <tt>BreakIterator</tt>, the match will
*                  be rejected and another will be searched for.
*                  If this parameter is <tt>NULL</tt>, no break detection is
*                  attempted.
* @param status for errors if it occurs. If pattern or text is NULL, or if
*               patternlength or textlength is 0 then an
*               U_ILLEGAL_ARGUMENT_ERROR is returned.
* @return search iterator data structure, or NULL if there is an error.
* @stable ICU 2.4
*/
U_STABLE UStringSearch * U_EXPORT2 usearch_open(const UChar          *pattern,
                                              int32_t         patternlength,
                                        const UChar          *text,
                                              int32_t         textlength,
                                        const char           *locale,
                                              UBreakIterator *breakiter,
                                              UErrorCode     *status);

/**
* Creating a search iterator data struct using the argument collator language
* rule set. Note, user retains the ownership of this collator, thus the
* responsibility of deletion lies with the user.
* NOTE: string search cannot be instantiated from a collator that has
* collate digits as numbers (CODAN) turned on.
* @param pattern for matching
* @param patternlength length of the pattern, -1 for null-termination
* @param text text string
* @param textlength length of the text string, -1 for null-termination
* @param collator used for the language rules
* @param breakiter A BreakIterator that will be used to restrict the points
*                  at which matches are detected. If a match is found, but
*                  the match's start or end index is not a boundary as
*                  determined by the <tt>BreakIterator</tt>, the match will
*                  be rejected and another will be searched for.
*                  If this parameter is <tt>NULL</tt>, no break detection is
*                  attempted.
* @param status for errors if it occurs. If collator, pattern or text is NULL,
*               or if patternlength or textlength is 0 then an
*               U_ILLEGAL_ARGUMENT_ERROR is returned.
* @return search iterator data structure, or NULL if there is an error.
* @stable ICU 2.4
*/
U_STABLE UStringSearch * U_EXPORT2 usearch_openFromCollator(
                                         const UChar *pattern,
                                               int32_t         patternlength,
                                         const UChar          *text,
                                               int32_t         textlength,
                                         const UCollator      *collator,
                                               UBreakIterator *breakiter,
                                               UErrorCode     *status);

/**
* Destroying and cleaning up the search iterator data struct.
* If a collator is created in <tt>usearch_open</tt>, it will be destroyed here.
* @param searchiter data struct to clean up
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_close(UStringSearch *searchiter);

#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * \class LocalUStringSearchPointer
 * "Smart pointer" class, closes a UStringSearch via usearch_close().
 * For most methods see the LocalPointerBase base class.
 *
 * @see LocalPointerBase
 * @see LocalPointer
 * @stable ICU 4.4
 */
U_DEFINE_LOCAL_OPEN_POINTER(LocalUStringSearchPointer, UStringSearch, usearch_close);

U_NAMESPACE_END

#endif

/* get and set methods -------------------------------------------------- */

/**
* Sets the current position in the text string which the next search will
* start from. Clears previous states.
* This method takes the argument index and sets the position in the text
* string accordingly without checking if the index is pointing to a
* valid starting point to begin searching.
* Search positions that may render incorrect results are highlighted in the
* header comments
* @param strsrch search iterator data struct
* @param position position to start next search from. If position is less
*          than or greater than the text range for searching,
*          an U_INDEX_OUTOFBOUNDS_ERROR will be returned
* @param status error status if any.
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_setOffset(UStringSearch *strsrch,
                                        int32_t    position,
                                        UErrorCode    *status);

/**
* Return the current index in the string text being searched.
* If the iteration has gone past the end of the text (or past the beginning
* for a backwards search), <tt>USEARCH_DONE</tt> is returned.
* @param strsrch search iterator data struct
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_getOffset(const UStringSearch *strsrch);

/**
* Sets the text searching attributes located in the enum USearchAttribute
* with values from the enum USearchAttributeValue.
* <tt>USEARCH_DEFAULT</tt> can be used for all attributes for resetting.
* @param strsrch search iterator data struct
* @param attribute text attribute to be set
* @param value text attribute value
* @param status for errors if it occurs
* @see #usearch_getAttribute
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_setAttribute(UStringSearch         *strsrch,
                                           USearchAttribute       attribute,
                                           USearchAttributeValue  value,
                                           UErrorCode            *status);

/**
* Gets the text searching attributes.
* @param strsrch search iterator data struct
* @param attribute text attribute to be retrieve
* @return text attribute value
* @see #usearch_setAttribute
* @stable ICU 2.4
*/
U_STABLE USearchAttributeValue U_EXPORT2 usearch_getAttribute(
                                         const UStringSearch    *strsrch,
                                               USearchAttribute  attribute);

/**
* Returns the index to the match in the text string that was searched.
* This call returns a valid result only after a successful call to
* <tt>usearch_first</tt>, <tt>usearch_next</tt>, <tt>usearch_previous</tt>,
* or <tt>usearch_last</tt>.
* Just after construction, or after a searching method returns
* <tt>USEARCH_DONE</tt>, this method will return <tt>USEARCH_DONE</tt>.
*

* Use <tt>usearch_getMatchedLength</tt> to get the matched string length.
* @param strsrch search iterator data struct
* @return index to a substring within the text string that is being
*         searched.
* @see #usearch_first
* @see #usearch_next
* @see #usearch_previous
* @see #usearch_last
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_getMatchedStart(
                                               const UStringSearch *strsrch);

/**
* Returns the length of text in the string which matches the search pattern.
* This call returns a valid result only after a successful call to
* <tt>usearch_first</tt>, <tt>usearch_next</tt>, <tt>usearch_previous</tt>,
* or <tt>usearch_last</tt>.
* Just after construction, or after a searching method returns
* <tt>USEARCH_DONE</tt>, this method will return 0.
* @param strsrch search iterator data struct
* @return The length of the match in the string text, or 0 if there is no
*         match currently.
* @see #usearch_first
* @see #usearch_next
* @see #usearch_previous
* @see #usearch_last
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_getMatchedLength(
                                               const UStringSearch *strsrch);

/**
* Returns the text that was matched by the most recent call to
* <tt>usearch_first</tt>, <tt>usearch_next</tt>, <tt>usearch_previous</tt>,
* or <tt>usearch_last</tt>.
* If the iterator is not pointing at a valid match (e.g. just after
* construction or after <tt>USEARCH_DONE</tt> has been returned, returns
* an empty string. If result is not large enough to store the matched text,
* result will be filled with the partial text and an U_BUFFER_OVERFLOW_ERROR
* will be returned in status. result will be null-terminated whenever
* possible. If the buffer fits the matched text exactly, a null-termination
* is not possible, then a U_STRING_NOT_TERMINATED_ERROR set in status.
* Pre-flighting can be either done with length = 0 or the API
* <tt>usearch_getMatchLength</tt>.
* @param strsrch search iterator data struct
* @param result UChar buffer to store the matched string
* @param resultCapacity length of the result buffer
* @param status error returned if result is not large enough
* @return exact length of the matched text, not counting the null-termination
* @see #usearch_first
* @see #usearch_next
* @see #usearch_previous
* @see #usearch_last
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_getMatchedText(const UStringSearch *strsrch,
                                            UChar         *result,
                                            int32_t        resultCapacity,
                                            UErrorCode    *status);

#if !UCONFIG_NO_BREAK_ITERATION

/**
* Set the BreakIterator that will be used to restrict the points at which
* matches are detected.
* @param strsrch search iterator data struct
* @param breakiter A BreakIterator that will be used to restrict the points
*                  at which matches are detected. If a match is found, but
*                  the match's start or end index is not a boundary as
*                  determined by the <tt>BreakIterator</tt>, the match will
*                  be rejected and another will be searched for.
*                  If this parameter is <tt>NULL</tt>, no break detection is
*                  attempted.
* @param status for errors if it occurs
* @see #usearch_getBreakIterator
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_setBreakIterator(UStringSearch  *strsrch,
                                               UBreakIterator *breakiter,
                                               UErrorCode     *status);

/**
* Returns the BreakIterator that is used to restrict the points at which
* matches are detected. This will be the same object that was passed to the
* constructor or to <tt>usearch_setBreakIterator</tt>. Note that
* <tt>NULL</tt>
* is a legal value; it means that break detection should not be attempted.
* @param strsrch search iterator data struct
* @return break iterator used
* @see #usearch_setBreakIterator
* @stable ICU 2.4
*/
U_STABLE const UBreakIterator * U_EXPORT2 usearch_getBreakIterator(
                                              const UStringSearch *strsrch);

#endif

/**
* Set the string text to be searched. Text iteration will hence begin at the
* start of the text string. This method is useful if you want to re-use an
* iterator to search for the same pattern within a different body of text.
* @param strsrch search iterator data struct
* @param text new string to look for match
* @param textlength length of the new string, -1 for null-termination
* @param status for errors if it occurs. If text is NULL, or textlength is 0
*               then an U_ILLEGAL_ARGUMENT_ERROR is returned with no change
*               done to strsrch.
* @see #usearch_getText
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_setText(      UStringSearch *strsrch,
                                      const UChar         *text,
                                            int32_t        textlength,
                                            UErrorCode    *status);

/**
* Return the string text to be searched.
* @param strsrch search iterator data struct
* @param length returned string text length
* @return string text
* @see #usearch_setText
* @stable ICU 2.4
*/
U_STABLE const UChar * U_EXPORT2 usearch_getText(const UStringSearch *strsrch,
                                               int32_t       *length);

/**
* Gets the collator used for the language rules.
*

* Deleting the returned <tt>UCollator</tt> before calling
* <tt>usearch_close</tt> would cause the string search to fail.
* <tt>usearch_close</tt> will delete the collator if this search owns it.
* @param strsrch search iterator data struct
* @return collator
* @stable ICU 2.4
*/
U_STABLE UCollator * U_EXPORT2 usearch_getCollator(
                                               const UStringSearch *strsrch);

/**
* Sets the collator used for the language rules. User retains the ownership
* of this collator, thus the responsibility of deletion lies with the user.
* This method causes internal data such as Boyer-Moore shift tables to
* be recalculated, but the iterator's position is unchanged.
* @param strsrch search iterator data struct
* @param collator to be used
* @param status for errors if it occurs
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_setCollator(      UStringSearch *strsrch,
                                          const UCollator     *collator,
                                                UErrorCode    *status);

/**
* Sets the pattern used for matching.
* Internal data like the Boyer Moore table will be recalculated, but the
* iterator's position is unchanged.
* @param strsrch search iterator data struct
* @param pattern string
* @param patternlength pattern length, -1 for null-terminated string
* @param status for errors if it occurs. If text is NULL, or textlength is 0
*               then an U_ILLEGAL_ARGUMENT_ERROR is returned with no change
*               done to strsrch.
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_setPattern(      UStringSearch *strsrch,
                                         const UChar         *pattern,
                                               int32_t        patternlength,
                                               UErrorCode    *status);

/**
* Gets the search pattern
* @param strsrch search iterator data struct
* @param length return length of the pattern, -1 indicates that the pattern
*               is null-terminated
* @return pattern string
* @stable ICU 2.4
*/
U_STABLE const UChar * U_EXPORT2 usearch_getPattern(
                                               const UStringSearch *strsrch,
                                                     int32_t       *length);

/* methods ------------------------------------------------------------- */

/**
* Returns the first index at which the string text matches the search
* pattern.
* The iterator is adjusted so that its current index (as returned by
* <tt>usearch_getOffset</tt>) is the match position if one was found.
* If a match is not found, <tt>USEARCH_DONE</tt> will be returned and
* the iterator will be adjusted to the index <tt>USEARCH_DONE</tt>.
* @param strsrch search iterator data struct
* @param status for errors if it occurs
* @return The character index of the first match, or
* <tt>USEARCH_DONE</tt> if there are no matches.
* @see #usearch_getOffset
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_first(UStringSearch *strsrch,
                                           UErrorCode    *status);

/**
* Returns the first index equal or greater than <tt>position</tt> at which
* the string text
* matches the search pattern. The iterator is adjusted so that its current
* index (as returned by <tt>usearch_getOffset</tt>) is the match position if
* one was found.
* If a match is not found, <tt>USEARCH_DONE</tt> will be returned and
* the iterator will be adjusted to the index <tt>USEARCH_DONE</tt>
*

* Search positions that may render incorrect results are highlighted in the
* header comments. If position is less than or greater than the text range
* for searching, an U_INDEX_OUTOFBOUNDS_ERROR will be returned
* @param strsrch search iterator data struct
* @param position to start the search at
* @param status for errors if it occurs
* @return The character index of the first match following <tt>pos</tt>,
*         or <tt>USEARCH_DONE</tt> if there are no matches.
* @see #usearch_getOffset
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_following(UStringSearch *strsrch,
                                               int32_t    position,
                                               UErrorCode    *status);

/**
* Returns the last index in the target text at which it matches the search
* pattern. The iterator is adjusted so that its current
* index (as returned by <tt>usearch_getOffset</tt>) is the match position if
* one was found.
* If a match is not found, <tt>USEARCH_DONE</tt> will be returned and
* the iterator will be adjusted to the index <tt>USEARCH_DONE</tt>.
* @param strsrch search iterator data struct
* @param status for errors if it occurs
* @return The index of the first match, or <tt>USEARCH_DONE</tt> if there
*         are no matches.
* @see #usearch_getOffset
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_last(UStringSearch *strsrch,
                                          UErrorCode    *status);

/**
* Returns the first index less than <tt>position</tt> at which the string text
* matches the search pattern. The iterator is adjusted so that its current
* index (as returned by <tt>usearch_getOffset</tt>) is the match position if
* one was found.
* If a match is not found, <tt>USEARCH_DONE</tt> will be returned and
* the iterator will be adjusted to the index <tt>USEARCH_DONE</tt>
*

* Search positions that may render incorrect results are highlighted in the
* header comments. If position is less than or greater than the text range
* for searching, an U_INDEX_OUTOFBOUNDS_ERROR will be returned.
*

* When <tt>USEARCH_OVERLAP</tt> option is off, the last index of the
* result match is always less than <tt>position</tt>.
* When <tt>USERARCH_OVERLAP</tt> is on, the result match may span across
* <tt>position</tt>.
* @param strsrch search iterator data struct
* @param position index position the search is to begin at
* @param status for errors if it occurs
* @return The character index of the first match preceding <tt>pos</tt>,
*         or <tt>USEARCH_DONE</tt> if there are no matches.
* @see #usearch_getOffset
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_preceding(UStringSearch *strsrch,
                                               int32_t    position,
                                               UErrorCode    *status);

/**
* Returns the index of the next point at which the string text matches the
* search pattern, starting from the current position.
* The iterator is adjusted so that its current
* index (as returned by <tt>usearch_getOffset</tt>) is the match position if
* one was found.
* If a match is not found, <tt>USEARCH_DONE</tt> will be returned and
* the iterator will be adjusted to the index <tt>USEARCH_DONE</tt>
* @param strsrch search iterator data struct
* @param status for errors if it occurs
* @return The index of the next match after the current position, or
*         <tt>USEARCH_DONE</tt> if there are no more matches.
* @see #usearch_first
* @see #usearch_getOffset
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_next(UStringSearch *strsrch,
                                          UErrorCode    *status);

/**
* Returns the index of the previous point at which the string text matches
* the search pattern, starting at the current position.
* The iterator is adjusted so that its current
* index (as returned by <tt>usearch_getOffset</tt>) is the match position if
* one was found.
* If a match is not found, <tt>USEARCH_DONE</tt> will be returned and
* the iterator will be adjusted to the index <tt>USEARCH_DONE</tt>
* @param strsrch search iterator data struct
* @param status for errors if it occurs
* @return The index of the previous match before the current position,
*         or <tt>USEARCH_DONE</tt> if there are no more matches.
* @see #usearch_last
* @see #usearch_getOffset
* @see #USEARCH_DONE
* @stable ICU 2.4
*/
U_STABLE int32_t U_EXPORT2 usearch_previous(UStringSearch *strsrch,
                                              UErrorCode    *status);

/**
* Reset the iteration.
* Search will begin at the start of the text string if a forward iteration
* is initiated before a backwards iteration. Otherwise if a backwards
* iteration is initiated before a forwards iteration, the search will begin
* at the end of the text string.
* @param strsrch search iterator data struct
* @see #usearch_first
* @stable ICU 2.4
*/
U_STABLE void U_EXPORT2 usearch_reset(UStringSearch *strsrch);

#ifndef U_HIDE_INTERNAL_API
/**
  *  Simple forward search for the pattern, starting at a specified index,
  *     and using using a default set search options.
  *
  *  This is an experimental function, and is not an official part of the
  *      ICU API.
  *
  *  The collator options, such as UCOL_STRENGTH and UCOL_NORMALIZTION, are honored.
  *
  *  The UStringSearch options USEARCH_CANONICAL_MATCH, USEARCH_OVERLAP and
  *  any Break Iterator are ignored.
  *
  *  Matches obey the following constraints:
  *
  *      Characters at the start or end positions of a match that are ignorable
  *      for collation are not included as part of the match, unless they
  *      are part of a combining sequence, as described below.
  *
  *      A match will not include a partial combining sequence.  Combining
  *      character sequences  are considered to be  inseperable units,
  *      and either match the pattern completely, or are considered to not match
  *      at all.  Thus, for example, an A followed a combining accent mark will
  *      not be found when searching for a plain (unaccented) A.   (unless
  *      the collation strength has been set to ignore all accents).
  *
  *      When beginning a search, the initial starting position, startIdx,
  *      is assumed to be an acceptable match boundary with respect to
  *      combining characters.  A combining sequence that spans across the
  *      starting point will not supress a match beginning at startIdx.
  *
  *      Characters that expand to multiple collation elements
  *      (German sharp-S becoming 'ss', or the composed forms of accented
  *      characters, for example) also must match completely.
  *      Searching for a single 's' in a string containing only a sharp-s will
  *      find no match.
  *
  *
  *  @param strsrch    the UStringSearch struct, which references both
  *                    the text to be searched  and the pattern being sought.
  *  @param startIdx   The index into the text to begin the search.
  *  @param matchStart An out parameter, the starting index of the matched text.
  *                    This parameter may be NULL.
  *                    A value of -1 will be returned if no match was found.
  *  @param matchLimit Out parameter, the index of the first position following the matched text.
  *                    The matchLimit will be at a suitable position for beginning a subsequent search
  *                    in the input text.
  *                    This parameter may be NULL.
  *                    A value of -1 will be returned if no match was found.
  *
  *  @param status     Report any errors.  Note that no match found is not an error.
  *  @return           TRUE if a match was found, FALSE otherwise.
  *
  *  @internal
  */
U_INTERNAL UBool U_EXPORT2 usearch_search(UStringSearch *strsrch,
                                          int32_t        startIdx,
                                          int32_t        *matchStart,
                                          int32_t        *matchLimit,
                                          UErrorCode     *status);

/**
  *  Simple backwards search for the pattern, starting at a specified index,
  *     and using using a default set search options.
  *
  *  This is an experimental function, and is not an official part of the
  *      ICU API.
  *
  *  The collator options, such as UCOL_STRENGTH and UCOL_NORMALIZTION, are honored.
  *
  *  The UStringSearch options USEARCH_CANONICAL_MATCH, USEARCH_OVERLAP and
  *  any Break Iterator are ignored.
  *
  *  Matches obey the following constraints:
  *
  *      Characters at the start or end positions of a match that are ignorable
  *      for collation are not included as part of the match, unless they
  *      are part of a combining sequence, as described below.
  *
  *      A match will not include a partial combining sequence.  Combining
  *      character sequences  are considered to be  inseperable units,
  *      and either match the pattern completely, or are considered to not match
  *      at all.  Thus, for example, an A followed a combining accent mark will
  *      not be found when searching for a plain (unaccented) A.   (unless
  *      the collation strength has been set to ignore all accents).
  *
  *      When beginning a search, the initial starting position, startIdx,
  *      is assumed to be an acceptable match boundary with respect to
  *      combining characters.  A combining sequence that spans across the
  *      starting point will not supress a match beginning at startIdx.
  *
  *      Characters that expand to multiple collation elements
  *      (German sharp-S becoming 'ss', or the composed forms of accented
  *      characters, for example) also must match completely.
  *      Searching for a single 's' in a string containing only a sharp-s will
  *      find no match.
  *
  *
  *  @param strsrch    the UStringSearch struct, which references both
  *                    the text to be searched  and the pattern being sought.
  *  @param startIdx   The index into the text to begin the search.
  *  @param matchStart An out parameter, the starting index of the matched text.
  *                    This parameter may be NULL.
  *                    A value of -1 will be returned if no match was found.
  *  @param matchLimit Out parameter, the index of the first position following the matched text.
  *                    The matchLimit will be at a suitable position for beginning a subsequent search
  *                    in the input text.
  *                    This parameter may be NULL.
  *                    A value of -1 will be returned if no match was found.
  *
  *  @param status     Report any errors.  Note that no match found is not an error.
  *  @return           TRUE if a match was found, FALSE otherwise.
  *
  *  @internal
  */
U_INTERNAL UBool U_EXPORT2 usearch_searchBackwards(UStringSearch *strsrch,
                                                   int32_t        startIdx,
                                                   int32_t        *matchStart,
                                                   int32_t        *matchLimit,
                                                   UErrorCode     *status);
#endif  /* U_HIDE_INTERNAL_API */

#endif /* #if !UCONFIG_NO_COLLATION  && !UCONFIG_NO_BREAK_ITERATION */

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/white"
    tools:context="com.kzmen.sczxjf.ui.activity.kzmessage.LoginActivity">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <include layout="@layout/kz_title" />
    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:padding="@dimen/margin_top30">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/margin_top20"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:text="手机号"
                android:textColor="@color/seprate"
                android:textStyle="bold" />

            <com.kzmen.sczxjf.view.DJEditText
                android:layout_marginLeft="8dp"
                android:inputType="number"
                android:id="@+id/et_phone"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@null"
                android:hint=""
                android:textSize="14dp" />

        </LinearLayout>

        <View style="@style/bottom_line_gloom" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/margin_top30"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:text="验证码"
                android:textColor="@color/seprate"
                android:textStyle="bold" />

            <com.kzmen.sczxjf.view.DJEditText
                android:layout_marginLeft="8dp"
                android:id="@+id/ev_yz"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@null"
                android:hint=""
                android:textSize="14dp" />

            <TextView
                android:id="@+id/tv_yz"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="8dp"
                android:gravity="center"
                android:padding="8dp"
                android:text="发送验证码" />
        </LinearLayout>

        <View style="@style/bottom_line_gloom" />

        <TextView
            android:id="@+id/tv_next"
            style="@style/login_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginBottom="20dp"
            android:layout_marginTop="@dimen/margin_top30"
            android:background="@drawable/kz_bg_yellow_line"
            android:gravity="center"
            android:text="下一步" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/ll_xieyi"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal"
        android:padding="15dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="注册表明您同意" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="卡掌门用户协议"
            android:textStyle="bold" />
    </LinearLayout>
</LinearLayout>


text:
function FindProxyForURL(url, host) {
  return "DIRECT";
}


text:
package com.amazonaws.services.apigateway.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.apigateway.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * GetUsagePlanKeyResult JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetUsagePlanKeyResultJsonUnmarshaller implements Unmarshaller<GetUsagePlanKeyResult, JsonUnmarshallerContext> {

    public GetUsagePlanKeyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        GetUsagePlanKeyResult getUsagePlanKeyResult = new GetUsagePlanKeyResult();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return getUsagePlanKeyResult;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("id", targetDepth)) {
                    context.nextToken();
                    getUsagePlanKeyResult.setId(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("type", targetDepth)) {
                    context.nextToken();
                    getUsagePlanKeyResult.setType(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("value", targetDepth)) {
                    context.nextToken();
                    getUsagePlanKeyResult.setValue(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("name", targetDepth)) {
                    context.nextToken();
                    getUsagePlanKeyResult.setName(context.getUnmarshaller(String.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return getUsagePlanKeyResult;
    }

    private static GetUsagePlanKeyResultJsonUnmarshaller instance;

    public static GetUsagePlanKeyResultJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new GetUsagePlanKeyResultJsonUnmarshaller();
        return instance;
    }
}


text:
package com.ibm.xsp.extlib.component.picker.data;

import java.util.List;

/**
 * Simple implementation of a value picker result object.
 */
public class SimplePickerResult implements IPickerResult {

	public static class Entry implements IPickerEntry {
		private Object value;
		private Object label;
		public Entry(Object value, Object label) {
			this.value = value;
			this.label = label;
		}
		public Object getValue() {
			return value;
		}
		public Object getLabel() {
			return label;
		}
		public int getAttributeCount() {
			return 0;
		}
		public String getAttributeName(int index) {
			return null;
		}
		public Object getAttributeValue(int index) {
			return null;
		}
	}

	private List<IPickerEntry> entries;
	private int totalCount;

	public SimplePickerResult(List<IPickerEntry> entries, int totalCount) {
		this.entries = entries;
		this.totalCount = totalCount;
	}

	public List<IPickerEntry> getEntries() {
		return entries;
	}

	public int getTotalCount() {
		return totalCount;
	}
}


text:
/*
 * classie - class helper functions
 * from bonzo https://github.com/ded/bonzo
 *
 * classie.has( elem, 'my-class' ) -> true/false
 * classie.add( elem, 'my-new-class' )
 * classie.remove( elem, 'my-unwanted-class' )
 * classie.toggle( elem, 'my-class' )
 */
(function(window) {
    'use strict';

    function classReg(className) {
        return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
    }
    var hasClass, addClass, removeClass;
    if ('classList' in document.documentElement) {
        hasClass = function(elem, c) {
            return elem.classList.contains(c);
        };
        addClass = function(elem, c) {
            elem.classList.add(c);
        };
        removeClass = function(elem, c) {
            elem.classList.remove(c);
        };
    } else {
        hasClass = function(elem, c) {
            return classReg(c).test(elem.className);
        };
        addClass = function(elem, c) {
            if (!hasClass(elem, c)) {
                elem.className = elem.className + ' ' + c;
            }
        };
        removeClass = function(elem, c) {
            elem.className = elem.className.replace(classReg(c), ' ');
        };
    }

    function toggleClass(elem, c) {
        var fn = hasClass(elem, c) ? removeClass : addClass;
        fn(elem, c);
    }
    var classie = {
        hasClass: hasClass,
        addClass: addClass,
        removeClass: removeClass,
        toggleClass: toggleClass,
        has: hasClass,
        add: addClass,
        remove: removeClass,
        toggle: toggleClass
    };
    if (typeof define === 'function' && define.amd) {
        define(classie);
    } else {
        window.classie = classie;
    }
})(window);;;
(function(window) {
    'use strict';
    var transEndEventNames = {
            'WebkitTransition': 'webkitTransitionEnd',
            'MozTransition': 'transitionend',
            'OTransition': 'oTransitionEnd',
            'msTransition': 'MSTransitionEnd',
            'transition': 'transitionend'
        },
        transEndEventName = transEndEventNames[Modernizr.prefixed('transition')],
        support = {
            transitions: Modernizr.csstransitions
        };

    function extend(a, b) {
        for (var key in b) {
            if (b.hasOwnProperty(key)) {
                a[key] = b[key];
            }
        }
        return a;
    }

    function UIMorphingButton(el, options) {
        this.el = el;
        this.options = extend({}, this.options);
        extend(this.options, options);
        this._init();
    }
    UIMorphingButton.prototype.options = {
        closeEl: '',
        onBeforeOpen: function() {
            return false;
        },
        onAfterOpen: function() {
            return false;
        },
        onBeforeClose: function() {
            return false;
        },
        onAfterClose: function() {
            return false;
        }
    }
    UIMorphingButton.prototype._init = function() {
        this.button = this.el.querySelector('button');
        this.expanded = false;
        this.contentEl = this.el.querySelector('.morph-content');
        this._initEvents();
    }
    UIMorphingButton.prototype._initEvents = function() {
        var self = this;
        this.button.addEventListener('click', function() {
            self.toggle();
        });
        if (this.options.closeEl !== '') {
            var closeEl = this.el.querySelector(this.options.closeEl);
            if (closeEl) {
                closeEl.addEventListener('click', function() {
                    self.toggle();
                });
            }
        }
    }
    UIMorphingButton.prototype.toggle = function() {
        if (this.isAnimating) return false;
        if (this.expanded) {
            this.options.onBeforeClose();
        } else {
            classie.addClass(this.el, 'active');
            this.options.onBeforeOpen();
        }
        this.isAnimating = true;
        var self = this,
            onEndTransitionFn = function(ev) {
                if (ev.target !== this) return false;
                if (support.transitions) {
                    if (self.expanded && ev.propertyName !== 'opacity' || !self.expanded && ev.propertyName !== 'width' && ev.propertyName !== 'height' && ev.propertyName !== 'left' && ev.propertyName !== 'top') {
                        return false;
                    }
                    this.removeEventListener(transEndEventName, onEndTransitionFn);
                }
                self.isAnimating = false;
                if (self.expanded) {
                    classie.removeClass(self.el, 'active');
                    self.options.onAfterClose();
                } else {
                    self.options.onAfterOpen();
                }
                self.expanded = !self.expanded;
            };
        if (support.transitions) {
            this.contentEl.addEventListener(transEndEventName, onEndTransitionFn);
        } else {
            onEndTransitionFn();
        }
        var buttonPos = this.button.getBoundingClientRect();
        classie.addClass(this.contentEl, 'no-transition');
        this.contentEl.style.left = 'auto';
        this.contentEl.style.top = 'auto';
        setTimeout(function() {
            self.contentEl.style.left = buttonPos.left + 'px';
            self.contentEl.style.top = buttonPos.top + 'px';
            if (self.expanded) {
                classie.removeClass(self.contentEl, 'no-transition');
                classie.removeClass(self.el, 'open');
            } else {
                setTimeout(function() {
                    classie.removeClass(self.contentEl, 'no-transition');
                    classie.addClass(self.el, 'open');
                }, 25);
            }
        }, 25);
    }
    window.UIMorphingButton = UIMorphingButton;
})(window);

(function() {
    var docElem = window.document.documentElement,
        didScroll, scrollPosition;

    function noScrollFn() {
        window.scrollTo(scrollPosition ? scrollPosition.x : 0, scrollPosition ? scrollPosition.y : 0);
    }

    function noScroll() {
        window.removeEventListener('scroll', scrollHandler);
        window.addEventListener('scroll', noScrollFn);
    }

    function scrollFn() {
        window.addEventListener('scroll', scrollHandler);
    }

    function canScroll() {
        window.removeEventListener('scroll', noScrollFn);
        scrollFn();
    }

    function scrollHandler() {
        if (!didScroll) {
            didScroll = true;
            setTimeout(function() {
                scrollPage();
            }, 60);
        }
    };

    function scrollPage() {
        scrollPosition = {
            x: window.pageXOffset || docElem.scrollLeft,
            y: window.pageYOffset || docElem.scrollTop
        };
        didScroll = false;
    };
    scrollFn();
    [].slice.call(document.querySelectorAll('.morph-button')).forEach(function(bttn) {
        var el = bttn.parentNode.querySelector('.morph-button');
        new UIMorphingButton(bttn, {
            closeEl: '.icon-close',
            onBeforeOpen: function() {
                noScroll();
            },
            onAfterOpen: function() {
                canScroll();
                classie.addClass(document.body, 'noscroll');
                classie.addClass(el, 'scroll');
            },
            onBeforeClose: function() {
                classie.removeClass(document.body, 'noscroll');
                classie.removeClass(el, 'scroll');
                noScroll();
            },
            onAfterClose: function() {
                canScroll();
            }
        });
    });
})();


text:
<!DOCTYPE html>

    <?php include("Meta.php");?>
    <title>Green Leaf Wild Life - About</title>

    <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon" type="image/x-icon" href="img/apple-touch-icon-57x57-precomposed.png">
    <link rel="apple-touch-icon" type="image/x-icon" sizes="72x72" href="img/apple-touch-icon-72x72-precomposed.png">
    <link rel="apple-touch-icon" type="image/x-icon" sizes="114x114" href="img/apple-touch-icon-114x114-precomposed.png">
    <link rel="apple-touch-icon" type="image/x-icon" sizes="144x144" href="img/apple-touch-icon-144x144-precomposed.png">

    <link href='http://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Gochi+Hand' rel='stylesheet' type='text/css'>

    <link href="<?php echo site_url();?>/css/base.css" rel="stylesheet">

    <link rel="stylesheet" href="<?php echo site_url();?>css/weather.css" >

							<a href="<?php echo site_url('Home');?>">

					<?php require("Nav.php");?>

About

                    Ridiculus sociosqu cursus neque cursus curae ante scelerisque vehicula.

<a href="<?php echo site_url("Home");?>">Home

<a href="<?php echo site_url('About');?>">About

                <img src="<?php echo site_url();?>/img/best_price.png" alt="">

About Green Leaf Wild Life

                We as the team of Greenleaf are nature loving enthusiasts with similar liking and that is trailingthrough the varied beauty of nature. We belong to the different backgrounds but for more than 10 years we are following nature through camping, photography, nature presentations etc. and one fine day in 2012 we decided to develope our common interest into serious hobby. We presently organize Wild Life tours with Tiger Safari as the main attraction, Bird Watching tours, Nature as Stress buster tour for Corporates & Family categories.

Jungle Safari

                            Esse dicit accusam duo an. Modus simul ei nec. Sea et explicari pertinacia, cu vitae bonorum vocibus nec, corpora signiferumque no vim. Ad principes scriptorem duo, te omnium gubergren eam, et eam ancillae appareat dissentiet. Quando tantas animal vis ut, mandamus voluptatum duo ne, ne odio vidit commodo has.

Bird Watching

                            Esse dicit accusam duo an. Modus simul ei nec. Sea et explicari pertinacia, cu vitae bonorum vocibus nec, corpora signiferumque no vim. Ad principes scriptorem duo, te omnium gubergren eam, et eam ancillae appareat dissentiet. Quando tantas animal vis ut, mandamus voluptatum duo ne, ne odio vidit commodo has.

Photography

                            Esse dicit accusam duo an. Modus simul ei nec. Sea et explicari pertinacia, cu vitae bonorum vocibus nec, corpora signiferumque no vim. Ad principes scriptorem duo, te omnium gubergren eam, et eam ancillae appareat dissentiet.

Jungle Trail

                            Esse dicit accusam duo an. Modus simul ei nec. Sea et explicari pertinacia, cu vitae bonorum vocibus nec, corpora signiferumque no vim. Ad principes scriptorem duo, te omnium gubergren eam, et eam ancillae appareat dissentiet.

A/C Cars

                         Eum purto epicurei cotidieque at, ius luptatum invidunt no, vim at sint pertinacia repudiandae. Ad cum dicant laboramus delicatissimi, ex has nonumes explicari prodesset, brute tincidunt conclusionemque no has.

Photography Tips

                         Eum purto epicurei cotidieque at, ius luptatum invidunt no, vim at sint pertinacia repudiandae. Ad cum dicant laboramus delicatissimi, ex has nonumes explicari prodesset, brute tincidunt conclusionemque no has.

Hygienic & healthy food options

                         Eum purto epicurei cotidieque at, ius luptatum invidunt no, vim at sint pertinacia repudiandae. Ad cum dicant laboramus delicatissimi, ex has nonumes explicari prodesset, brute tincidunt conclusionemque no has.

                                    <img class="img-circle" src="<?php echo site_url();?>/img/testimonial_1.jpg" alt="">

                                         "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut rutrum elit in arcu blandit, eget pretium nisl accumsan. Sed ultricies commodo tortor, eu pretium mauris."

                                    Someone famous

                                    <img class="img-circle" src="<?php echo site_url();?>/img/testimonial_1.jpg" alt="">

                                         "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut rutrum elit in arcu blandit, eget pretium nisl accumsan. Sed ultricies commodo tortor, eu pretium mauris."

                                    Someone famous

                                    <img class="img-circle" src="<?php echo site_url();?>/img/testimonial_1.jpg" alt="">

                                         "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut rutrum elit in arcu blandit, eget pretium nisl accumsan. Sed ultricies commodo tortor, eu pretium mauris."

                                    Someone famous

    <?php require("Footer.php");?>