text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "iroutablefactory.h"
#include <vespa/messagebus/blobref.h>
#include <vespa/vespalib/component/versionspecification.h>
#include <mutex>
#include <map>

namespace documentapi {

/**
 * This class encapsulates the logic required to map routable type and version to a corresponding {@link
 * RoutableFactory}. It is owned and accessed through a {@link DocumentProtocol} instance. This class uses a
 * factory cache to reduce the latency of matching version specifications to actual versions when resolving
 * factories.
 */
class RoutableRepository {
private:
    /**
     * Internal helper class that implements a map from {@link VersionSpecification} to {@link
     * RoutableFactory}.
     */
    class VersionMap {
    private:
        std::map<vespalib::VersionSpecification, IRoutableFactory::SP> _factoryVersions;

    public:
        VersionMap();
        bool putFactory(const vespalib::VersionSpecification &version, IRoutableFactory::SP factory);
        IRoutableFactory::SP getFactory(const vespalib::Version &version) const;
    };

    typedef std::pair<vespalib::Version, uint32_t>   CacheKey;
    typedef std::map<CacheKey, IRoutableFactory::SP> FactoryCache;
    typedef std::map<uint32_t, VersionMap>           TypeMap;

    mutable std::mutex   _lock;
    TypeMap              _factoryTypes;
    mutable FactoryCache _cache;

public:
    RoutableRepository(const RoutableRepository &) = delete;
    RoutableRepository & operator = (const RoutableRepository &) = delete;
    /**
     * Constructs a new routable repository.
     */
    RoutableRepository();

    /**
     * Decodes a {@link Routable} from the given byte array. This uses the content of the byte array to
     * dispatch the decode request to the appropriate {@link RoutableFactory} that was previously registered.
     *
     * If a routable can not be decoded, this method returns an empty blob.
     *
     * @param version The version of the encoded routable.
     * @param data    The byte array containing the encoded routable.
     * @return The decoded routable.
     */
    mbus::Routable::UP decode(const vespalib::Version &version, mbus::BlobRef data) const;

    /**
     * Encodes a {@link Routable} into a byte array. This dispatches the encode request to the appropriate
     * {@link RoutableFactory} that was previously registered.
     *
     * If a routable can not be encoded, this method returns an empty byte array.
     *
     * @param version The version to encode the routable as.
     * @param obj     The routable to encode.
     * @return The byte array containing the encoded routable.
     */
    mbus::Blob encode(const vespalib::Version &version, const mbus::Routable &obj) const;

    /**
     * Registers a routable factory for a given version and routable type.
     *
     * @param version The version specification that the given factory supports.
     * @param type    The routable type that the given factory supports.
     * @param factory The routable factory to register.
     */
    void putFactory(const vespalib::VersionSpecification &version,
                    uint32_t type, IRoutableFactory::SP factory);

    /**
     * Returns the routable factory for a given version and routable type.
     *
     * @param version The version that the factory must support.
     * @param type    The routable type that the factory must support.
     * @return The routable factory matching the criteria, or null.
     */
    IRoutableFactory::SP getFactory(const vespalib::Version &version, uint32_t type) const;

    /**
     * Returns a list of routable types that support the given version.
     *
     * @param version The version to return types for.
     * @param out     The list to write to.
     * @return The number of supported types.
     */
    uint32_t getRoutableTypes(const vespalib::Version &version, std::vector<uint32_t> &out) const;
};

}

redpajama_set_name: RedPajamaGithub


text:
[![Latest Stable Version](https://poser.pugx.org/dtkahl/php-access-control/v/stable)](https://packagist.org/packages/dtkahl/php-access-control)
[![License](https://poser.pugx.org/dtkahl/php-access-control/license)](https://packagist.org/packages/dtkahl/php-access-control)
[![Build Status](https://travis-ci.org/dtkahl/php-access-control.svg?branch=master)](https://travis-ci.org/dtkahl/php-access-control)

# PHP access control

This package provides an access control (right management) system based on user, roles, rights and objects.

### User

The main reason of this package is to prove whether the user has a specific right or not.

A user can have a right on different ways:

- through a global role
- through an object role

### Roles

A role is a defined set of rights and can extend another existing role. Roles can be assigned on a global scope or on a specific object.

### Objects

An user can have a specific role for a specific object. As example: The User "John" has the role "author" on the object "BlogPost".

A object can be any class that implements `ObjectInterface`. As example it could be the Eloquent model class `BlogPost`.

## Installation

Install with [Composer](http://getcomposer.org):
```
composer require dtkahl/php-array-tools
```

## Usage

### create User(s)

This is not really a big deal. You just need a class that implements the `UserAccessInterface`.

This requires you to implement one method:

- `getGlobalRoles` - Returns an array of role names (strings) you want your user to have. The way you store this information is completely up to you.

### create Objects

This is a step you can skip if you only want to implement global rights. If you wan to have object roles and rights you have to implement the `ObjectInterface` in your objects class.

This requires three methods:

- `getObjectIdentifier` - Returns an identifier as string. This is used to find the right rights in the later defined roles
- `getUserRoles` - Returns an array of role names (string) that the given user (parameter of this method) have in relation to this object instance. The way you store this information is completely up to you.
- `getRelatedObjects` - Returns an array of related objects (which also have to implement the interface). This is used for inheritance. As example: The User is allowed to delete a BlogComment because the BlogComment is related to the BlogPost for which the user has the role "author"

### define roles an rights

This could take place anywhere in your application but needs to be done before checking rights. The best place could be inside a dependency injection container.

**Defining a role**

```php
$role_member = new AccessRole(
    "member", // role name
    [
        "access",                           // rights as string
        "blog_post.edit"                    // you can namespace rights with a dot, this is often used for object identifier
        "blog_post" => ["view", "create"]   // instead of a dot you can also use an array to create namespaces
    ],
);
```

Namespaces are new with issue #10 and new release 2.0.0

**Extending a role**

```php
$role_admin = new AccessRole(
    "admin", // role name
    ["do_admin_stuff"],  // global rights as array
    [],
    $role_member // extend the member role so you dont have to specify all rights a second time
);
```

**define an object**

```php
$object_blog = new AccessObject(
    "blog", // identifier of an object
    [$role_author, $role_subscriber] // array of object related roles
);
```

**create the judge instance**

```php
$judge = new Judge(
    [$role_member], // array of all defined global roles
    [$object_blog, $object_comment], // array of all defined objects
    $user // optional, default user to check rights for
);
```

## The Judge class

This is the main class to check rights or roles. You normally want let your dependency container to return a instance of this class.

It has the following public methods:

### `registerRole($role)`

Register a new global role for the Judge instance.

### `registerObject($object)`

Register a new object for the Judge instance.

### `setUser($user)`

Set the default user for the Judge instance.

### `getUser()`

Return the default user of the Judge instance.

### `checkRight($rights, $object = null, $user = null)`

Throws `NotAllowedException` if the user do not have the given right(s).

If given object is null it only checks global rights.
If given user is null it uses the default user.

**Example:**
```php
$comment = BlogComment::find('1');
$judge->checkRight('edit', $comment); // check if the default user is allowed to edit a specific comment
```

### `hasRight($rights, $object = null, $user = null)`

This is a proxy for `checkRights()` but instead of throwing an exception it only return true or false.

### `checkRole`

Throws `NotALlowedException` if the user do not have the given role.

If given object is null it only checks global roles.
If given user is null it uses the default user.
If parameter `check_extend_roles` is true (default: false) the given role is also checked against the extend roles of the roles the user has. (see issue #9)

**Example:**
```php
$comment = BlogComment::find('1');
$judge->checkRole('creator', $comment); // check if the default user is the creator of this comment
```

### `hasRight`

This is a proxy for `checkRole()` but instead of throwing an exception it only return true or false.


text:
int
main (int argc, char *argv[])
{
	osso_context_t *osso_context;
      	gboolean ret;

	osso_context = osso_initialize ("test_open_default_inbox",
					"0.0.1",
					TRUE,
					NULL);

	if (osso_context == NULL) {
		g_printerr ("osso_initialize() failed.\n");
	    return -1;
	}

	ret = libmodest_dbus_client_open_default_inbox (osso_context);

	if (!ret) {
		g_printerr ("libmodest_dbus_client_open_default_inbox() failed.\n");
	} else {
		g_print ("libmodest_dbus_client_open_default_inbox() succeeded.\n");
	}

    return ret ? 0 : -1;
}


text:
// Type definitions for D3JS d3-polygon module 1.0
// Project: https://github.com/d3/d3-polygon/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

// Last module patch version validated against: 1.0.1

/**
 * Returns the signed area of the specified polygon. If the vertices of the polygon are in counterclockwise order (
 * assuming a coordinate system where the origin ⟨0,0⟩ is in the top-left corner), the returned area is positive;
 * otherwise it is negative, or zero.
 *
 * @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
 */
export function polygonArea(polygon: Array<[number, number]>): number;

/**
 * Returns the centroid of the specified polygon.
 *
 * @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
 */
export function polygonCentroid(polygon: Array<[number, number]>): [number, number];

/**
 * Returns the convex hull of the specified points using Andrew's monotone chain algorithm.
 * The returned hull is represented as an array containing a subset of the input points arranged in
 * counterclockwise order. Returns null if points has fewer than three elements.
 *
 * @param points Array of coordinates <x0, y0>, <x1, y1> and so on.
 */
export function polygonHull(points: Array<[number, number]>): Array<[number, number]> | null;

/**
 * Returns true if and only if the specified point is inside the specified polygon.
 *
 * @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
 * @param point Coordinates of point <x, y>
 */
export function polygonContains(polygon: Array<[number, number]>, point: [number, number]): boolean;

/**
 * Returns the length of the perimeter of the specified polygon.
 *
 * @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
 */
export function polygonLength(polygon: Array<[number, number]>): number;


text:
Scripts utilized to prep data for comparison of calls from the svtools pipeline to calls from the 1000 Genomes Project. This code is specific for the 1000 Genomes Phase 3 Integrated SV Map currently found here: ftp://ftp.ncbi.nlm.nih.gov/1000genomes/ftp/phase3/integrated_sv_map/ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.vcf.gz

# Dependencies
A Docker container containing all dependencies is available from Docker Hub as halllab/1kg_sv_comparison and a Dockerfile is contained within [this repo](Dockerfile).

Alternatively, the following are pre-requisites:
* curl
* Python (2.7)
* PyVCF (0.6.8)
* pysam (0.8.4)
* bgzip (any version)
* bcftools (>=1.2)
* svtools (>=0.3.1)
* perl (>=0.5.10)
* make (if you use the Makefile)

# 1000 Genome Calls Preparation
A Makefile is provide to run these steps. If the dependencies are met then you can run by typing `make all`.
1. Download the calls
   ```
   curl -O ftp://ftp.ncbi.nlm.nih.gov/1000genomes/ftp/phase3/integrated_sv_map/ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.vcf.gz
   ```
2. Convert to svtools/lumpy-sv compatible SVTYPE fields.
   ```
   python 1kg_phase3_to_svtools_compat_svtype.py \
      ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.vcf.gz \
      | bgzip -c > ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.svtools_types.vcf.gz
   ```
3. Remove MEI insertions (relative to the reference)
   * These aren't compatible with svtools as they lack an END INFO field and the pipeline doesn't detect these.
   ```
   bcftools view -e 'SVTYPE=="ALU" || SVTYPE=="LINE1" || SVTYPE=="SVA"' \
      ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.svtools_types.vcf.gz - \
      | bgzip -c > ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.svtools_types.no_ins_of_mei.vcf.gz
   ```
4. Remove SV calls only detected by read depth based algorithms.
   ```
   python remove_read_depth_only.py \
      ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.svtools_types.no_ins_of_mei.vcf.gz \
      | bgzip -c \
      > ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.svtools_types.non_rd_only.no_ins_of_mei.vcf.gz
   ```
# Comparison of SV VCF to 1000 Genomes
A wrapper script is provided to aid in the comparison of multiple samples.
## Inputs
   1. The 1000 Genomes VCF prepared above.
   2. An evaluation VCF containing samples overlapping with the 1000 Genomes cohort.
   3. A 2-column, tab-separated file where the first column is the sample name in the evaluation VCF and the second column is the sample name in the 1000 Genomes VCF. For example:
      ```
      H_IJ-NA19239-NA19239_B9	NA19239
      ```
## Invocation
The script is called like:
```
bash 1kg_sens_multi.sh \
   ALL.wgs.integrated_sv_map_v2.20130502.svs.genotypes.svtools_types.non_rd_only.no_ins_of_mei.vcf.gz \
   cohort.sv.gt.cn.pruned.reclassed.filtered.nosec.vcf.gz \
   sample_name_in_1kg.map
```

## Results
In the current working directory, a sub-directory for each 1000 Genomes sample is created. Inside each sub-directory will be three files.
   1. A BEDPE of the 1000 Genomes call for the sample.
   2. A BEDPE of the evaluation calls for the sample.
   3. A file of calculated sensitivities which has structure as shown below:
      ```
      Unfiltered Total Calls	9586
      Unfiltered Overlapping 1KG	1641
      Unfiltered Fraction Overlapping 1KG	0.171187
      Unfiltered 1KG Sensitivity	0.888949
      Filtered Total Calls	3916
      Filtered Overlapping 1KG	1559
      Filtered Fraction Overlapping 1KG	0.39811
      Filtered 1KG Sensitivity	0.844529
      ```


text:
import React, { PropTypes } from "react";

export default function makeFullHeightComponent(Component, heightCalculationFunc) {
  if (!heightCalculationFunc) {
    throw new Error("You must Provided a height calculation function");
  }

  return class FullHeightWrapper extends React.Component {
    constructor() {
      super();
      this.displayName = "FullHeightWrapper";
      this.state = { height: 0 };
    }

    getComponent() {
      return this.refs.childComponent;
    }

    componentDidMount() {
      window.addEventListener("resize", this.calculateHeight);
      this.calculateHeight();
    }

    componentWillUnmount() {
      window.removeEventListener("resize", this.calculateHeight);
    }

    calculateHeight = () => {
      this.setState({
        height: heightCalculationFunc(),
      });
    }

    render() {
      return (<Component {...this.props} ref="childComponent" height={this.state.height} />);
    }
  };
}


text:
package resources_test

import (
	"encoding/json"

	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant"
	"code.cloudfoundry.org/cli/resources"
	"code.cloudfoundry.org/cli/types"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gstruct"
)

var _ = Describe("Process", func() {
	Describe("MarshalJSON", func() {
		var (
			process      resources.Process
			processBytes []byte
			err          error
		)

		BeforeEach(func() {
			process = resources.Process{}
		})

		JustBeforeEach(func() {
			processBytes, err = process.MarshalJSON()
			Expect(err).ToNot(HaveOccurred())
		})

		When("instances is provided", func() {
			BeforeEach(func() {
				process = resources.Process{
					Instances: types.NullInt{Value: 0, IsSet: true},
				}
			})

			It("sets the instances to be set", func() {
				Expect(string(processBytes)).To(MatchJSON(`{"instances": 0}`))
			})
		})

		When("memory is provided", func() {
			BeforeEach(func() {
				process = resources.Process{
					MemoryInMB: types.NullUint64{Value: 0, IsSet: true},
				}
			})

			It("sets the memory to be set", func() {
				Expect(string(processBytes)).To(MatchJSON(`{"memory_in_mb": 0}`))
			})
		})

		When("disk is provided", func() {
			BeforeEach(func() {
				process = resources.Process{
					DiskInMB: types.NullUint64{Value: 0, IsSet: true},
				}
			})

			It("sets the disk to be set", func() {
				Expect(string(processBytes)).To(MatchJSON(`{"disk_in_mb": 0}`))
			})
		})

		When("log rate limit is provided", func() {
			BeforeEach(func() {
				process = resources.Process{
					LogRateLimitInBPS: types.NullInt{Value: 1024, IsSet: true},
				}
			})

			It("sets the log rate limit to be set", func() {
				Expect(string(processBytes)).To(MatchJSON(`{"log_rate_limit_in_bytes_per_second": 1024}`))
			})
		})
		When("health check type http is provided", func() {
			BeforeEach(func() {
				process = resources.Process{
					HealthCheckType:     constant.HTTP,
					HealthCheckEndpoint: "some-endpoint",
				}
			})

			It("sets the health check type to http and has an endpoint", func() {
				Expect(string(processBytes)).To(MatchJSON(`{"health_check":{"type":"http", "data": {"endpoint": "some-endpoint"}}}`))
			})
		})

		When("health check type port is provided", func() {
			BeforeEach(func() {
				process = resources.Process{
					HealthCheckType: constant.Port,
				}
			})

			It("sets the health check type to port", func() {
				Expect(string(processBytes)).To(MatchJSON(`{"health_check":{"type":"port", "data": {}}}`))
			})
		})

		When("health check type process is provided", func() {
			BeforeEach(func() {
				process = resources.Process{
					HealthCheckType: constant.Process,
				}
			})

			It("sets the health check type to process", func() {
				Expect(string(processBytes)).To(MatchJSON(`{"health_check":{"type":"process", "data": {}}}`))
			})
		})

		When("process has no fields provided", func() {
			BeforeEach(func() {
				process = resources.Process{}
			})

			It("sets the health check type to process", func() {
				Expect(string(processBytes)).To(MatchJSON(`{}`))
			})
		})
	})

	Describe("UnmarshalJSON", func() {
		var (
			process      resources.Process
			processBytes []byte
			err          error
		)
		BeforeEach(func() {
			processBytes = []byte("{}")
		})

		JustBeforeEach(func() {
			err = json.Unmarshal(processBytes, &process)
			Expect(err).ToNot(HaveOccurred())
		})
		When("log rate limit is provided", func() {
			BeforeEach(func() {
				processBytes = []byte(`{"log_rate_limit_in_bytes_per_second": 512}`)
			})

			It("sets the log rate limit", func() {
				Expect(process).To(MatchFields(IgnoreExtras, Fields{
					"LogRateLimitInBPS": Equal(types.NullInt{Value: 512, IsSet: true}),
				}))
			})
		})
		When("health check type http is provided", func() {
			BeforeEach(func() {
				processBytes = []byte(`{"health_check":{"type":"http", "data": {"endpoint": "some-endpoint"}}}`)
			})

			It("sets the health check type to http and has an endpoint", func() {
				Expect(process).To(MatchFields(IgnoreExtras, Fields{
					"HealthCheckType":     Equal(constant.HTTP),
					"HealthCheckEndpoint": Equal("some-endpoint"),
				}))
			})
		})

		When("health check type port is provided", func() {
			BeforeEach(func() {
				processBytes = []byte(`{"health_check":{"type":"port", "data": {"endpoint": null}}}`)
			})

			It("sets the health check type to port", func() {
				Expect(process).To(MatchFields(IgnoreExtras, Fields{
					"HealthCheckType": Equal(constant.Port),
				}))
			})
		})

		When("health check type process is provided", func() {
			BeforeEach(func() {
				processBytes = []byte(`{"health_check":{"type":"process", "data": {"endpoint": null}}}`)
			})

			It("sets the health check type to process", func() {
				Expect(process).To(MatchFields(IgnoreExtras, Fields{
					"HealthCheckType": Equal(constant.Process),
				}))
			})
		})
	})
})


text:
package com.github.neuralnetworks.calculation.operations.aparapi;

import com.github.neuralnetworks.architecture.Connections;
import com.github.neuralnetworks.architecture.Layer;
import com.github.neuralnetworks.calculation.operations.ClearValuesManager;
import com.github.neuralnetworks.tensor.Matrix;
import com.github.neuralnetworks.tensor.TensorFactory;
import com.github.neuralnetworks.tensor.ValuesProvider;

/**
 * Base Aparapi connection calculator for weighted sum functions (matrix
 * multiplication). If there are multiple inbound connections they are combined
 * in a "single" connection and are calculated simultaneously
 *
 * !!! IMPORTANT !!! Aparapi only works one-dimensional arrays of primitive data
 * types can only call member methods of the Kernel class itself.
 *
 * Because of this limitations all the data that is contained in the input
 * connections, weight matrices, input values etc is converted into
 * one-dimensional member arrays of this class
 */
public class AparapiWeightedSum extends AparapiFullyConnected
{

	private static final long serialVersionUID = 1L;

	private int clear;

	public AparapiWeightedSum(Connections inputConnection, ValuesProvider valuesProvider, Layer targetLayer)
	{
		super(inputConnection, valuesProvider, targetLayer);
		Matrix o = TensorFactory.tensor(targetLayer, inputConnection, valuesProvider);

		if (!ClearValuesManager.getInstance().isCleared(o))
		{
			ClearValuesManager.getInstance().addToCleared(o);
			clear = 0;
		} else
		{
			clear = 1;
		}
	}

	@Override
	public void run()
	{
		int id = getGlobalId();

		float value = 0;
		int inputStartIndex = 0;
		int outputStartIndex = outputStartPosition + id * outputColumnStep;
		int weightStartIndex = weightStartPosition + weightsInitialStep * id;

		// each input example
		for (int i = 0; i < miniBatchSize; i++)
		{
			// each connection (of the combined connections)
			value = output[outputStartIndex + i * outputRowStep] * clear;
			// each element in the row/column

			inputStartIndex = inputStartPosition + i * inputRowStep;
			for (int j = 0; j < weightsSize; j++)
			{
				value += input[inputStartIndex + j * inputColumnStep] * weights[weightStartIndex + j * weightsStep];
			}

			output[outputStartIndex + i * outputRowStep] = value;
		}

		after();
	}

	protected void after()
	{
	}

	public int getClear()
	{
		return clear;
	}
}


text:
Controller = (function(){

})();


text:
```js
$window.location.reload();
```


text:
package com.orhanobut.logger;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * Used to determine how messages should be printed or saved.
 *
 * @see PrettyFormatStrategy
 * @see CsvFormatStrategy
 */
public interface FormatStrategy {

  void log(int priority, @Nullable String tag, @NonNull String message);
}


text:
package com.geewhiz.pacify.property.resolver;

import java.util.Set;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.tools.ant.types.FilterSet;

import com.geewhiz.pacify.resolver.PropertyResolver;
import com.geewhiz.pacify.utils.RegExpUtils;

public abstract class BasePropertyResolver implements PropertyResolver {

    @Override
    public FilterSet createFilterSet() {
        FilterSet filterset = new FilterSet();

        filterset.setBeginToken(getBeginToken());
        filterset.setEndToken(getEndToken());

        return filterset;
    }

    @Override
    public boolean propertyUsesToken(String property) {
        return getMatcher(getPropertyValue(property)).find();
    }

    protected Matcher getMatcher(String propertyValue) {
        Pattern pattern = RegExpUtils.getDefaultPattern(getBeginToken(), getEndToken());

        Matcher matcher = pattern.matcher(propertyValue);
        return matcher;
    }

    public Set<String> getReferencedProperties(String property) {
        String propertyValue = getPropertyValue(property);
        Matcher matcher = getMatcher(propertyValue);

        Set<String> result = new TreeSet<String>();
        while (matcher.find()) {
            String propertyId = matcher.group(1);
            result.add(propertyId);
        }

        return result;
    }

    @Override
    public int compareTo(PropertyResolver o) {
        return getPropertyResolverDescription().compareTo(o.getPropertyResolverDescription());
    }

}


text:
$(document).ready(function(){
	$('newBikeForm')
		.formValidation({
			framework: 'bootstrap'
			icon: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                nickname: {
                    row: '.col-xs-4',
                    validators: {
                        notEmpty: {
                            message: 'A Nickname for you Bike is required	'
                        }
                    }
		})
}


text:
/*
 * default style for pusher chat
 * Pusher chat
 * facebook like chat jQuery plugin using Pusher API
 * version: 1.0
 * Author & support : zied.hosni.mail@gmail.com
 * © 2012 html5-ninja.com
 * for more info please visit http://html5-ninja.com
 *
*/

#pusherChat{position: fixed; right:0; bottom: 0;font-family:Arial,Helvetica,Garuda,sans-serif;font-size: 12px;color:#515151 ;width: 100%}
#pusherChat #membersContent{
    position:absolute;right: 10px; bottom:-2px ; width: 200px; border:#ccc 1px solid ;background: #eee;
    padding: 2px;box-shadow: 0px -1px 3px #ccc
}
#pusherChat #membersContent a{
    position: relative; background: #fff;color:#515151;padding: 2px 0px ;display: block;border-top:1px solid #eee;width: available;
    text-decoration: none;padding: 2px 4px;height: 28px; line-height: 28px;text-indent: 10px
}
#pusherChat #membersContent a.off{opacity: 0.5; background/*\**/: #eee\9;}
#pusherChat #membersContent a:hover{background: #00B4FF;color :#fff}
#pusherChat #membersContent h2{font-size: 12px;line-height: 0;text-indent: 10px; }
#pusherChat #membersContent .scroll{overflow-y :auto }
#pusherChat #expand, #pusherChat .expand{ font-size: 15px; font-weight: bold;position: absolute; right: 10px; top: 0px;cursor: pointer;}
#pusherChat #expand .open,#pusherChat .pusherChatBox .expand .open{display: none; }
#pusherChat .pusherChatBox .expand {right: 20px}
#pusherChat #membersContent a img{width: 25px;height: 25px;margin: 2px 0 0 0; outline: 1px solid #eee;border:none}
#pusherChat .pusherChatBox{width: 200px;padding: 2px 4px; background: #eee;position: relative;bottom: -2px ;border:#ccc 1px solid;box-shadow: 0px -1px 3px #ccc }
#pusherChat .pusherChatBox textarea{overflow: auto;resize: none; width: 194px;margin: 4px auto;font-size: 11px;font-family:Arial,Helvetica,Garuda,sans-serif;border:1px solid #ccc}
#pusherChat .pusherChatBox .logMsg{word-break: break-all;padding-top: 11px;width: 198px; background: #fff; height: 200px;margin: 0 auto;border:1px solid #ccc;overflow: hidden;position: relaive; overflow-y: auto;}
#pusherChat .pusherChatBox h2{margin: 0;padding: 0;display: block;font-size: 12px;padding-top: 1px;padding-bottom: 2px}
#pusherChat .pusherChatBox h2 img{z-index: 100;position: relative ;border: 1px solid #ccc;margin-right: 4px;margin-bottom: -16px;margin-left: 1px;}
#pusherChat .pusherChatBox .closeBox{font-size: 16px; font-weight: bold;position: absolute; right: 5px; top: 0px;cursor: pointer;}
#pusherChat .pusherChatBox h2  a{text-decoration: none; color:inherit}
#pusherChat .pusherChatBox .state{position: absolute; left: 26px ; top :3px;z-index: 101}
#pusherChat .pusherChatBox .state .quote,#pusherChat .pusherChatBox .state .pencil{display: none}
#pusherChat .pusherChatBox .msgTxt{padding: 0 1px;font-size: 11px;line-height: normal}
#pusherChat .pusherChatBox .msgTxt p{padding: 0;margin: 0;border-bottom: 1px solid #eee}
#pusherChat .pusherChatBox .msgTxt p.you b{ color:#00B4FF}
#pusherChat .pusherChatBox .msgTxt p.friend b{ color:#000}
#pusherChat .pusherChatBox.off{background-color: #ccc;}
#pusherChat .pusherChatBox.off h2 img{opacity: 0.6}
#pusherChat .pusherChatBox.writing .state .pencil{display: block}
#pusherChat .pusherChatBox.recive .state .quote{
    display: block;
    -webkit-animation: pulsate 0.5s ease-out;
    -webkit-animation-iteration-count: infinite;
    animation: pulsateFF 1s ease-out;
    animation-iteration-count: infinite;
    opacity: 1;
}

@-webkit-keyframes pulsate {
    0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;}
50% {opacity: 1.0;}
100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;}
}

@keyframes pulsateFF {
    0% {transform: scale(0.1, 0.1); opacity: 0.0;}
50% {opacity: 1.0;}
100% {transform: scale(1.2, 1.2); opacity: 0.0;}
}
#pusherChat .chatBoxWrap{float: left;  position: relative }
#pusherChat .chatBoxWrap .pusherChatBox{ margin-right: 10px;position: absolute}
#templateChatBox{display: none}
.chatBoxslide{float: right;position: relative;}
.overFlow{top: 9000px !important}
#pusherChat .chatBoxWrap #slideLeft,#pusherChat .chatBoxWrap #slideRight{display: none;position: absolute;font-size: 18px; top:-24px;cursor: pointer;color :#00B4FF }
#pusherChat .chatBoxWrap #slideLeft img,#pusherChat .chatBoxWrap #slideRight img{display: none}
#pusherChat .chatBoxWrap #slideLeft.on img,#pusherChat .chatBoxWrap #slideRight.on img{display: block}
#pusherChat .chatBoxWrap #slideLeft {left: 10px;}
#pusherChat .chatBoxWrap #slideRight{right: -5px}
#pusherChat .chatBoxWrap  .overFlowHide{display: none}


text:
namespace Clipboard {
  void copy(DocRef document);
  void cut(DocRef document);
  void paste(DocRef document, Page *page);
}

#endif


text:
namespace base{

template < typename KeyType, typename MappedType,
typename Comp = std::less< KeyType > >
struct linked_map {

	typedef KeyType key_type;
	typedef MappedType mapped_type;
	typedef std::pair< const key_type, mapped_type > value_type;

private:

	typedef std::list< value_type > list_type;
	typedef typename list_type::iterator list_iterator;

	struct compare_keys {

		Comp the_order;

		compare_keys ( Comp o )
			: the_order ( o )
		{}

		bool operator() ( list_iterator lhs, list_iterator rhs ) const {
			return ( the_order( lhs->first, rhs->first ) );
		}

	};

	typedef std::set< list_iterator, compare_keys > set_type;
	typedef typename set_type::iterator set_iterator;

	list_type the_list;
	set_type the_set;

public:

	typedef list_iterator iterator;
	typedef typename set_type::size_type size_type;

	linked_map ( Comp o = Comp() )
		: the_list()
		, the_set ( compare_keys( o ) )
	{}

	iterator find ( key_type const & key ) {
		value_type dummy_value ( key, mapped_type() );
		list_type dummy_list;
		dummy_list.push_back( dummy_value );
		set_iterator where = the_set.find( dummy_list.begin() );
		if ( where == the_set.end() ) {
			return ( the_list.end() );
		}
		return ( *where );
	}

	iterator insert ( value_type const & value ) {
		list_type dummy;
		dummy.push_back( value );
		set_iterator where = the_set.find( dummy.begin() );
		if ( where == the_set.end() ) {
			the_list.push_back( value );
			list_iterator pos = the_list.end();
			-- pos;
			the_set.insert( pos );
			return ( pos );
		} else {
			(*where)->second = value.second;
			return ( *where );
		}
	}

	iterator erase ( iterator where ) {
		the_set.erase( where );
		return ( the_list.erase( where ) );
	}

	iterator begin ( void ) {
		return ( the_list.begin() );
	}

	iterator end ( void ) {
		return ( the_list.end() );
	}

	size_type size ( void ) const {
		return ( the_set.size() );
	}

	mapped_type & operator[] ( key_type const & key ) {
		iterator pos = insert( std::make_pair( key, mapped_type() ) );
		return ( pos->second );
	}

	bool empty ( void ) const {
		return ( the_set.size()==0 );
	}

};

}

#if 0
#include <iostream>

int main ( void ) {
	linked_map< int, int > lm;
	lm[4] = 3;
	lm[2] = 1;
	lm[5] = 2;
	lm[2] = 0;
	for ( linked_map<int,int>::iterator iter = lm.begin();
		iter != lm.end(); ++iter ) {
			std::cout << iter->first << " --> " << iter->second << '\n';
	}
}
#endif

#endif // end of file


text:
using System;
using System.Collections;
using UnityEngine;

namespace WWWNetworking
{
	/// <summary>
	/// Runs a request with error checking.
	/// </summary>
	public class RequestWithError : Request
	{
		/// <summary>
		/// Error callback. Called when a request fails. the parameter is the reason for failure.
		/// </summary>
		/// <value>Error callback</value>
		Action<string> m_Error { get; set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="T:WWWNetworking.RequestWithError"/> class.
		/// </summary>
		/// <param name="url">URL for request</param>
		/// <param name="success">Success callback</param>
		/// <param name="error">Error callback</param>
		public RequestWithError(string url, Action<WWW> success, Action<string> error) : base(url, success)
		{
			m_Error = error;
		}

		/// <summary>
		/// Invokes the error delegate.
		/// </summary>
		/// <param name="error">Error text</param>
		protected void OnError(string error)
		{
			m_Error?.Invoke(error);
		}

		#region Base Overrides

		/// <summary>
		/// Runs the request.
		/// </summary>
		/// <returns>Enumerator for coroutine</returns>
		public override IEnumerator RunRequest()
		{
			using (var www = new WWW(Url)) {
				yield return www;

				CheckErrorOrSuccess(www);
			}
		}
		#endregion

		/// <summary>
		/// Performs a final error check.
		/// </summary>
		/// <param name="www">Object to check</param>
		protected void CheckErrorOrSuccess(WWW www)
		{
			if (string.IsNullOrEmpty(www.error)) {
				// No error means success
				OnSuccess(www);
			} else {
				OnError(www.error);
			}
		}
	}
}


text:
package nam.service.src.main.java;

import nam.model.Service;
import aries.codegen.AbstractBeanProvider;
import aries.generation.engine.GenerationContext;
import aries.generation.model.ModelClass;

/**
 * Abstract class to provide source for a Service Implementation {@link ModelClass} object given a {@link Service} Specification as input;
 *
 * Model construction properties:
 *

 *
generateJavadoc

 *

 *
 * @author tfisher
 */
public abstract class AbstractServiceListenerProvider extends AbstractBeanProvider {

	public AbstractServiceListenerProvider(GenerationContext context) {
		super(context);
	}

}


text:
/**
 * This package contains HBase coprocessor implementations for the transaction system.
 */
package co.cask.tephra.coprocessor;


text:
<?php

namespace Oro\Bundle\SecurityBundle\Tests\Unit\Form\Type;

use Oro\Bundle\SecurityBundle\Form\Type\AclPrivilegeIdentityType;
use Oro\Bundle\SecurityBundle\Form\Type\ObjectLabelType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;

class AclPrivilegeIdentityTypeTest extends \PHPUnit\Framework\TestCase
{
    /** @var AclPrivilegeIdentityType */
    protected $formType;

    protected function setUp()
    {
        $this->formType = new AclPrivilegeIdentityType();
    }

    public function testBuildForm()
    {
        $builder = $this->getMockBuilder('Symfony\Component\Form\FormBuilder')
            ->disableOriginalConstructor()
            ->getMock();
        $builder->expects($this->at(0))->method('add')->with('id', HiddenType::class, array('required' => true));
        $builder->expects($this->at(1))->method('add')
            ->with('name', ObjectLabelType::class, array('required' => false));
        $this->formType->buildForm($builder, array());
    }

    public function testConfigureOptions()
    {
        $resolver = $this->getMockBuilder('Symfony\Component\OptionsResolver\OptionsResolver')
            ->disableOriginalConstructor()
            ->getMock();

        $resolver->expects($this->once())->method('setDefaults')
            ->with(
                array(
                    'data_class' => 'Oro\Bundle\SecurityBundle\Model\AclPrivilegeIdentity'
                )
            );
        $this->formType->configureOptions($resolver);
    }
}


text:
var webshot = require('./webshot')
  , should = require('should')
  , fs = require('fs')
  , im = require('imagemagick')
  , helper = require('./helper')
  , server = require('../index')
  , pngOutput = helper.pngOutput
  , fixtures = helper.fixtures;

describe('Creating screenshot images', function() {
  this.timeout(20000);

  it('creates a screenshot', function(done) {
    webshot('google.com', pngOutput, function(err) {
      if (err) return done(err);

      fs.exists(pngOutput, function(exists) {
        exists.should.equal(true);
        done();
      });
    });
  });

  it('overwrites existing screenshots', function(done) {
    webshot('google.com', pngOutput, function(err) {
      if (err) return done(err);

      fs.stat(pngOutput, function (err, initial) {
        if (err) return done(err);

        setTimeout(function() {
          webshot('google.com', pngOutput, function(err) {
            if (err) return done(err);

            fs.stat(pngOutput, function (err, overwritten) {
              if (err) return done(err);

              initial.mtime.should.be.below(overwritten.mtime);
              done();
            });
          });
        }, 1000);
      });
    });
  });

  it('streams a screenshot', function(done) {
    var renderStream = webshot('google.com');
    var file = fs.createWriteStream(pngOutput, {encoding: 'binary'});

    renderStream.on('data', function(data) {
      file.write(data.toString('binary'), 'binary');
    });

    renderStream.on('end', function() {
      im.identify(pngOutput, function(err, features) {
        features.width.should.be.above(0);
        features.height.should.be.above(0);
        done();
      });
    });
  });

  it('streams a screenshot even if the page has JS errors', function(done) {
    var badHTML =
      '';
    var renderStream = webshot(badHTML, {siteType:'html'});
    var file = fs.createWriteStream(pngOutput, {encoding: 'binary'});

    renderStream.on('data', function(data) {
      file.write(data.toString('binary'), 'binary');
    });

    renderStream.on('end', function() {
      im.identify(pngOutput, function(err, features) {
        features.width.should.be.above(0);
        features.height.should.be.above(0);
        done();
      });
    });
  });

  it('streams a screenshot with the old callback interface', function(done) {
    webshot('google.com', function(err, renderStream) {
      if (err) return done(err);

      var file = fs.createWriteStream(pngOutput, {encoding: 'binary'});

      renderStream.on('data', function(data) {
        file.write(data.toString('binary'), 'binary');
      });

      renderStream.on('end', function() {
        im.identify(pngOutput, function(err, features) {
          features.width.should.be.above(0);
          features.height.should.be.above(0);
          done();
        });
      });
    });
  });
});

describe('Passing errors for bad input', function() {
  it('passes an error if an invalid extension is given', function(done) {
    webshot('betabeat.com', 'output.xyz', function(err) {
      should.exist(err);
      done();
    });
  });

  it('passes an error if a misformatted address is given', function(done) {
    webshot('abcdefghijklmnop', pngOutput, function(err) {
      should.exist(err);
      done();
    });
  });

  it('passes an error if no webpage exists at the address', function(done) {
    webshot('http://abc1234xyz123455555.com', pngOutput, function(err) {
      should.exist(err);
      done();
    });
  });
});


text:
'use strict';

var assert = require('assert');
var seneca = require('seneca')();
var senecaMock = require('..');
var debug = require('debug')('senecaMock:test.index');

describe('seneca-mock', function() {

  describe('infrastructure', function() {

    it('should check that seneca is operating normally', function (done) {
      var action = {
        role: 'testrole',
        cmd: 'testcmd'
      };
      seneca.add(action,function(args,callback){
        return callback(null, {dummy: 'result'});
      });
      seneca.act(action,function(err,result){
        assert.ok(result);
        assert.equal(result.dummy,'result');
        done();
      });
    });

  });

  describe('mock-error', function() {

    it('should mock an error with a custom message', function (done) {
      var errorMsg = 'test mock error message';
      var action = {
        role: 'testrole',
        cmd: 'testcmd'
      };

      senecaMock.senecaMockError(seneca,action,1,errorMsg);

      seneca.act(action,function(err){
        // TODO: Need to check for custom message
        debug('%o', err);
        assert.equal(err.code, 'action-error');
        assert(err);
        done();
      });
    });

    it('should mock an error with the default message', function (done) {
      var action = {
        role: 'testrole',
        cmd: 'testcmd'
      };

      var errorMock = senecaMock.senecaMockError(seneca,action,1);

      seneca.act(action,function(err){
        // TODO: Need to check for default message
        debug('%o', err);
        assert.equal(err.code, 'action-error');
        assert(err);
        assert(errorMock.callCount(),1);
        done();
      });
    });

    it('should only generate the error once', function (done) {
      var action = {
        role: 'testrole',
        cmd: 'testcmd'
      };

      seneca.add(action, function(args,callback){
        return callback(null,args);
      });

      var errorMock = senecaMock.senecaMockError(seneca,action,1);

      seneca.act(action,function(err){
        // TODO: Need to check for default message
        debug('%o', err);
        assert.equal(err.code, 'action-error');
        assert(err);
        assert(errorMock.callCount(),1);
        // The second call to the same action should not generate an
        // error but call the previously 'add'ed seneca service
        seneca.act(action,function(err,result) {
          assert(!err);
          assert(result);
          assert(result.role,'testrole');
          done();
        });
      });
    });

  });

  describe('mock-make', function() {

    it('should throw an error if options are not provided', function(done){
          try {
            senecaMock.senecaFakeMake();
          } catch(e) {
            assert.equal(e,
                'TypeError: Cannot read property \'entity\' of undefined');
            done();
          }
    });

    it('should throw an error if the entity property is not provided',
        function(done){
          try {
            senecaMock.senecaFakeMake({});
          } catch(e) {
            assert.equal(e,
                'Error: entity and seneca must be provided');
            done();
          }
    });

    it('should throw an error if the realMake property is not provided',
        function(done){
          try {
            senecaMock.senecaFakeMake({entity:'x'});
          } catch(e) {
            assert.equal(e,
                'Error: entity and seneca must be provided');
            done();
          }
    });

    it('should mock the entity make$ function', function(done){
      var options = {
        entity: 'users',
        seneca: seneca
      };
      seneca.make$ = senecaMock.senecaFakeMake(options);

      var userEntity = seneca.make$('users');
      userEntity.load$({query:'nothing'},function(err){
        assert.equal(err,'fake load$ error');
        done();
      });

    });

    it('should mock the entity load$ function');
    it('should mock the entity remove$ function');
    it('should mock the entity list$ function');
    it('should mock the entity save$ function');
    it('should call the real make function');
  });

  describe('mock-data', function() {

    it('should return mock data on the first call');
    it('should return non-mock data on the second call');
  });

  describe('mock-spy', function() {

    it('should provide sinon spy functionality to callback');
  });

});


text:
<?php $this->load->view('header') ?>

<img src="<?php echo $tool['thumb_url']; ?>" class="group-img"><?php echo $tool['name']; ?>

<a href="<?php echo site_url('tool/featured/MostAppreciated/'.$tool['type_link'])?>" title="tool type"><?php echo $tool['type_name']; ?>

<?= $this->lang->line('tool_about'); ?>

<?= $this->lang->line('tool_top_demos'); ?>

<?= $this->lang->line('tool_top_showcases'); ?>

<?= $this->lang->line('tool_recent_topics'); ?>

<?= $this->lang->line('tool_related_tools'); ?>

<?php if (($this->session->userdata('id')&&$this->session->userdata('id')==$tool['admin_id'])||$this->session->userdata('id')=='1000001'){  ?>
<a class="form-sub tagline-action" href="<?php echo site_url('tool/edit/'.$tool['id'])?>"><?= $this->lang->line('tool_edit'); ?>
<a class="form-sub tagline-action" href="<?php echo site_url('tool/addlink/'.$tool['id'])?>"><?= $this->lang->line('tool_add_link'); ?>
<?php  }?>
	<?php if ($isin!=null&&$isin>0){  ?>
		<?php if ($tool['admin_id'] == $this->session->userdata('id')) {?>
			<?= $this->lang->line('tool_quit_group'); ?>
		<?php } else {?>
			<a class="form-sub tagline-action" href="<?php echo site_url('group/quit/'.$tool['group_id'])?>"><?= $this->lang->line('tool_quit_group'); ?>
		<?php }?>

	<?php  }else{?>
	<a class="form-sub tagline-action" href="<?php echo site_url('group/join/'.$tool['group_id'])?>"><?= $this->lang->line('tool_join_group'); ?>
	<?php  }?>

<?php if ($tool['github_url']!=null&&$tool['github_url']!=''){  ?>
<a target="_blank" class="form-sub tagline-action" href="<?php echo $tool['github_url']?>">Fork
<?php  }?>

<?= $this->lang->line('tool_about'); ?> <?php echo $tool['name']; ?>

<?php echo auto_link($tool['desc'], 'both', TRUE); ?>

<?= $this->lang->line('tool_useful_link'); ?>

		      <?php foreach($urls as $_url): ?>

<?php echo $_url['desc']; ?>

		    <a id="free-download" class="form-sub" target="_blank" href="<?=site_url('download/software/'.$_url['key'])?>"><?php echo $_url['title']; ?>
		    <?php if (($this->session->userdata('id')&&$this->session->userdata('id')==$tool['admin_id'])||$this->session->userdata('id')=='1000001'){  ?>
		    <a href="<?=site_url('tool/editlink/'.$_url['id'])?>"><?= $this->lang->line('tool_edit'); ?>
		    <?php  }?>

		    <?php endforeach; ?>

<?= $this->lang->line('tool_top_demos'); ?>
		 <a href="<?=site_url('item/demo/'.$tool['domain'].'')?>"><?= $this->lang->line('tool_more'); ?>

		 <?php if ($this->session->userdata('id')){  ?>
	<a href="<?php echo site_url('item/submitdemo/'.$tool['id'])?>"><?= $this->lang->line('tool_submit_demo'); ?>
	<?php  }else{?>
	<?= $this->lang->line('tool_submit_demo'); ?>
	<?php  }?>

	<?php foreach($hot_item_list as $_item): ?>

                   <li id="work-<?php echo $_item['id']; ?>" class="group ">

	          <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>" class="effecthub-link"><div data-picture="" data-alt="<?php echo $_item['title']; ?>">
  <?php if($_item['thumb_url']!=null||$_item['pic_url']!=null){ ?>
  	<span class="item_image_wrap" alt="<?php echo $_item['title']; ?>">
                        <span class="item_image" style="background-image:url(<?php echo $_item['thumb_url']; ?>)">

  <?php  }else{?>
  	<iframe src="<?=site_url('item/preview_html/'.$_item['id'])?>" scrolling="no"   frameborder="NO" border="0" framespacing="0" style="width: 300px; height: 200px;padding:0px;margin:0px;">
  <?php  }?>

	          <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>" class="effecthub-over" style="opacity: 0;">		<?php echo $_item['type_name']; ?> - <?php echo $_item['title']; ?>
	            <?php echo msubstr(auto_link($_item['desc'], 'both', TRUE),0,200); ?>

	            <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>" title="See fans of this work"><?php echo $_item['fav_num']; ?>

	            <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>#comments" title="View comments on this work"><?php echo $_item['comment_num']; ?>

<?php echo $_item['view_num']; ?>

	        <a href="<?=site_url('user/'.$_item['author_id'])?>" class="url" rel="contact" title="<?php echo $_item['author_name']; ?>"><img alt="<?php echo $_item['author_name']; ?>" class="photo" src="<?php echo $_item['author_pic']; ?>"> <?php echo $_item['author_name']; ?>

	          <?php echo get_level($_item['author_level'],$_item['author_point']); ?>

                <?php endforeach; ?>

<?= $this->lang->line('tool_top_showcases'); ?>
		 <a href="<?=site_url('item/showcase/'.$tool['domain'].'')?>"><?= $this->lang->line('tool_more'); ?>

		 <?php if ($this->session->userdata('id')){  ?>
	<a href="<?php echo site_url('item/submitshowcase/'.$tool['id'])?>"><?= $this->lang->line('tool_submit_showcase'); ?>
	<?php  }else{?>
	<?= $this->lang->line('tool_submit_showcase'); ?>
	<?php  }?>

	<?php foreach($hot_showcase_list as $_item): ?>

                   <li id="work-<?php echo $_item['id']; ?>" class="group ">

	          <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>" class="effecthub-link"><div data-picture="" data-alt="<?php echo $_item['title']; ?>">
  <?php if($_item['thumb_url']!=null||$_item['pic_url']!=null){ ?>
  	<span class="item_image_wrap" alt="<?php echo $_item['title']; ?>">
                        <span class="item_image" style="background-image:url(<?php echo $_item['thumb_url']; ?>)">

  <?php  }else{?>
  	<iframe src="<?=site_url('item/preview_html/'.$_item['id'])?>" scrolling="no"   frameborder="NO" border="0" framespacing="0" style="width: 300px; height: 200px;padding:0px;margin:0px;">
  <?php  }?>

	          <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>" class="effecthub-over" style="opacity: 0;">		<?php echo $_item['type_name']; ?> - <?php echo $_item['title']; ?>
	            <?php echo msubstr(auto_link($_item['desc'], 'both', TRUE),0,200); ?>

	            <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>" title="See fans of this work"><?php echo $_item['fav_num']; ?>

	            <a href="<?=site_url('item/'.$_item['id']).'?tool='.$tool['id']?>#comments" title="View comments on this work"><?php echo $_item['comment_num']; ?>

<?php echo $_item['view_num']; ?>

	        <a href="<?=site_url('user/'.$_item['author_id'])?>" class="url" rel="contact" title="<?php echo $_item['author_name']; ?>"><img alt="<?php echo $_item['author_name']; ?>" class="photo" src="<?php echo $_item['author_pic']; ?>"> <?php echo $_item['author_name']; ?>

	          <?php echo get_level($_item['author_level'],$_item['author_point']); ?>

                <?php endforeach; ?>

<?= $this->lang->line('tool_recent_topics'); ?> <a href="<?=site_url('group/'.$tool['group_id'])?>"><?= $this->lang->line('tool_more'); ?>

		<?php if ($this->session->userdata('id')){  ?>
	<a href="<?php echo site_url('topic/create/'.$tool['group_id'])?>"><?= $this->lang->line('tool_submit_topic'); ?>
	<?php  }else{?>
	<?= $this->lang->line('tool_submit_topic'); ?>
	<?php  }?>

		<?php foreach($topic_list as $_topic): ?>

 <?php echo $_topic['comment_num']; ?>

		 <a href="<?php echo site_url('topic/'.$_topic['id'])?>" target="_blank" style="color:#aaa"><?php echo $_topic['topic_title']; ?>

		<?php endforeach; ?>

<?= $this->lang->line('tool_related_tools'); ?>
		<a href="<?php echo site_url('tool/featured/MostAppreciated/'.$tool['type_name'])?>"><?= $this->lang->line('tool_more'); ?>

		<?php foreach($hot_tools as $_group): ?>

		<a href="<?php echo site_url('t/'.$_group['domain'])?>"><img src="<?php echo $_group['pic_url']; ?>" class="group-img">

		<a href="<?php echo site_url('t/'.$_group['domain'])?>" class="group-title"><?php echo $_group['name']; ?>

<?php echo $_group['fav_num']; ?> <?= $this->lang->line('tool_members'); ?>
<?php echo $_group['comment_num']; ?> <?= $this->lang->line('tool_topics'); ?>

		<?php endforeach; ?>

<?php if ($tool['donate']){  ?>

<?= $this->lang->line('tool_donate'); ?>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
                        <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $tool['donate']; ?>">
<input type="hidden" name="item_name" value="<?php echo $tool['name']; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="">
<input type="hidden" name="return" value="<?php echo site_url('t/'.$tool['domain'])?>">
<input type="hidden" name="cancel_return" value="<?php echo site_url('t/'.$tool['domain'])?>">
<input type="hidden" name="image_url" value="<?php echo $tool['pic_url']; ?>">
<input type="hidden" name="cbt" value="Return to <?php echo $tool['name']; ?> to Request Your Rewards">

</form>

<?php  }?>
<?php if ($tool['online_install']){  ?>

<?= $this->lang->line('tool_online_install'); ?>

<iframe src="<?php echo $tool['online_install']; ?>" frameborder="0" scrolling="no" width="215" height="180">

<?php  }?>

<?php if ($tool['parent_id']>0){  ?>

<?= $this->lang->line('tool_parent_tool'); ?>

		<a title="<?php echo $parent['name']; ?>" href="<?=site_url('t/'.$parent['domain'])?>">
		<?php if($parent['thumb_url']!=null||$parent['pic_url']!=null){ ?>
  <img width="60px" height="60px" alt="<?php echo $parent['name']; ?>" src="<?php echo $parent['thumb_url']; ?>">
  <?php  }?>

<?php  }?>
<?php if (count($subtool_list)>0){  ?>

<?php echo count($subtool_list); ?> <?= $this->lang->line('tool_sub_tools'); ?>

	<?php foreach($subtool_list as $_hot_item): ?>

		<a title="<?php echo $_hot_item['name']; ?>" href="<?=site_url('t/'.$_hot_item['domain'])?>"><img style="width:60px;height:60px" src="<?php echo $_hot_item['thumb_url']==null?$_hot_item['pic_url']:$_hot_item['thumb_url']; ?>">
                        <?php endforeach; ?>

<?php  }?>

<?= $this->lang->line('tool_submitter'); ?>

<a href="<?=site_url('user/'.$tool['author_id'])?>"><?php echo $tool['author_name']; ?> <?= $this->lang->line('tool_submitted_at'); ?> <?= $tool['create_date']; ?>

<?= $this->lang->line('tool_recent_members'); ?>

<?php foreach($group_user_list as $_group_user): ?>
 <a href="<?php echo site_url('user/'.$_group_user['user_id']).'/'?>" style="margin:2px"><img height="30px" width="30px" title="<?php echo $_group_user['user_name']; ?>" src="<?php echo $_group_user['user_pic']; ?>" alt="<?php echo $_group_user['user_name']; ?>">
<?php endforeach; ?>

<?= $this->lang->line('pop_title_join'); ?>

<?= $this->lang->line('pop_login'); ?>

<?= $this->lang->line('pop_sign_up'); ?>

				    <a class="addthis_login_twitter" title="<?= $this->lang->line('pop_login_twitter'); ?>" href="<?=site_url('login/twitter')?>">
						            <a class="addthis_login_facebook" title="<?= $this->lang->line('pop_login_facebook'); ?>" href="<?=site_url('login/facebook')?>">
						            <a class="addthis_login_google" title="<?= $this->lang->line('pop_login_google'); ?>" href="<?=site_url('login/google')?>">

				<?= $this->lang->line('pop_login_email_title'); ?>
				<form action="<?=site_url('login/check')?>" method="post">

				    <?= $this->lang->line('pop_login_email'); ?>
				    <input id="" name="email" type="text"/>

				    <?= $this->lang->line('pop_login_password'); ?>
				    <input id="" name="password" type="password"/>

					  <?= $this->lang->line('pop_remember'); ?>
				    <input type="checkbox" checked name="remember_me" id="remember_me"/>
					    <input class="save-btn" name="commit" type="submit" value="<?= $this->lang->line('pop_login'); ?>">

					<input type="hidden" name="redirectURL" value="<?=site_url('t/'.$tool['domain'])?>"/>
					</form>

				    <a class="addthis_login_twitter" title="<?= $this->lang->line('pop_sign_up_twitter'); ?>" href="<?=site_url('login/twitter')?>">
						            <a class="addthis_login_facebook" title="<?= $this->lang->line('pop_sign_up_facebook'); ?>" href="<?=site_url('login/facebook')?>">
						            <a class="addthis_login_google" title="<?= $this->lang->line('pop_sign_up_google'); ?>" href="<?=site_url('login/google')?>">

				<?= $this->lang->line('pop_sign_up_email_title'); ?>
				<form id="signin_form" action="<?=site_url('register/save')?>" method="post">

				    <?= $this->lang->line('pop_sign_up_email'); ?>
				    <input id="email_address" name="email_address" type="text" value=""/>
<?= $this->lang->line('pop_email_error'); ?>

				    <?= $this->lang->line('pop_sign_up_password'); ?>
				    <input id="password" name="password" type="password" value=""/>
				    <?= $this->lang->line('pop_password_error'); ?>

					  <?= $this->lang->line('pop_sign_up_stay_informed'); ?>
				    <input type="checkbox" checked name="consent" id="consent"/>
					    <input class="save-btn" name="commit" type="button" value="<?= $this->lang->line('pop_sign_up_free'); ?>" onclick="checksignup();_gaq.push(['_trackEvent', 'signup', 'clicked', 'Click Sign Up Button In task Page'])">

					<input type="hidden" name="redirectURL" value="<?=site_url('t/'.$tool['domain'])?>"/>
					</form>

<?php $this->load->view('footer') ?>


text:
import * as tree_benchmark from './tree_benchmark';

export function main() {
  tree_benchmark.main();
}


text:
<?php

/**
 * The "attributes" collection of methods.
 * Typical usage is:
 *  <code>
 *   $apigeeService = new Google_Service_Apigee(...);
 *   $attributes = $apigeeService->attributes;
 *  </code>
 */
class Google_Service_Apigee_Resource_OrganizationsApiproductsAttributes extends Google_Service_Resource
{
  /**
   * Deletes an API product attribute. (attributes.delete)
   *
   * @param string $name Required. Name of the API product attribute. Use the
   * following structure in your request:
   * `organizations/{org}/apiproducts/{apiproduct}/attributes/{attribute}`
   * @param array $optParams Optional parameters.
   * @return Google_Service_Apigee_GoogleCloudApigeeV1Attribute
   */
  public function delete($name, $optParams = array())
  {
    $params = array('name' => $name);
    $params = array_merge($params, $optParams);
    return $this->call('delete', array($params), "Google_Service_Apigee_GoogleCloudApigeeV1Attribute");
  }
  /**
   * Gets the value of an API product attribute. (attributes.get)
   *
   * @param string $name Required. Name of the API product attribute. Use the
   * following structure in your request:
   * `organizations/{org}/apiproducts/{apiproduct}/attributes/{attribute}`
   * @param array $optParams Optional parameters.
   * @return Google_Service_Apigee_GoogleCloudApigeeV1Attribute
   */
  public function get($name, $optParams = array())
  {
    $params = array('name' => $name);
    $params = array_merge($params, $optParams);
    return $this->call('get', array($params), "Google_Service_Apigee_GoogleCloudApigeeV1Attribute");
  }
  /**
   * Lists all API product attributes.
   * (attributes.listOrganizationsApiproductsAttributes)
   *
   * @param string $parent Required. Name of the API product. Use the following
   * structure in your request: `organizations/{org}/apiproducts/{apiproduct}`
   * @param array $optParams Optional parameters.
   * @return Google_Service_Apigee_GoogleCloudApigeeV1Attributes
   */
  public function listOrganizationsApiproductsAttributes($parent, $optParams = array())
  {
    $params = array('parent' => $parent);
    $params = array_merge($params, $optParams);
    return $this->call('list', array($params), "Google_Service_Apigee_GoogleCloudApigeeV1Attributes");
  }
  /**
   * Updates the value of an API product attribute. **Note**: OAuth access tokens
   * and Key Management Service (KMS) entities (apps, developers, and API
   * products) are cached for 180 seconds (current default). Any custom attributes
   * associated with entities also get cached for at least 180 seconds after
   * entity is accessed during runtime. In this case, the `ExpiresIn` element on
   * the OAuthV2 policy won't be able to expire an access token in less than 180
   * seconds. (attributes.updateApiProductAttribute)
   *
   * @param string $name Required. Name of the API product. Use the following
   * structure in your request: `organizations/{org}/apiproducts/{apiproduct}`
   * @param Google_Service_Apigee_GoogleCloudApigeeV1Attribute $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_Apigee_GoogleCloudApigeeV1Attribute
   */
  public function updateApiProductAttribute($name, Google_Service_Apigee_GoogleCloudApigeeV1Attribute $postBody, $optParams = array())
  {
    $params = array('name' => $name, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('updateApiProductAttribute', array($params), "Google_Service_Apigee_GoogleCloudApigeeV1Attribute");
  }
}


text:
package events;

import api.IComponent;
import api.IEntity;
import api.IInputSystem;
import api.ILevel;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ObservableValue;

/***
 * Implements a changeListener that listens to change in a SimpleObjectProperty.
 * <p> The check on the action IE Health == 0 would then occur in a Groovy Script</p>
 *
 * @author Anirudh Jonnavithula, Carolyn Yao
 */

public class PropertyTrigger extends Trigger {
    private final String entityID;
    private final Class<? extends IComponent> componentClass;
    private final String propertyName;
    private SimpleObjectProperty<Double> property;

    public PropertyTrigger (String entityID, Class<? extends IComponent> componentClass, SimpleObjectProperty<Double> property) {
        this.entityID = entityID;
        this.componentClass = componentClass;
        this.property = property;
        this.propertyName = property.getName();
    }

    public PropertyTrigger (String entityID, Class<? extends IComponent> componentClass, String propertyName) {
        this.entityID = entityID;
        this.componentClass = componentClass;
        this.propertyName = propertyName;
    }

    @Override
    public void changed (ObservableValue arg0, Object arg1, Object arg2) {
        setChanged();
        notifyObservers();
    }

    @Override
    @Deprecated
    public void clearListener (ILevel universe, IInputSystem inputSystem) {
        property.removeListener(this);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void clearListener (ILevel universe) {
        getProperty(universe).removeListener(this);
    }

    @SuppressWarnings("unchecked")
    @Override
    @Deprecated
    public void addHandler (ILevel universe, IInputSystem inputSystem) {
        getProperty(universe).addListener(this);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void addHandler (ILevel universe) {
        getProperty(universe).addListener(this);
    }

    private SimpleObjectProperty<?> getProperty (ILevel level) {
        IEntity entity = level.getEntitySystem().getEntity(entityID);
        IComponent component = entity.getComponent(componentClass);
        return component.getProperty(propertyName);
    }

    @Override
    public String toString () {
        return String.format("%s; %s; %s; %s", getClass().getSimpleName(), entityID, componentClass.getSimpleName(),
                propertyName);
    }

}


text:
{{myProfile.name}}

{{myProfile.tagline}}

{{myProfile.bio}}

{{showSingleProfile.name}}

                        add_boxAdd Friend
                        remove_circleRemove Friend

{{showSingleProfile.tagline}}

{{showSingleProfile.bio}}

            <input id="search-devs" type="text" class="validate" ng-model="search.name">

                searchSearch for cool Developers

{{dev.name}}


text:
require "localcallingguide/version"
require 'open-uri'
require 'xmlsimple'

module LocalCallingGuide
  def get_results(url)
    data = URI.open(url).read
    XmlSimple.xml_in(data, 'ForceArray' => false, 'KeyToSymbol' => false)
    # It would be nice to use KeyToSymbol but I have to figure out how to
    # handle hyphened keys, i.e. "company-name"
  end

  module_function :get_results

  class LocalExchange
    def self.prefixes(exch, dir=1, rconly=0)
      exch_data = LocalCallingGuide.get_results("http://www.localcallingguide.com/xmllocalexch.php?exch=#{exch}&dir=#{dir}&rconly=#{rconly}")
      exch_data['lca-data']['prefix']
    end
  end

  class LocalPrefix
    def self.prefixes(npa, nxx, dir=1)
      prefix_data = LocalCallingGuide.get_results("http://www.localcallingguide.com/xmllocalprefix.php?npa=#{npa}&nxx=#{nxx}&dir=#{dir}")
      prefix_data['lca-data']['prefix']
    end
  end

  class Prefix
    def self.npanxx(npa, nxx)
      prefix_data = LocalCallingGuide.get_results("http://www.localcallingguide.com/xmlprefix.php?npa=#{npa}&nxx=#{nxx}")
      prefix_data['prefixdata']
    end
  end

  class RateCentre
    def self.rate_centre(options)
      rc_data = LocalCallingGuide.get_results("http://www.localcallingguide.com/xmlrc.php?npa=#{options[:npa]}&rc=#{options[:rate_centre]}&region=#{options[:region]}&lata=#{options[:lata]}&lir=#{options[:lir]}&ocn=#{options[:ocn]}&udate=#{options[:udate]}")
      rc_data['rcdata']
    end
  end

  class Distance
    def self.rc_dist(npa1, nxx1, npa2, nxx2)
      dist_data = LocalCallingGuide.get_results("http://www.localcallingguide.com/xmlrcdist.php?npa1=#{npa1}&nxx1=#{nxx1}&npa2=#{npa2}&nxx2=#{nxx2}")
      dist_data['rcdist']
    end
  end
end


text:
extern int				g_iFzmCursorFocusGame;

extern int				g_iFzmCursorPosX;
extern int				g_iFzmCursorPosY;
extern int				g_FzmMouseButton[3];

//
extern void CreateBeforeFullZoomMap(void);

extern void DrawFzmBackToSurface( int dest_x, int dest_y, LPDIRECTDRAWSURFACE4 lpDDS, int x, int y, int width, int height, int Bltflag );
extern void DrawFzmBackToTexture2D( smTEXTUREHANDLE *hTexHandle, int X, int Y, int Angle, int HalfSize, int Blend );

extern int  SetFullZoomMap(int IsSet);
extern void DrawFullZoomMapCharPos(void);
extern void DrawFullZoomMap(void);
extern void MainFullZoomMap(void);
extern int  KeyFullZoomMap( WPARAM wParam );


text:
'use strict';

const http = require('http');
const path = require('path');
const fs = require('fs');

const env = process.env.NODE_ENV || 'development';
const isDev = env === 'development';
const templatePath = isDev
  ? path.join(__dirname, 'templates/dev_error.html')
  : path.join(__dirname, 'templates/prod_error.html');
const defaultTemplate = fs.readFileSync(templatePath, 'utf8');

const defaultOptions = {
  text,
  json,
  html,
  redirect: null,
  template: path.join(__dirname, 'error.html'),
  accepts: null,
};

module.exports = function onerror(app, options) {
  options = Object.assign({}, defaultOptions, options);

  app.context.onerror = function(err) {
    // don't do anything if there is no error.
    // this allows you to pass `this.onerror`
    // to node-style callbacks.
    if (err == null) {
      return;
    }

    // wrap non-error object
    if (!(err instanceof Error)) {
      const newError = new Error('non-error thrown: ' + err);
      // err maybe an object, try to copy the name, message and stack to the new error instance
      if (err) {
        if (err.name) newError.name = err.name;
        if (err.message) newError.message = err.message;
        if (err.stack) newError.stack = err.stack;
        if (err.status) newError.status = err.status;
        if (err.headers) newError.headers = err.headers;
      }
      err = newError;
    }

    const headerSent = this.headerSent || !this.writable;
    if (headerSent) err.headerSent = true;

    // delegate
    this.app.emit('error', err, this);

    // nothing we can do here other
    // than delegate to the app-level
    // handler and log.
    if (headerSent) return;

    // ENOENT support
    if (err.code === 'ENOENT') {
      err.status = 404;
    }

    if (typeof err.status !== 'number' || !http.STATUS_CODES[err.status]) {
      err.status = 500;
    }
    this.status = err.status;

    this.set(err.headers);

    let type = 'text';
    if (options.accepts) {
      type = options.accepts.call(this, 'html', 'text', 'json');
    } else {
      type = this.accepts('html', 'text', 'json');
    }
    type = type || 'text';
    if (options.all) {
      options.all.call(this, err, this);
    } else {
      if (options.redirect && type !== 'json') {
        this.redirect(options.redirect);
      } else {
        options[type].call(this, err, this);
        this.type = type;
      }
    }

    if (type === 'json') {
      this.body = JSON.stringify(this.body);
    }
    this.res.end(this.body);
  };

  return app;
};

/**
 * default text error handler
 * @param {Error} err
 */

function text(err) {
  // unset all headers, and set those specified
  this.res._headers = {};
  this.set(err.headers);

  this.body = (isDev || err.expose) && err.message
    ? err.message
    : http.STATUS_CODES[this.status];
}

/**
 * default json error handler
 * @param {Error} err
 */

function json(err) {
  const message = (isDev || err.expose) && err.message
    ? err.message
    : http.STATUS_CODES[this.status];

  this.body = { error: message };
}

/**
 * default html error handler
 * @param {Error} err
 */

function html(err) {
  this.body = defaultTemplate
    .replace('{{status}}', err.status)
    .replace('{{stack}}', err.stack);
  this.type = 'html';
}


text:
#ifndef NONICK_H
#define NONICK_H

#include <nobnc/noglobal.h>
#include <nobnc/nostring.h>
#include <memory>

class NoNetwork;
class NoNickPrivate;

class NO_EXPORT NoNick
{
public:
    NoNick(const NoString& mask = "");
    NoNick(const NoNick& other);
    NoNick& operator=(const NoNick& other);
    ~NoNick();

    bool isValid() const;
    bool equals(const NoString& nick) const;

    NoString nick() const;
    void setNick(const NoString& nick);

    NoString ident() const;
    void setIdent(const NoString& ident);

    NoString host() const;
    void setHost(const NoString& host);

    NoString hostMask() const;

    NoNetwork* network() const;
    void setNetwork(NoNetwork* network);

    uchar perm() const;
    NoString perms() const;
    bool hasPerm(uchar perm) const;
    void addPerm(uchar perm);
    void removePerm(uchar perm);

    void reset(); // TODO: still used from NoChannel...

private:
    std::shared_ptr<NoNickPrivate> d;
};

#endif // NONICK_H


text:
import {
  ambientLightEs100,
  ambientLightEs300
} from './chunks/AmbientLight.glsl';
import {
  directionalLightsEs100,
  directionalLightsEs300
} from './chunks/DirectionalLights.glsl';
import EsVersion from './chunks/EsVersion.glsl';
import { lambertEs100, lambertEs300 } from './chunks/Lambert.glsl';
import { phongEs100, phongEs300 } from './chunks/Phong.glsl';
import { pointLightsEs100, pointLightsEs300 } from './chunks/PointLights.glsl';

const phongFragmentShaderEs300 = `${EsVersion}
	#HOOK_PRECISION
	#HOOK_DEFINES

	layout(std140) uniform;

	in vec3 vDiffuse;
	in vec3 vPosition;
	in vec4 vWorldPosition;

	uniform vec3 uCameraPosition;

	#ifdef normals
	in vec3 vNormal;
	#endif

	#ifdef uv
	in vec2 vUv;
	#endif

	#ifdef ambientLight
	${ambientLightEs300}
	#endif

	#ifdef directionalLights
	${directionalLightsEs300}
	${lambertEs300}
	#endif

	#ifdef pointLights
	${pointLightsEs300}
	${phongEs300}
	#endif

	out vec4 outgoingColor;

	#HOOK_FRAGMENT_PRE

	void main(void){

		vec3 color = vec3(0.0);

		#ifdef normals
		vec3 normal = normalize(vNormal);
		#endif

		#HOOK_FRAGMENT_MAIN

		#ifdef directionalLights
		for (int i = 0; i < #HOOK_DIRECTIONAL_LIGHTS; i++) {
			color += CalculateDirectionalLight(uDirectionalLights[i], normal);
		}
		#endif

		#ifdef pointLights
		for (int i = 0; i < #HOOK_POINT_LIGHTS; i++) {
			color += CalculatePointLight(uPointLights[i], normal);
		}
		#endif

		outgoingColor = vec4(color.rgb, 1.0);

		#HOOK_FRAGMENT_END
	}
`;

const phongFragmentShaderEs100 = `
	#HOOK_PRECISION
	#HOOK_DEFINES

	varying vec3 vDiffuse;
	varying vec3 vPosition;
	varying vec4 vWorldPosition;

	#ifdef normals
	varying vec3 vNormal;
	#endif

	#ifdef uv
	varying vec2 vUv;
	#endif

	#ifdef ambientLight
	${ambientLightEs100}
	#endif

	#ifdef directionalLights
	${directionalLightsEs100}
	${lambertEs100}
	#endif

	#ifdef pointLights
	${pointLightsEs100}
	${phongEs100}
	#endif

	#HOOK_FRAGMENT_PRE

	void main(void){

		vec3 color = vec3(0.0);

		#ifdef normals
		vec3 normal = normalize(vNormal);
		#endif

		#HOOK_FRAGMENT_MAIN

		#ifdef directionalLights
		for (int i = 0; i < #HOOK_DIRECTIONAL_LIGHTS; i++) {
			color += CalculateDirectionalLight(uDirectionalLights[i], normal);
		}
		#endif

		#ifdef pointLights
		for (int i = 0; i < #HOOK_POINT_LIGHTS; i++) {
			color += CalculatePointLight(uPointLights[i], normal);
		}
		#endif

		gl_FragColor = vec4(color.rgb, 1.0);

		#HOOK_FRAGMENT_END
	}
`;

export { phongFragmentShaderEs300, phongFragmentShaderEs100 };


text:
#pragma once
#include <aws/codepipeline/CodePipeline_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace CodePipeline
{
namespace Model
{

  /**
   *
Information about the version (or revision) of a source artifact that
   * initiated a pipeline execution.

See Also:
   AWS
   * API Reference

   */
  class AWS_CODEPIPELINE_API SourceRevision
  {
  public:
    SourceRevision();
    SourceRevision(Aws::Utils::Json::JsonView jsonValue);
    SourceRevision& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline const Aws::String& GetActionName() const{ return m_actionName; }

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline bool ActionNameHasBeenSet() const { return m_actionNameHasBeenSet; }

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline void SetActionName(const Aws::String& value) { m_actionNameHasBeenSet = true; m_actionName = value; }

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline void SetActionName(Aws::String&& value) { m_actionNameHasBeenSet = true; m_actionName = std::move(value); }

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline void SetActionName(const char* value) { m_actionNameHasBeenSet = true; m_actionName.assign(value); }

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline SourceRevision& WithActionName(const Aws::String& value) { SetActionName(value); return *this;}

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline SourceRevision& WithActionName(Aws::String&& value) { SetActionName(std::move(value)); return *this;}

    /**
     *
The name of the action that processed the revision to the source
     * artifact.

     */
    inline SourceRevision& WithActionName(const char* value) { SetActionName(value); return *this;}

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline const Aws::String& GetRevisionId() const{ return m_revisionId; }

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline bool RevisionIdHasBeenSet() const { return m_revisionIdHasBeenSet; }

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline void SetRevisionId(const Aws::String& value) { m_revisionIdHasBeenSet = true; m_revisionId = value; }

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline void SetRevisionId(Aws::String&& value) { m_revisionIdHasBeenSet = true; m_revisionId = std::move(value); }

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline void SetRevisionId(const char* value) { m_revisionIdHasBeenSet = true; m_revisionId.assign(value); }

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline SourceRevision& WithRevisionId(const Aws::String& value) { SetRevisionId(value); return *this;}

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline SourceRevision& WithRevisionId(Aws::String&& value) { SetRevisionId(std::move(value)); return *this;}

    /**
     *
The system-generated unique ID that identifies the revision number of the
     * artifact.

     */
    inline SourceRevision& WithRevisionId(const char* value) { SetRevisionId(value); return *this;}

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline const Aws::String& GetRevisionSummary() const{ return m_revisionSummary; }

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline bool RevisionSummaryHasBeenSet() const { return m_revisionSummaryHasBeenSet; }

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline void SetRevisionSummary(const Aws::String& value) { m_revisionSummaryHasBeenSet = true; m_revisionSummary = value; }

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline void SetRevisionSummary(Aws::String&& value) { m_revisionSummaryHasBeenSet = true; m_revisionSummary = std::move(value); }

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline void SetRevisionSummary(const char* value) { m_revisionSummaryHasBeenSet = true; m_revisionSummary.assign(value); }

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline SourceRevision& WithRevisionSummary(const Aws::String& value) { SetRevisionSummary(value); return *this;}

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline SourceRevision& WithRevisionSummary(Aws::String&& value) { SetRevisionSummary(std::move(value)); return *this;}

    /**
     *
Summary information about the most recent revision of the artifact. For
     * GitHub and AWS CodeCommit repositories, the commit message. For Amazon S3
     * buckets or actions, the user-provided content of a
     * codepipeline-artifact-revision-summary key specified in the object
     * metadata.

     */
    inline SourceRevision& WithRevisionSummary(const char* value) { SetRevisionSummary(value); return *this;}

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline const Aws::String& GetRevisionUrl() const{ return m_revisionUrl; }

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline bool RevisionUrlHasBeenSet() const { return m_revisionUrlHasBeenSet; }

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline void SetRevisionUrl(const Aws::String& value) { m_revisionUrlHasBeenSet = true; m_revisionUrl = value; }

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline void SetRevisionUrl(Aws::String&& value) { m_revisionUrlHasBeenSet = true; m_revisionUrl = std::move(value); }

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline void SetRevisionUrl(const char* value) { m_revisionUrlHasBeenSet = true; m_revisionUrl.assign(value); }

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline SourceRevision& WithRevisionUrl(const Aws::String& value) { SetRevisionUrl(value); return *this;}

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline SourceRevision& WithRevisionUrl(Aws::String&& value) { SetRevisionUrl(std::move(value)); return *this;}

    /**
     *
The commit ID for the artifact revision. For artifacts stored in GitHub or
     * AWS CodeCommit repositories, the commit ID is linked to a commit details
     * page.

     */
    inline SourceRevision& WithRevisionUrl(const char* value) { SetRevisionUrl(value); return *this;}

  private:

    Aws::String m_actionName;
    bool m_actionNameHasBeenSet = false;

    Aws::String m_revisionId;
    bool m_revisionIdHasBeenSet = false;

    Aws::String m_revisionSummary;
    bool m_revisionSummaryHasBeenSet = false;

    Aws::String m_revisionUrl;
    bool m_revisionUrlHasBeenSet = false;
  };

} // namespace Model
} // namespace CodePipeline
} // namespace Aws


text:
using System;
using System.Collections.Generic;
using System.Linq;
using SME.AST;
using SME.AST.Transform;
using Microsoft.CodeAnalysis.CSharp;

namespace SME.VHDL.Transformations
{
    /// <summary>
    /// Handles cases where the loop increment is not one,
    /// by adding a temporary variable that holds the multiplied result,
    /// and updating the sub-tree to use that variable instead.
    /// </summary>
    public class FixForLoopIncrements : IASTTransform
    {
        /// <summary>
        /// The render state.
        /// </summary>
        private readonly RenderState State;
        /// <summary>
        /// The method being transformed.
        /// </summary>
        private readonly Method Method;
        /// <summary>
        /// Cache of already processed statements.
        /// </summary>
        private readonly HashSet<AST.ForStatement> m_processed = new HashSet<ForStatement>();

        /// <summary>
        /// Initializes a new instance of the <see cref="T:SME.VHDL.Transformations.FixForLoopIncrements"/> class.
        /// </summary>
        /// <param name="state">The render state.</param>
        /// <param name="method">The method being rendered.</param>
        public FixForLoopIncrements(RenderState state, Method method)
        {
            State = state;
            Method = method;
        }

        /// <summary>
        /// Applies the transformation.
        /// </summary>
        /// <returns>The transformed item.</returns>
        /// <param name="item">The item to visit.</param>
        public ASTItem Transform(ASTItem item)
        {
            var stm = item as AST.ForStatement;
            if (stm == null)
                return item;

            if (m_processed.Contains(stm))
                return item;
            m_processed.Add(stm);

            Tuple<int, int, int> loopedges = null;
            try
            {
                loopedges = stm.GetStaticForLoopValues();
            }
            catch
            {
                return item;
            }

            var incr = loopedges.Item3;
            if (incr == 1)
                return item;

            var tmp = State.RegisterTemporaryVariable(Method, stm.LoopIndex.MSCAType);
            State.TypeLookup[tmp] = VHDLTypes.INTEGER;

            // Find the first expression, so we can inject the assignment before it
            var firstexp = stm.LoopBody.All().OfType<Expression>().First();

            // Replace all the references
            foreach (var x in stm.All().OfType<Expression>())
            {
                var target = x.GetTarget();
                if (target == stm.LoopIndex)
                    x.SetTarget(tmp);
            }

            var exp = firstexp.SourceExpression;

            // Inject the assignment
            var nstm = new ExpressionStatement()
            {
                Expression = new AssignmentExpression()
                {
                    Left = new IdentifierExpression()
                    {
                        Name = tmp.Name,
                        Target = tmp,
                        SourceExpression = exp,
                        SourceResultType = tmp.MSCAType
                    },
                    Operator = SyntaxKind.EqualsToken,
                    Right = new BinaryOperatorExpression()
                    {
                        Left = new IdentifierExpression()
                        {
                            Name = stm.LoopIndex.Name,
                            Target = stm.LoopIndex,
                            SourceExpression = exp,
                            SourceResultType = stm.LoopIndex.MSCAType
                        },
                        Operator = SyntaxKind.AsteriskToken,
                        Right = new PrimitiveExpression()
                        {
                            Value = incr,
                            SourceResultType = tmp.MSCAType,
                            SourceExpression = exp,
                        },
                        SourceExpression = exp,
                        SourceResultType = tmp.MSCAType
                    },
                    SourceExpression = exp,
                    SourceResultType = tmp.MSCAType
                }
            };

            nstm.UpdateParents();
            foreach (var x in nstm.All().OfType<Expression>())
                State.TypeLookup[x] = VHDLTypes.INTEGER;

            stm.LoopBody.PrependStatement(nstm);

            //Do not fix again
            stm.Increment = new AssignmentExpression(
                new IdentifierExpression(stm.LoopIndex),
                new BinaryOperatorExpression(
                    new IdentifierExpression(stm.LoopIndex),
                    SyntaxKind.PlusToken,
                    new PrimitiveExpression(1, tmp.MSCAType)
                )
                { SourceResultType = tmp.MSCAType }
            ) { Parent = stm, SourceResultType = tmp.MSCAType };

            stm.Condition = new BinaryOperatorExpression(
                new IdentifierExpression(stm.LoopIndex),
                SyntaxKind.LessThanToken,
                new PrimitiveExpression((loopedges.Item2-1-loopedges.Item1) / loopedges.Item3 + 1,
                tmp.MSCAType.LoadType(typeof(int)))
            )
            {
                Parent = stm,
                SourceResultType = tmp.MSCAType.LoadType(typeof(bool))
            };

            stm.Initializer = new PrimitiveExpression(0, tmp.MSCAType);

            return nstm;
        }
    }

}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="VersionCheckService.cs" company="None">
//   Crispin Parker 2011
// </copyright>
// <summary>
//   Defines the VersionStatusOption type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace TfsWorkbench.VersionCheck.Services
{
    using System;
    using System.ComponentModel;

    using TfsWorkbench.Core.Services;
    using TfsWorkbench.VersionCheck.Iterfaces;
    using TfsWorkbench.VersionCheck.Models;

    /// <summary>
    /// The verison checkign service class.
    /// </summary>
    internal class VersionCheckService : IVersionCheckService
    {
        /// <summary>
        /// The web request reader factory instance.
        /// </summary>
        private readonly IWebRequestReaderFactory webRequestReaderFactory;

        /// <summary>
        /// Initializes a new instance of the <see cref="VersionCheckService"/> class.
        /// </summary>
        public VersionCheckService()
            : this(ServiceManager.Instance.GetService<IWebRequestReaderFactory>())
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="VersionCheckService"/> class.
        /// </summary>
        /// <param name="webRequestReaderFactory">The web request reader factory.</param>
        public VersionCheckService(IWebRequestReaderFactory webRequestReaderFactory)
        {
            if (webRequestReaderFactory == null)
            {
                throw new ArgumentNullException("webRequestReaderFactory");
            }

            this.webRequestReaderFactory = webRequestReaderFactory;
        }

        /// <summary>
        /// Begins the async version status check.
        /// </summary>
        /// <param name="callBack">The call back method.</param>
        public void BeginAsyncGetVersionStatus(Action<VersionStatus, Exception> callBack)
        {
            using (var bgw = new BackgroundWorker())
            {
                bgw.DoWork += (s, e) => e.Result = this.GetVersionStatus();

                bgw.RunWorkerCompleted += (s, e) => callBack(e.Result as VersionStatus, e.Error);

                bgw.RunWorkerAsync();
            }
        }

        /// <summary>
        /// Compare the version strings.
        /// </summary>
        /// <param name="localVersion">The local version.</param>
        /// <returns>The version status.</returns>
        private static VersionStatus CompareVersions(string localVersion)
        {
            return IsCurrentVersion(localVersion)
                       ? (VersionStatus)new UptoDateVersionStatus()
                       : new OutOfDateVersionStatus();
        }

        /// <summary>
        /// Determines whether [the specified version] [is current version].
        /// </summary>
        /// <param name="localVersion">The local version as a string.</param>
        /// <returns>
        /// <c>true</c> if [the specified version] [is current version]; otherwise, <c>false</c>.
        /// </returns>
        private static bool IsCurrentVersion(string localVersion)
        {
            return Helpers.GetLocalCoreVersion().Equals(localVersion);
        }

        /// <summary>
        /// Gets the version status.
        /// </summary>
        /// <returns>An instance of the version status class.</returns>
        private VersionStatus GetVersionStatus()
        {
            string response;
            return !this.TryGetCurrentVersionFromRemoteServer(out response)
                       ? new FailedToCheckVersionStatus(response)
                       : CompareVersions(response);
        }

        /// <summary>
        /// Tries to get the current application version from the remote server.
        /// </summary>
        /// <param name="response">The response.</param>
        /// <returns><c>True</c> if a web response is received; otherwise <c>false</c>.</returns>
        private bool TryGetCurrentVersionFromRemoteServer(out string response)
        {
            return this.CreateWebRequestReader().TryReadFirstLine(out response);
        }

        /// <summary>
        /// Creates the web request reader.
        /// </summary>
        /// <returns>A new instance of the web request reader class.</returns>
        private IWebRequestReader CreateWebRequestReader()
        {
            return this.webRequestReaderFactory.Create();
        }
    }
}


text:
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Coordinates
 *
 * @author paulaan
 */

namespace Vietland\AevitasBundle\Document;

use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;

/** @MongoDB\EmbeddedDocument */
class Coordinate {

    /** @MongoDB\Float */
    public $latitude;

    /** @MongoDB\Float */
    public $longitude;

    public function __construct($lat = 0, $long = 0) {
        $this->latitude = (float)$lat;
        $this->longitude = (float)$long;
    }

    public function getLatLng() {
        return array('latitude' => $this->latitude, 'longitude' => $this->longitude);
    }

    public function getLat(){
        return $this->latitude;
    }

    public function getLng(){
        return $this->longitude;
    }

}


text:
package com.passwordLib;

import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.*;
import javax.crypto.spec.*;

public class SimpleCrypto {
	private static final String ALGORITHME = "Blowfish";
	private static final String TRANSFORMATION = "Blowfish/ECB/PKCS5Padding";
	private static final String CHARSET = "ISO-8859-1";

	public static String encrypt(String plaintext, String SECRET)
			throws NoSuchAlgorithmException, NoSuchPaddingException,
			InvalidKeyException, UnsupportedEncodingException,
			IllegalBlockSizeException, BadPaddingException {

		Cipher cipher = Cipher.getInstance(TRANSFORMATION);
		cipher.init(Cipher.ENCRYPT_MODE,
				new SecretKeySpec(SECRET.getBytes(CHARSET), ALGORITHME));
		return new String(cipher.doFinal(plaintext.getBytes()), CHARSET);
	}

	public static String decrypt(String ciphertext, String SECRET)
			throws NoSuchAlgorithmException, NoSuchPaddingException,
			InvalidKeyException, UnsupportedEncodingException,
			IllegalBlockSizeException, BadPaddingException {
		Cipher cipher = Cipher.getInstance(TRANSFORMATION);
		cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(SECRET.getBytes(),
				ALGORITHME));
		return new String(cipher.doFinal(ciphertext.getBytes(CHARSET)), CHARSET);
	}
}


text:
Sogou SEM Services

## Installation

Add this line to your application's Gemfile:

    gem 'sogou'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sogou

## Knowledge
camel命名法,用于request数据格式
snake命名法,用于response数据格式

## Rspec
先修改spec/spec_helper.rb

```ruby

$username = ''
$password = ''
$token = ''

```

## Usage

SEM

```ruby
require 'sogou'

auth = Sogou::Auth.new
auth.username = 'username'
auth.password = 'password'
auth.token = 'token'

ss = Sogou::SEM::SearchService.new(auth)
res = ss.getAccountInfo({})
res = ss.getAccountInfo({},true) #debug=true
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
package name.benjaminAbbitt.common.cqrs.api;

public class Sneak {
    public static RuntimeException sneakyThrow(Throwable t) {
        if ( t == null ) throw new NullPointerException("t");
        Sneak.<RuntimeException>sneakyThrow0(t);
        return null;
    }

    @SuppressWarnings("unchecked")
    private static <T extends Throwable> void sneakyThrow0(Throwable t) throws T {
        throw (T)t;
    }
}